Skip to content

Update for bare metal area #1303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 51 commits into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
24b0168
Update for bare metal area
iriark01 Apr 22, 2020
427adc1
Added Mbed 2 to Mbed OS bare metal porting guide (#1293)
evedon Apr 22, 2020
7c630de
Adding bare metal porting to JSON
iriark01 Apr 22, 2020
f88acb4
First table - just to see what it looks like
iriark01 Apr 28, 2020
99658d6
Replacing Gap class link
iriark01 Apr 28, 2020
2953c93
Giving UX some symbols to choose from
iriark01 Apr 28, 2020
55002c0
Better preview for UX
iriark01 Apr 28, 2020
b7c9ad5
A bit more for testing
iriark01 Apr 28, 2020
32cf4bc
Index is ready
iriark01 Apr 29, 2020
07d4d97
More content from PR 1304
iriark01 Apr 29, 2020
cfb541c
Some tidying up from comments
iriark01 Apr 29, 2020
532b134
Quick edit
iriark01 Apr 29, 2020
803f7ed
Comments in intro
iriark01 Apr 29, 2020
1a8215c
Invalid JSON
iriark01 Apr 29, 2020
6beb754
Spans broke the table
iriark01 Apr 29, 2020
1b328ee
Missed some spans
iriark01 Apr 29, 2020
9fb4cd4
Draft for review
iriark01 Apr 29, 2020
43c04cf
Tidying up
iriark01 Apr 29, 2020
5b9b15d
Trying another place for the pic
iriark01 Apr 29, 2020
fd29abd
Typo fix
iriark01 Apr 29, 2020
b67138b
Will this work?
iriark01 Apr 29, 2020
78a34d5
Removing diagram
iriark01 Apr 29, 2020
22a8a6c
Updated from Evelyne's comments
iriark01 May 1, 2020
323d594
Merge branch 'development' into bare-metal-work
iriark01 May 1, 2020
c553a8a
Merge remote-tracking branch 'origin/bare-metal-work' into bare-metal…
iriark01 May 1, 2020
7a3df48
Quick starts to offer both Blinkys
iriark01 May 1, 2020
7cc13a1
Not showing LoRAWAN as supported
iriark01 May 4, 2020
3d5c509
Trying a new version of the API index
iriark01 May 4, 2020
d5f94db
Changing tick for manually enabled
iriark01 May 4, 2020
c34a79b
Demonstrating page order
iriark01 May 4, 2020
685240a
Util > Platform
iriark01 May 4, 2020
8927920
Is this a better title?
iriark01 May 4, 2020
0cd0767
New attempt at APIs
iriark01 May 5, 2020
a5e2bd3
Driver tidying
iriark01 May 5, 2020
177622a
Function link as tip
iriark01 May 5, 2020
9778f0f
Updating intro
iriark01 May 5, 2020
961c49f
Intro text update
iriark01 May 5, 2020
b2faa8d
Adding Wait
iriark01 May 6, 2020
ad87492
Adding Wait.md so the branch can build
iriark01 May 6, 2020
2964c31
Fixing deprecated APIs
iriark01 May 6, 2020
ecf3f14
Format fixes
iriark01 May 6, 2020
e9a7c03
Some comments from Evelyne + moving files
iriark01 May 7, 2020
1e98693
Organising Driver APIs
iriark01 May 9, 2020
4b4bb1b
Platform APIs
iriark01 May 9, 2020
5929b66
JSON fix + trying new format for table
iriark01 May 9, 2020
91a861e
I think this tidies up all APIs
iriark01 May 9, 2020
b3ff2e5
Differentiated marks (UX request)
iriark01 May 11, 2020
0e972ea
Tidying up the lists
iriark01 May 11, 2020
d840cff
Regrouping APIs
iriark01 May 11, 2020
79a3efb
Everything alphabetised
iriark01 May 11, 2020
bca50e9
Final comments
iriark01 May 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Bare metal APIs

The bare metal profile starts with a restricted list of API, to which you can add what you need. However, bare metal doesn't support all Mbed OS APIs.

## Initial list of APIs

By default, bare metal includes the following APIs:

## Adding APIs

<!--how?-->

## Full list of APIs

The [Mbed OS API list]() indicates which APIs are supported by bare metal.

<!--
Evelyne, my suggestion is to use something like


| API | Full Mbed OS | Bare metal |
| - | - | - |
| AnalogIn | &#9745; | &#9745; |

Although it's a bit silly, because of course it's supported in the full Mbed OS... I'd love some suggestions
-->

<!--
# Bare metal APIs

Mbed OS bare metal supports the following APIs:

<h2 id="analog-i-o">Analog I/O</h2>
Expand Down Expand Up @@ -45,3 +73,5 @@ Mbed OS bare metal supports the following APIs:
- I2CSlave - I²C bus slave.

- CAN - Controller-area network bus.

-->
File renamed without changes.
762 changes: 381 additions & 381 deletions docs.json

Large diffs are not rendered by default.

543 changes: 251 additions & 292 deletions docs/api/api.md

Large diffs are not rendered by default.

259 changes: 259 additions & 0 deletions docs/api/api_old.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
# Full API list

This is the full list of APIs Mbed OS offers. The list indicates which of the APIs the [bare metal profile](../bare-metal/index.html) supports, and which of those are enabled by default. For consistency, we also show the full profile's API support, although that is - and is expected to remain - all APIs.

<!--This list does not include the internal APIs, which are not intended for use by application code.-->

## RTOS and event handling

The Mbed OS RTOS capabilities include managing objects such as threads, synchronization objects and timers. It also provides interfaces for attaching an application-specific idle hook function, reads the OS tick count and implements functionality to report RTOS errors.

| API | Full profile | Bare metal profile |
| - | - | - |
| [Thread](../apis/rtos-apis.html) | &#10004; | |
| [ThisThread](../apis/thisthread.html) | &#10004; | &#10004; (enabled by default) |
| [Mutex](../apis/mutex.html) | &#10004; | &#10004; |
| [Semaphore](../apis/semaphore.html) | &#10004; | &#10004;|
| [Queue](../apis/queue.html) | &#10004; | |
| [EventQueue](../apis/eventqueue.html) | &#10004; | &#10004; |
| [UserAllocatedEvent](../apis/userallocatedevent.html) | &#10004; | &#10004; |
| [Mail](../apis/mail.html) | &#10004; | |
| [EventFlags](../apis/eventflags.html) | &#10004; | &#10004; |
| [Event](../apis/event.html) | &#10004; | &#10004; |
| [Conditionvariable](../apis/conditionvariable.html) | &#10004; | |
| [Kernel interface functions](../apis/kernel-interface-functions.html) | &#10004; | `get_ms_count` only |

## Drivers

The drivers are digital interfaces that allow your board to interface with a computer or external devices.


| API | Full profile | Bare metal profile |
| - | - | - |
| [Ticker](../apis/driver-apis.html) | &#10004; | &#10004; (enabled by default) |
| [Timeout](../apis/timeout.html) | &#10004; | &#10004; (enabled by default) |
| [Timer](../apis/timer.html) | &#10004; | &#10004; (enabled by default) |
| [Watchdog](../apis/watchdog.html) | &#10004; | &#10004;|
| [ResetReason](../apis/resetreason.html) | &#10004; | &#10004; |
| [Flash IAP](../apis/flash-iap.html) | &#10004; | &#10004; |
| [BufferedSerial](../apis/bufferedserial.html) | &#10004; | &#10004; (enabled by default) |
| [UnbufferedSerial](../apis/unbufferedserial.html) | &#10004; | &#10004; (enabled by default) |
| [SPI](../apis/spi.html) | &#10004; | &#10004; (enabled by default) |
| [SPISlave](../apis/spislave.html) | &#10004; | &#10004; (enabled by default) |
| [QuadSPI (QSPI)](../apis/quadspi-qspi.html) | &#10004; | &#10004; |
| [I2C](../apis/i2c.html) | &#10004; | &#10004; (enabled by default) |
| [I2CSlave](../apis/i2cslave.html) | &#10004; | &#10004; (enabled by default) |
| [CAN](../apis/can.html)| &#10004; | &#10004; (enabled by default) |
| [MbedCRC](../apis/mbedcrc.html) | &#10004; | &#10004; |

## Input/Output

Input/Output APIs include analog and digital inputs and outputs on development boards, as well as digital interfaces, which allow your board to interface with a computer or external devices.

| API | Full profile | Bare metal profile |
| - | - | - |
| [AnalogIn](../apis/i-o-apis.html) | &#10004; | &#10004; (enabled by default) |
| [AnalogOut](../apis/analogout.html) | &#10004; | &#10004; (enabled by default) |
| [DigitalIn](../apis/digitalin.html) | &#10004; | &#10004; (enabled by default) |
| [DigitalOut](../apis/digitalout.html) | &#10004; | &#10004; (enabled by default) |
| [DigitalInOut](../apis/digitalinout.html) | &#10004; | &#10004; (enabled by default) |
| [BusIn](../apis/busin.html) | &#10004; | &#10004; (enabled by default) |
| [BusOut](../apis/busout.html) | &#10004; | &#10004; (enabled by default) |
| [BusInOut](../apis/businout.html) | &#10004; | &#10004; (enabled by default) |
| [PortIn](../apis/portin.html) | &#10004; | &#10004; (enabled by default) |
| [PortOut](../apis/portout.html) | &#10004; | &#10004; (enabled by default) |
| [PortInOut](../apis/portinout.html) | &#10004; | &#10004; (enabled by default) |
| [PwmOut](../apis/pwmout.html) | &#10004; | &#10004; (enabled by default) |
| [InterruptIn](../apis/interruptin.html) | &#10004; | &#10004; (enabled by default) |

## Data storage

The data storage APIs include file system APIs, for file system operations, and block devices, which provide the raw storage for the file systems.


| API | Full profile | Bare metal profile |
| - | - | - |
| [KVStore](../apis/data-apis) | &#10004; | &#10004; |
| [Static Global API](../apis/static-global-api.html) | &#10004; | &#10004; |
| [FileSystem](../apis/filesystem.html) | &#10004; | &#10004; |
| [Dir](../apis/dir.html) | &#10004; | &#10004;|
| [File](../apis/file.html) | &#10004; | &#10004; |
| [LittleFileSystem](../apis/littlefilesystem.html) | &#10004; | &#10004; |
| [FATFileSystem](../apis/fatfilesystem.html) | &#10004; | &#10004; |
| [BlockDevice](../apis/blockdevice.html) | &#10004; | &#10004; |
| [HeapBlockDevice](../apis/heapblockdevice.html) | &#10004; | &#10004; |
| [MBRBlockDevice](../apis/mbrblockdevice.html) | &#10004; | &#10004; |
| [ChainingBlockDevice](../apis/chainingblockdevice.html) | &#10004; | &#10004; |
| [SlicingBlockDevice](../apis/slicingblockdevice.html) | &#10004; | &#10004; |
| [ProfilingBlockDevice](../apis/profilingblockdevice.htm) | &#10004; | &#10004; |
| [BufferedBlockDevice](../apis/bufferedblockdevice.html) | &#10004; | &#10004; |
| [FlashSimBlockDevice](../apis/flashsimblockdevice.html) | &#10004; | &#10004; |
| [DataFlashBlockDevice](../apis/dataflashblockdevice.html) | &#10004; | &#10004; |
| [FlashIAPBlockDevice](../apis/flashiapblockdevice.html) | &#10004; | &#10004; |
| [SDBlockDevice](../apis/sdblockdevice.html) | &#10004; | &#10004; |
| [SPI Flash block device](../apis/spi-flash-block-device.html)| &#10004; | &#10004; |
| [QSPIFBlockDevice](../apis/qspifblockdevice.html) | &#10004; | &#10004; |
| [PSA internal storage](../apis/psa-internal-storage.html) | &#10004; | |
| [PSA protected storage](../apis/psa-protected-storage.html) | &#10004; | |

## Connectivity

### Network interface

Network interfaces are the application level APIs where users choose the driver, connectivity method and IP stack. These include ethernet, Wi-Fi, cellular and mesh interfaces.

| API | Full profile | Bare metal profile |
| - | - | - |
| [Ethernet](../apis/ethernet.html) | &#10004; | |
| [Wi-Fi](../apis/wi-fi.html) | &#10004; | |
| [Cellular](../apis/cellular-api.html) | &#10004; | |
| [Mesh](../apis/mesh-api.htm) | &#10004; | |
| [Network status](../apis/network-status.html) | &#10004; | |
| [MessageParser](../apis/messageparser.html) | &#10004; | |
| [SimpleMessageParser](../apis/simplemessageparser.html) | &#10004; | |
| [MessageBuilder](../apis/messagebuilder.html) | &#10004; | |

### Socket

Socket APIs include the application programming interface for IP networking. In Mbed OS, this API supports both TCP and UDP protocols.

| API | Full profile | Bare metal profile |
| - | - | - |
| [Socket](../apis/socket.html) | &#10004; | |
| [UDPSocket](../apis/udpsocket.html) | &#10004; | |
| [TCPSocket](../apis/tcpsocket.html) | &#10004; | |
| [SocketAddress](../apis/socketaddress.html) | &#10004; | |
| [Non-IP cellular socket](../apis/non-ip-cellular-socket.html) | &#10004; | |
| [SocketStats](../apis/socketstats.html) | &#10004; | |

### Secure socket

| API | Full profile | Bare metal profile |
| - | - | - |
| [TLSSocket](../apis/secure-socket-apis.html) | &#10004; | |
| [DTLSSocket](../apis/dtlssocket.html) | &#10004; | |

### DNS

| API | Full profile | Bare metal profile |
| - | - | - |
| [DNS Resolver](../apis/dns-apis.html) | &#10004; | |

### BLE

Bluetooth low energy (BLE) is a low power wireless technology standard for building personal area networks. Typical applications of BLE are health care, fitness trackers, beacons, smart home, security, entertainment, proximity sensors, industrial and automotive.

| API | Full profile | Bare metal profile |
| - | - | - |
| [BLE](../apis/ble.html) | &#10004; | &#10004; |
| [GAP](../apis/gap.html) | &#10004; | &#10004; |
| [GattClient](../apis/gattclient.html) | &#10004; | &#10004; |
| [GattServer](../apis/gattserver.html) | &#10004; | &#10004;|
| [SecurityManager](../apis/SecurityManager.html) | &#10004; | &#10004; |
| [BatteryService](../apis/batteryservice.html) | &#10004; | &#10004; |
| [HeartRateService](../apis/heartrateservice.html) | &#10004; | &#10004; |

### NFC

You can use Near-Field Communication (NFC), a short-range radio technology, for use cases such as contactless payments, access control and device pairing.

| API | Full profile | Bare metal profile |
| - | - | - |
| [NFCController](../apis/nfccontroller.html) | &#10004; | &#10004; |
| [NFC EEPROM](../apis/nfc-eeprom.html) | &#10004; | &#10004; |

### LoRaWAN

Arm Mbed OS provides a native network stack for LoRaWAN. LoRaWAN is a technology designed for low-power battery-powered devices. These devices operate in an unlicensed spectrum, creating high density wide-area networks.

| API | Full profile | Bare metal profile |
| - | - | - |
| [LoRaWANInterface](../apis/lorawaninterface.html) | &#10004; | |
| [LoRaRadio](../apis/nfc-loraradio.html) | &#10004; | |

## USB

The Mbed OS classes providing USB peripheral functionality, also known as USB components, inherit from USBDevice and provide specific USB peripherial functionality.

| API | Full profile | Bare metal profile |
| - | - | - |
| [USBSerial](../apis/usb-apis.html) | &#10004; | &#10004; |
| [USBAudio](../apis/usbaudio.html) | &#10004; | &#10004; |
| [USBHID](../apis/ubshid.html) | &#10004; | &#10004; |
| [USBCDC](../apis/usbcdc.html) | &#10004; | &#10004; |
| [USBCDC_ECM](../apis/usbcdc-ecm.html) | &#10004; | |
| [USBMSD](../apis/usbmsd.html) | &#10004; | &#10004; |
| [USBMIDI](../apis/usbmidi.html) | &#10004; | &#10004; |
| [USBMouse](../apis/usbmouse.html) | &#10004; | &#10004; |
| [USBKeyboard](../apis/usbkeyboard.html) | &#10004; | &#10004; |
| [USBMouseKeyboard](../apis/usbmousekeyboard.html) | &#10004; | &#10004; |

## Security

With [Arm Mbed TLS](security.html), a comprehensive SSL/TLS solution, you can include cryptographic and SSL/TLS capabilities in your code.


| API | Full profile | Bare metal profile |
| - | - | - |
| [PSA initial attestation](../apis/security-apis.html) | &#10004; | |
| [PSA lifecycle](../apis/psa-lifecycle.html) | &#10004; | |
| [Mbed Crypto](../apis/mbed-crypto.html) | &#10004; | &#10004; |
| [TLS](../apis/tls.html) | &#10004; | &#10004; |
| [DeviceKey](../apis/devicekey.html) | &#10004; | &#10004; |

## Power

<!--needs intro-->

| API | Full profile | Bare metal profile |
| - | - | - |
| [Power management (sleep)](../apis/power-apis.html) | &#10004; | &#10004; |
| [DeepSleepLock](../apis/deepsleeplock.html) | &#10004; | &#10004; |
| [Idle loop](../apis/idle-loop.html) | &#10004; | |
| [LowPowerTicker](../apis/lowpowerticker.html) | &#10004; | &#10004; |
| [LowPowerTimeout](../apis/lowpowertimeout.html) | &#10004; | &#10004; |
| [LowPowerTimer](../apis/lowpowertimer.html) | &#10004; | &#10004; |

## Memory

<!--needs intro-->

| API | Full profile | Bare metal profile |
| - | - | - |
| [mbed_stats (Mbed statistics)](../apis/mbed-statistics.html) | &#10004; | &#10004; |
| [mpug_mgmt (MPU management)](../apis/mpu-management.html) | &#10004; | &#10004; |
| [mbed_mem_trace (Memory tracing)](../apis/memory-tracing.html) | &#10004; | &#10004; |
| [MemoryPool](../apis/memorypool.html) | &#10004; | |

## Utilities

<!--needs intro-->

| API | Full profile | Bare metal profile |
| - | - | - |
| [Callback](../apis/util-apis.html) | &#10004; | &#10004; |
| [CriticalSectionLock](../apis/criticalsectionlock.html) | &#10004; | &#10004; |
| [Time](../apis/time.html) | &#10004; | &#10004; (enabled by default) |
| [RTC](../apis/rtc.html) | &#10004; | &#10004; |
| [Debug](../apis/debug.html) | &#10004; | &#10004; |
| [Error handling](../apis/error-handling.html) | &#10004; | &#10004; |
| [Assert](../apis/assert.html) | &#10004; | &#10004; |
| [NonCopyable](../apis/noncopyable.html) | &#10004; | &#10004; |
| [SharedPtr (Shared pointer](../apis/shared-pointer.html) | &#10004; | &#10004; |
| [Span](../apis/span.html) | &#10004; | &#10004; |
| [FileHandle](../apis/filehandle.html) | &#10004; | &#10004; |
| [Poll](../apis/poll.html) | &#10004; | &#10004; |
| [PlatformMutex](../apis/platformmutex.html) | &#10004; | &#10004; |
| [CircularBuffer](../apis/circularbuffer.html) | &#10004; | &#10004; |
| [ATCmdParser](../apis/atcmdparser.html) | &#10004; | &#10004; |
| [ScopedRamExecutionLock](../apis/scopedramexecutionlock.html) | &#10004; | &#10004; |
| [ScopedRomWriteLock](../apis/scopedromwritelock.html) | &#10004; | &#10004; |

## Deprecated APIs: moving from Mbed OS 5 to 6

If you're moving your program from Mbed OS 5 to 6, you will need to replace deprecated APIs:

| Deprecated API | Replaced by |
| - | - |
| Serial | [BufferedSerial](../apis/bufferedserial.html), [UnbufferedSerial](../apis/unbufferedserial.html) |
<!--wait as well?-->
1 change: 1 addition & 0 deletions docs/api/bluetooth/Gap.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The default value of data length supported by all controllers is 23 octets. If b

[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/mbed-os/development/mbed-os-api-doxy/classble_1_1_gap.html)


## GAP example

Here is an example demonstrating how to use the GAP API to advertise, scan, connect and disconnect and how parameters influence efficiency of these actions.
Expand Down
18 changes: 18 additions & 0 deletions docs/api/platform/Wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Wait

<span class="notes">**Note:** The function `wait` is deprecated in favor of explicit sleep functions. To sleep, replace `wait` with `ThisThread::sleep_for` (C++) or `thread_sleep_for` (C). To wait (without sleeping), call `wait_us`. `wait_us` is safe to call from ISR context.</span>

The wait_us and wait_ns functions provide precise wait capabilities. These functions spin the CPU to produce a small delay so they should only be used for short delays. Any delay larger than a millisecond will affect power and multithread performance, and block the platform deep sleep for the entire duration. Therefore, spinning for millisecond wait is not recommended, and ThisThread::sleep_for should be used instead.

## Wait function reference

[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/v5.15/mbed-os-api-doxy/mbed__wait__api_8h_source.html)

## Example

[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/wait_ex_1/)](https://os.mbed.com/teams/mbed_example/code/wait_ex_1/file/4f0543415053/main.cpp)

## Related content

- [RTOS](rtos.html) overview.
- [Application flow control tutorial](/docs/v5.15/tutorials/application-flow-control.html).
6 changes: 3 additions & 3 deletions docs/api/platform/platform-config.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1 id="configuration-util">Utilities</h1>
<h1 id="configuration-util">Configuring Platform</h1>

The utilities configurations allow for customization of utilities-level OS options. These options include error handling properties and serial communication configuration settings for STDIO. They affect system level `printf` calls, not Serial objects, with the exception of `default-serial-baud-rate`.
The platform configurations allow for customization of platform-level OS options. These options include error handling properties and serial communication configuration settings for STDIO. They affect system level `printf` calls, not Serial objects, with the exception of `default-serial-baud-rate`.

This is the complete list of utilities configuration parameters. To view all configuration parameters, run the `--config -v` command. Please see [the configuration system documentation](configuration.html) for details on how you may use or override these settings.
This is the complete list of platform configuration parameters. To view all configuration parameters, run the `--config -v` command. Please see [the configuration system documentation](configuration.html) for details on how you may use or override these settings.

```
Configuration parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/api/platform/platform.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Utilities overview
# Platform overview

The role of the utilities APIs is to provide general purpose MCU management infrastructure, a few common data structures and a consistent user experience on top of different standard libraries and toolchains. This page contains reference material about these subjects.

Expand Down
Loading