From bfa1b4dd844a20d9fdb626cec4f7154b9e9bfc84 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Thu, 11 Jul 2019 16:23:39 +0100 Subject: [PATCH 01/10] Drivers/Events/RTOS Public and internal APIs cleanup (#10955) Separate drivers, events, and rtos internal APIs from public APIs. * Move source files to source subdirs * Move internal headers to internal subdirs * Add Doxygen comments for documenting internal and public APIs * Remove source code from header files in order to remove include pre-processor directives that included header files not directly used by said header files * Explicitly include header files instead of implicit inclusions via third-party header files. Release Notes This will break user code that was using an internal API as the internal header files have been moved. This will only break if the user was including the header file using a namespace (i.e #include "foo/bar.h" instead of #include "bar.h" --- .travis.yml | 4 +- UNITTESTS/CMakeLists.txt | 3 +- UNITTESTS/stubs/SerialBase_stub.cpp | 2 +- .../source/NanostackRfPhyAtmel.cpp | 1 + .../source/NanostackRfPhyMcr20a.cpp | 1 + .../source/NanostackRfPhys2lp.cpp | 1 + drivers/AnalogIn.h | 38 +++--- drivers/AnalogOut.h | 36 +++--- drivers/BusIn.h | 12 +- drivers/BusInOut.h | 12 +- drivers/BusOut.h | 12 +- drivers/CAN.h | 23 +++- drivers/DigitalIn.h | 23 ++-- drivers/DigitalInOut.h | 44 +++---- drivers/DigitalOut.h | 23 ++-- drivers/Ethernet.h | 19 ++- drivers/FlashIAP.h | 12 +- drivers/I2C.h | 16 ++- drivers/I2CSlave.h | 14 ++- drivers/InterruptIn.h | 12 +- drivers/InterruptManager.h | 13 +- drivers/LowPowerTicker.h | 12 +- drivers/LowPowerTimeout.h | 14 ++- drivers/LowPowerTimer.h | 12 +- drivers/MbedCRC.h | 12 +- drivers/PortIn.h | 29 ++--- drivers/PortInOut.h | 43 +++---- drivers/PortOut.h | 22 ++-- drivers/PwmOut.h | 105 ++++------------ drivers/QSPI.h | 12 +- drivers/RawSerial.h | 15 ++- drivers/ResetReason.h | 12 +- drivers/SPI.h | 16 ++- drivers/SPISlave.h | 12 +- drivers/Serial.h | 17 ++- drivers/SerialBase.h | 14 ++- drivers/SerialWireOutput.h | 28 +++-- drivers/Ticker.h | 24 ++-- drivers/Timeout.h | 15 ++- drivers/Timer.h | 15 ++- drivers/TimerEvent.h | 15 ++- drivers/UARTSerial.h | 20 ++- drivers/Watchdog.h | 12 +- drivers/{ => internal}/TableCRC.h | 4 +- drivers/source/AnalogIn.cpp | 51 ++++++++ drivers/source/AnalogOut.cpp | 48 +++++++ drivers/{ => source}/BusIn.cpp | 0 drivers/{ => source}/BusInOut.cpp | 0 drivers/{ => source}/BusOut.cpp | 0 drivers/{ => source}/CAN.cpp | 2 +- .../{AnalogIn.cpp => source/DigitalIn.cpp} | 17 +-- drivers/source/DigitalInOut.cpp | 53 ++++++++ drivers/source/DigitalOut.cpp | 32 +++++ drivers/{ => source}/Ethernet.cpp | 0 drivers/{ => source}/FlashIAP.cpp | 2 +- drivers/{ => source}/I2C.cpp | 2 +- drivers/{ => source}/I2CSlave.cpp | 2 +- drivers/{ => source}/InterruptIn.cpp | 0 drivers/{ => source}/InterruptManager.cpp | 0 drivers/{ => source}/MbedCRC.cpp | 5 - drivers/source/PortIn.cpp | 43 +++++++ drivers/source/PortInOut.cpp | 57 +++++++++ drivers/source/PortOut.cpp | 36 ++++++ drivers/source/PwmOut.cpp | 119 ++++++++++++++++++ drivers/{ => source}/QSPI.cpp | 0 drivers/{ => source}/RawSerial.cpp | 4 +- drivers/{ => source}/ResetReason.cpp | 0 drivers/{ => source}/SPI.cpp | 3 +- drivers/{ => source}/SPISlave.cpp | 0 drivers/{ => source}/Serial.cpp | 3 +- drivers/{ => source}/SerialBase.cpp | 0 drivers/source/SerialWireOutput.cpp | 41 ++++++ drivers/{ => source}/TableCRC.cpp | 6 +- drivers/{ => source}/Ticker.cpp | 12 +- drivers/{ => source}/Timeout.cpp | 0 drivers/{ => source}/Timer.cpp | 3 +- drivers/{ => source}/TimerEvent.cpp | 3 +- drivers/{ => source}/UARTSerial.cpp | 2 +- drivers/{ => source}/Watchdog.cpp | 0 events/Event.h | 23 ++-- events/EventQueue.h | 19 ++- events/{equeue => internal}/equeue.h | 12 +- events/{equeue => internal}/equeue_platform.h | 12 +- events/mbed_events.h | 8 +- events/mbed_shared_queues.h | 16 +-- events/{equeue => source}/.mbedignore | 0 events/{ => source}/EventQueue.cpp | 0 events/{equeue => source}/Makefile | 2 +- events/{equeue => source}/README.md | 1 - events/{equeue => source}/equeue.c | 4 +- events/{equeue => source}/equeue_mbed.cpp | 5 +- events/{equeue => source}/equeue_posix.c | 4 +- events/{ => source}/mbed_shared_queues.cpp | 0 events/{equeue => source}/tests/prof.c | 4 +- events/{equeue => source}/tests/tests.c | 4 +- features/device_key/source/DeviceKey.h | 4 +- hal/LowPowerTickerWrapper.h | 4 +- hal/ethernet_api.h | 37 +++++- rtos/ConditionVariable.h | 19 +-- rtos/EventFlags.h | 6 +- rtos/Kernel.h | 8 +- rtos/Mail.h | 5 +- rtos/MemoryPool.h | 8 +- rtos/Mutex.h | 7 +- rtos/Queue.h | 5 +- rtos/RtosTimer.h | 5 +- rtos/Semaphore.h | 7 +- rtos/TARGET_CORTEX/mbed_boot.h | 7 +- rtos/TARGET_CORTEX/mbed_rtx_handlers.c | 6 +- rtos/TARGET_CORTEX/mbed_rtx_idle.cpp | 4 +- rtos/TARGET_CORTEX/mbed_rtx_storage.h | 35 ++++-- rtos/ThisThread.h | 7 +- rtos/Thread.h | 5 +- rtos/rtos.h | 2 - rtos/{ => source}/ConditionVariable.cpp | 4 +- rtos/{ => source}/EventFlags.cpp | 4 +- rtos/{ => source}/Kernel.cpp | 4 +- rtos/{ => source}/Mutex.cpp | 4 +- rtos/{ => source}/RtosTimer.cpp | 0 rtos/{ => source}/Semaphore.cpp | 0 rtos/{ => source}/ThisThread.cpp | 2 - rtos/{ => source}/Thread.cpp | 4 +- rtos/{ => source}/rtos_handlers.h | 11 +- rtos/{ => source}/rtos_idle.h | 13 +- .../test/travis-ci/doxy-spellchecker/spell.sh | 3 + usb/device/utilities/events/PolledQueue.h | 9 +- usb/device/utilities/events/Task.h | 9 +- usb/device/utilities/events/TaskBase.h | 9 +- usb/device/utilities/events/TaskQueue.h | 8 +- 129 files changed, 1203 insertions(+), 523 deletions(-) rename drivers/{ => internal}/TableCRC.h (94%) create mode 100644 drivers/source/AnalogIn.cpp create mode 100644 drivers/source/AnalogOut.cpp rename drivers/{ => source}/BusIn.cpp (100%) rename drivers/{ => source}/BusInOut.cpp (100%) rename drivers/{ => source}/BusOut.cpp (100%) rename drivers/{ => source}/CAN.cpp (98%) rename drivers/{AnalogIn.cpp => source/DigitalIn.cpp} (70%) create mode 100644 drivers/source/DigitalInOut.cpp create mode 100644 drivers/source/DigitalOut.cpp rename drivers/{ => source}/Ethernet.cpp (100%) rename drivers/{ => source}/FlashIAP.cpp (99%) rename drivers/{ => source}/I2C.cpp (99%) rename drivers/{ => source}/I2CSlave.cpp (97%) rename drivers/{ => source}/InterruptIn.cpp (100%) rename drivers/{ => source}/InterruptManager.cpp (100%) rename drivers/{ => source}/MbedCRC.cpp (96%) create mode 100644 drivers/source/PortIn.cpp create mode 100644 drivers/source/PortInOut.cpp create mode 100644 drivers/source/PortOut.cpp create mode 100644 drivers/source/PwmOut.cpp rename drivers/{ => source}/QSPI.cpp (100%) rename drivers/{ => source}/RawSerial.cpp (96%) rename drivers/{ => source}/ResetReason.cpp (100%) rename drivers/{ => source}/SPI.cpp (99%) rename drivers/{ => source}/SPISlave.cpp (100%) rename drivers/{ => source}/Serial.cpp (94%) rename drivers/{ => source}/SerialBase.cpp (100%) create mode 100644 drivers/source/SerialWireOutput.cpp rename drivers/{ => source}/TableCRC.cpp (99%) rename drivers/{ => source}/Ticker.cpp (83%) rename drivers/{ => source}/Timeout.cpp (100%) rename drivers/{ => source}/Timer.cpp (97%) rename drivers/{ => source}/TimerEvent.cpp (95%) rename drivers/{ => source}/UARTSerial.cpp (99%) rename drivers/{ => source}/Watchdog.cpp (100%) rename events/{equeue => internal}/equeue.h (98%) rename events/{equeue => internal}/equeue_platform.h (98%) rename events/{equeue => source}/.mbedignore (100%) rename events/{ => source}/EventQueue.cpp (100%) rename events/{equeue => source}/Makefile (96%) rename events/{equeue => source}/README.md (99%) rename events/{equeue => source}/equeue.c (99%) rename events/{equeue => source}/equeue_mbed.cpp (97%) rename events/{equeue => source}/equeue_posix.c (96%) rename events/{ => source}/mbed_shared_queues.cpp (100%) rename events/{equeue => source}/tests/prof.c (99%) rename events/{equeue => source}/tests/tests.c (99%) rename rtos/{ => source}/ConditionVariable.cpp (98%) rename rtos/{ => source}/EventFlags.cpp (98%) rename rtos/{ => source}/Kernel.cpp (98%) rename rtos/{ => source}/Mutex.cpp (98%) rename rtos/{ => source}/RtosTimer.cpp (100%) rename rtos/{ => source}/Semaphore.cpp (100%) rename rtos/{ => source}/ThisThread.cpp (99%) rename rtos/{ => source}/Thread.cpp (99%) rename rtos/{ => source}/rtos_handlers.h (95%) rename rtos/{ => source}/rtos_idle.h (95%) diff --git a/.travis.yml b/.travis.yml index 19d3a75a4d..31b754d8cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -227,9 +227,9 @@ matrix: features/frameworks/utest features/frameworks/unity components BUILD - python tools/make.py -t GCC_ARM -m DISCO_F401VC --source=. --build=BUILD/DISCO_F401VC/GCC_ARM -j0 # Run local equeue tests - - make -C ${EVENTS}/equeue test + - make -C ${EVENTS}/source test # Run profiling tests - - make -C ${EVENTS}/equeue prof | tee prof + - make -C ${EVENTS}/source prof | tee prof after_success: # Update status, comparing with master if possible. - | diff --git a/UNITTESTS/CMakeLists.txt b/UNITTESTS/CMakeLists.txt index 93970193f9..7be660b00b 100644 --- a/UNITTESTS/CMakeLists.txt +++ b/UNITTESTS/CMakeLists.txt @@ -105,7 +105,8 @@ set(unittest-includes-base "${PROJECT_SOURCE_DIR}/../drivers" "${PROJECT_SOURCE_DIR}/../hal" "${PROJECT_SOURCE_DIR}/../events" - "${PROJECT_SOURCE_DIR}/../events/equeue" + "${PROJECT_SOURCE_DIR}/../events/source" + "${PROJECT_SOURCE_DIR}/../events/internal" "${PROJECT_SOURCE_DIR}/../rtos" "${PROJECT_SOURCE_DIR}/../rtos/TARGET_CORTEX" "${PROJECT_SOURCE_DIR}/../rtos/TARGET_CORTEX/rtx5/Include" diff --git a/UNITTESTS/stubs/SerialBase_stub.cpp b/UNITTESTS/stubs/SerialBase_stub.cpp index e156d8f480..c0a19d3f54 100644 --- a/UNITTESTS/stubs/SerialBase_stub.cpp +++ b/UNITTESTS/stubs/SerialBase_stub.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ -#include "SerialBase.h" +#include "drivers/SerialBase.h" namespace mbed { diff --git a/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp b/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp index 287d5023de..abb2ee93e9 100644 --- a/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp +++ b/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp @@ -32,6 +32,7 @@ #include "SPI.h" #include "inttypes.h" #include "Timeout.h" +#include "platform/mbed_error.h" #define TRACE_GROUP "AtRF" diff --git a/components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp b/components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp index 18801a8ba2..2f70302ce7 100644 --- a/components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp +++ b/components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp @@ -23,6 +23,7 @@ #include #include "rtos.h" #include "mbed_interface.h" +#include "platform/mbed_error.h" using namespace mbed; using namespace rtos; diff --git a/components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp b/components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp index 435df3e4ae..c979ae529b 100644 --- a/components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp +++ b/components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp @@ -29,6 +29,7 @@ #include "Timeout.h" #include "Thread.h" #include "mbed_wait_api.h" +#include "platform/mbed_error.h" using namespace mbed; using namespace rtos; diff --git a/drivers/AnalogIn.h b/drivers/AnalogIn.h index 8f247e5975..172a2e5cfd 100644 --- a/drivers/AnalogIn.h +++ b/drivers/AnalogIn.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,7 +26,13 @@ #include "platform/PlatformMutex.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api Public API */ +/** @{*/ +/** + * \defgroup drivers_AnalogIn AnalogIn class + * @{ + */ /** An analog input, used for reading the voltage on a pin * @@ -48,7 +54,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class AnalogIn { @@ -58,37 +63,20 @@ public: * * @param pin AnalogIn pin to connect to */ - AnalogIn(PinName pin) - { - lock(); - analogin_init(&_adc, pin); - unlock(); - } + AnalogIn(PinName pin); /** Read the input voltage, represented as a float in the range [0.0, 1.0] * * @returns A floating-point value representing the current input voltage, measured as a percentage */ - float read() - { - lock(); - float ret = analogin_read(&_adc); - unlock(); - return ret; - } + float read(); /** Read the input voltage, represented as an unsigned short in the range [0x0, 0xFFFF] * * @returns * 16-bit unsigned short representing the current input voltage, normalized to a 16-bit value */ - unsigned short read_u16() - { - lock(); - unsigned short ret = analogin_read_u16(&_adc); - unlock(); - return ret; - } + unsigned short read_u16(); /** An operator shorthand for read() * @@ -129,8 +117,12 @@ protected: analogin_t _adc; static SingletonPtr _mutex; #endif //!defined(DOXYGEN_ONLY) + }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/AnalogOut.h b/drivers/AnalogOut.h index d12cbafcc4..7b0e5d70f7 100644 --- a/drivers/AnalogOut.h +++ b/drivers/AnalogOut.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,7 +25,13 @@ #include "platform/PlatformMutex.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_AnalogOut AnalogOut class + * @{ + */ /** An analog output, used for setting the voltage on a pin * @@ -48,7 +54,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class AnalogOut { @@ -70,24 +75,14 @@ public: * 0.0f (representing 0v / 0%) and 1.0f (representing 3.3v / 100%). * Values outside this range will be saturated to 0.0f or 1.0f. */ - void write(float value) - { - lock(); - analogout_write(&_dac, value); - unlock(); - } + void write(float value); /** Set the output voltage, represented as an unsigned short in the range [0x0, 0xFFFF] * * @param value 16-bit unsigned short representing the output voltage, * normalized to a 16-bit value (0x0000 = 0v, 0xFFFF = 3.3v) */ - void write_u16(unsigned short value) - { - lock(); - analogout_write_u16(&_dac, value); - unlock(); - } + void write_u16(unsigned short value); /** Return the current output voltage setting, measured as a percentage (float) * @@ -99,13 +94,7 @@ public: * @note * This value may not match exactly the value set by a previous write(). */ - float read() - { - lock(); - float ret = analogout_read(&_dac); - unlock(); - return ret; - } + float read(); /** An operator shorthand for write() * \sa AnalogOut::write() @@ -158,6 +147,9 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/BusIn.h b/drivers/BusIn.h index 61bf7b536e..85d9c9256d 100644 --- a/drivers/BusIn.h +++ b/drivers/BusIn.h @@ -23,12 +23,17 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_BusIn BusIn class + * @{ + */ /** A digital input bus, used for reading the state of a collection of pins * * @note Synchronization level: Thread safe - * @ingroup drivers */ class BusIn : private NonCopyable { @@ -125,6 +130,9 @@ private: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/BusInOut.h b/drivers/BusInOut.h index 618f9b8cf3..d2470874e2 100644 --- a/drivers/BusInOut.h +++ b/drivers/BusInOut.h @@ -22,7 +22,13 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_BusInOut BusInOut class + * @{ + */ /** A digital input output bus, used for setting the state of a collection of pins. * Implemented as an array of DigitalInOut pins, the bus can be constructed by any @@ -30,7 +36,6 @@ namespace mbed { * capabilities * * @note Synchronization level: Thread safe - * @ingroup drivers */ class BusInOut : private NonCopyable { @@ -147,6 +152,9 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/BusOut.h b/drivers/BusOut.h index ca83d00a17..cbd58ed198 100644 --- a/drivers/BusOut.h +++ b/drivers/BusOut.h @@ -22,10 +22,15 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_BusOut BusOut class + * @{ + */ /** A digital output bus, used for setting the state of a collection of pins - * @ingroup drivers */ class BusOut : private NonCopyable { @@ -125,6 +130,9 @@ protected: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/CAN.h b/drivers/CAN.h index 665677efc0..2de35c8ffd 100644 --- a/drivers/CAN.h +++ b/drivers/CAN.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,12 +27,17 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_CANMessage CANMessage class + * @{ + */ /** CANMessage class * * @note Synchronization level: Thread safe - * @ingroup drivers */ class CANMessage : public CAN_Message { @@ -98,8 +103,14 @@ public: } }; +/** @}*/ + +/** + * \defgroup drivers_CAN CAN class + * @{ + */ + /** A can bus client, used for communicating with can devices - * @ingroup drivers */ class CAN : private NonCopyable { @@ -315,12 +326,16 @@ public: protected: virtual void lock(); virtual void unlock(); + can_t _can; Callback _irq[IrqCnt]; PlatformMutex _mutex; #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/DigitalIn.h b/drivers/DigitalIn.h index 348a87bf33..ae2bf52df4 100644 --- a/drivers/DigitalIn.h +++ b/drivers/DigitalIn.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,10 +20,15 @@ #include "platform/platform.h" #include "hal/gpio_api.h" -#include "platform/mbed_critical.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_DigitalIn DigitalIn class + * @{ + */ /** A digital input, used for reading the state of a pin * @@ -47,7 +52,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class DigitalIn { @@ -72,6 +76,7 @@ public: // No lock needed in the constructor gpio_init_in_ex(&gpio, pin, mode); } + /** Read the input, represented as 0 or 1 (int) * * @returns @@ -88,12 +93,7 @@ public: * * @param pull PullUp, PullDown, PullNone, OpenDrain */ - void mode(PinMode pull) - { - core_util_critical_section_enter(); - gpio_mode(&gpio, pull); - core_util_critical_section_exit(); - } + void mode(PinMode pull); /** Return the output setting, represented as 0 or 1 (int) * @@ -127,6 +127,9 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/DigitalInOut.h b/drivers/DigitalInOut.h index 9ceb025aee..ccae13e997 100644 --- a/drivers/DigitalInOut.h +++ b/drivers/DigitalInOut.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,15 +20,19 @@ #include "platform/platform.h" #include "hal/gpio_api.h" -#include "platform/mbed_critical.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_DigitalInOut DigitalInOut class + * @{ + */ /** A digital input/output, used for setting or reading a bi-directional pin * * @note Synchronization level: Interrupt safe - * @ingroup drivers */ class DigitalInOut { @@ -81,32 +85,17 @@ public: /** Set as an output */ - void output() - { - core_util_critical_section_enter(); - gpio_dir(&gpio, PIN_OUTPUT); - core_util_critical_section_exit(); - } + void output(); /** Set as an input */ - void input() - { - core_util_critical_section_enter(); - gpio_dir(&gpio, PIN_INPUT); - core_util_critical_section_exit(); - } + void input(); /** Set the input pin mode * * @param pull PullUp, PullDown, PullNone, OpenDrain */ - void mode(PinMode pull) - { - core_util_critical_section_enter(); - gpio_mode(&gpio, pull); - core_util_critical_section_exit(); - } + void mode(PinMode pull); /** Return the output setting, represented as 0 or 1 (int) * @@ -141,13 +130,7 @@ public: * state from the DigitalInOut argument. * \sa DigitalInOut::write() */ - DigitalInOut &operator= (DigitalInOut &rhs) - { - core_util_critical_section_enter(); - write(rhs.read()); - core_util_critical_section_exit(); - return *this; - } + DigitalInOut &operator= (DigitalInOut &rhs); /** A shorthand for read() * \sa DigitalInOut::read() @@ -171,6 +154,9 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/DigitalOut.h b/drivers/DigitalOut.h index b9fe1f2d3e..87387d98d8 100644 --- a/drivers/DigitalOut.h +++ b/drivers/DigitalOut.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +19,15 @@ #include "platform/platform.h" #include "hal/gpio_api.h" -#include "platform/mbed_critical.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_DigitalOut DigitalOut class + * @{ + */ /** A digital output, used for setting the state of a pin * @@ -42,7 +47,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class DigitalOut { @@ -122,13 +126,7 @@ public: * state from the DigitalOut argument. * \sa DigitalOut::write() */ - DigitalOut &operator= (DigitalOut &rhs) - { - core_util_critical_section_enter(); - write(rhs.read()); - core_util_critical_section_exit(); - return *this; - } + DigitalOut &operator= (DigitalOut &rhs); /** A shorthand for read() * \sa DigitalOut::read() @@ -150,6 +148,9 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/Ethernet.h b/drivers/Ethernet.h index 30618806e5..f070bd524a 100644 --- a/drivers/Ethernet.h +++ b/drivers/Ethernet.h @@ -23,7 +23,13 @@ #if DEVICE_ETHERNET || defined(DOXYGEN_ONLY) namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_Ethernet Ethernet class + * @{ + */ /** An ethernet interface, to use with the ethernet pins. * @@ -54,9 +60,13 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ -class Ethernet : private NonCopyable { +class + MBED_DEPRECATED( + "EthInterface is now the preferred way to get an Ethernet object. " + "Alternatively, use NetworkInterface to get an instance of an appropriate network " + "interface (WiFi or Ethernet)." + ) Ethernet : private NonCopyable { public: @@ -170,6 +180,9 @@ public: void set_link(Mode mode); }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/FlashIAP.h b/drivers/FlashIAP.h index 0c3c8e1049..f0397eb68c 100644 --- a/drivers/FlashIAP.h +++ b/drivers/FlashIAP.h @@ -49,12 +49,17 @@ extern uint32_t Load$$LR$$LR_IROM1$$Limit[]; namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_FlashIAP FlashIAP class + * @{ + */ /** Flash IAP driver. It invokes flash HAL functions. * * @note Synchronization level: Thread safe - * @ingroup drivers */ class FlashIAP : private NonCopyable { public: @@ -159,6 +164,9 @@ private: #endif }; +/** @}*/ +/** @}*/ + } /* namespace mbed */ #endif /* DEVICE_FLASH */ diff --git a/drivers/I2C.h b/drivers/I2C.h index 9a19bd1247..ffcbe1ae27 100644 --- a/drivers/I2C.h +++ b/drivers/I2C.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2015 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,11 +30,17 @@ #if DEVICE_I2C_ASYNCH #include "platform/CThunk.h" #include "hal/dma_api.h" -#include "platform/FunctionPointer.h" +#include "platform/Callback.h" #endif namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_I2C I2C class + * @{ + */ /** An I2C Master, used for communicating with I2C slave devices * @@ -70,7 +76,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class I2C : private NonCopyable { @@ -242,6 +247,9 @@ private: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/I2CSlave.h b/drivers/I2CSlave.h index 78715ba934..f2075d1d60 100644 --- a/drivers/I2CSlave.h +++ b/drivers/I2CSlave.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,7 +24,13 @@ #include "hal/i2c_api.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_I2CSlave I2CSlave class + * @{ + */ /** An I2C Slave, used for communicating with an I2C Master device. * @@ -64,7 +70,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class I2CSlave { @@ -160,6 +165,9 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/InterruptIn.h b/drivers/InterruptIn.h index 32cc6619ee..3c6cf092d2 100644 --- a/drivers/InterruptIn.h +++ b/drivers/InterruptIn.h @@ -29,7 +29,13 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_InterruptIn InterruptIn class + * @{ + */ /** A digital interrupt input, used to call a function on a rising or falling edge * @@ -57,7 +63,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class InterruptIn : private NonCopyable { @@ -175,6 +180,9 @@ protected: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/InterruptManager.h b/drivers/InterruptManager.h index 8b207f0c5e..f53d206a63 100644 --- a/drivers/InterruptManager.h +++ b/drivers/InterruptManager.h @@ -24,7 +24,13 @@ #include namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_InterruptManager InterruptManager class + * @{ + */ /** Use this singleton if you need to chain interrupt handlers. * @deprecated Do not use this class. This class is not part of the public API of mbed-os and is being removed in the future. @@ -54,7 +60,6 @@ namespace mbed { * InterruptManager::get()->add_handler(handler, TIMER3_IRQn); * } * @endcode - * @ingroup drivers */ class InterruptManager : private NonCopyable { public: @@ -170,6 +175,7 @@ public: #if !defined(DOXYGEN_ONLY) private: InterruptManager(); + ~InterruptManager(); void lock(); @@ -203,6 +209,9 @@ private: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/LowPowerTicker.h b/drivers/LowPowerTicker.h index a6f9fa9401..1c616a457b 100644 --- a/drivers/LowPowerTicker.h +++ b/drivers/LowPowerTicker.h @@ -26,12 +26,17 @@ #include "hal/lp_ticker_api.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_LowPowerTicker LowPowerTicker class + * @{ + */ /** Low Power Ticker * * @note Synchronization level: Interrupt safe - * @ingroup drivers */ class LowPowerTicker : public Ticker, private NonCopyable { @@ -45,6 +50,9 @@ public: } }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/LowPowerTimeout.h b/drivers/LowPowerTimeout.h index 7198d7dc64..e678809c0f 100644 --- a/drivers/LowPowerTimeout.h +++ b/drivers/LowPowerTimeout.h @@ -26,12 +26,17 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_LowPowerTimeout LowPowerTimeout class + * @{ + */ /** Low Power Timout * * @note Synchronization level: Interrupt safe - * @ingroup drivers */ class LowPowerTimeout : public LowPowerTicker, private NonCopyable { #if !defined(DOXYGEN_ONLY) @@ -43,7 +48,10 @@ private: #endif }; -} +/** @}*/ +/** @}*/ + +} // namespace mbed #endif diff --git a/drivers/LowPowerTimer.h b/drivers/LowPowerTimer.h index abd03dd48e..250fea5e40 100644 --- a/drivers/LowPowerTimer.h +++ b/drivers/LowPowerTimer.h @@ -26,12 +26,17 @@ #include "hal/lp_ticker_api.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_LowPowerTimer LowPowerTimer class + * @{ + */ /** Low power timer * * @note Synchronization level: Interrupt safe - * @ingroup drivers */ class LowPowerTimer : public Timer, private NonCopyable { @@ -42,6 +47,9 @@ public: }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/MbedCRC.h b/drivers/MbedCRC.h index c0726a92b9..1d666da445 100644 --- a/drivers/MbedCRC.h +++ b/drivers/MbedCRC.h @@ -17,7 +17,7 @@ #ifndef MBED_CRC_API_H #define MBED_CRC_API_H -#include "drivers/TableCRC.h" +#include "drivers/internal/TableCRC.h" #include "hal/crc_api.h" #include "platform/mbed_assert.h" #include "platform/SingletonPtr.h" @@ -40,8 +40,13 @@ but we check for ( width < 8) before performing shift, so it should not be an is #endif namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ /** @{*/ +/** + * \defgroup drivers_MbedCRC MbedCRC class + * @{ + */ extern SingletonPtr mbed_crc_mutex; @@ -101,7 +106,6 @@ extern SingletonPtr mbed_crc_mutex; * return 0; * } * @endcode - * @ingroup drivers */ template class MbedCRC { @@ -565,6 +569,8 @@ private: #endif /** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/PortIn.h b/drivers/PortIn.h index f3ae250e98..bf77d70e3f 100644 --- a/drivers/PortIn.h +++ b/drivers/PortIn.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,10 +22,15 @@ #if DEVICE_PORTIN || defined(DOXYGEN_ONLY) #include "hal/port_api.h" -#include "platform/mbed_critical.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_PortIn PortIn class + * @{ + */ /** A multiple pin digital input * @@ -51,7 +56,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class PortIn { public: @@ -61,12 +65,7 @@ public: * @param port Port to connect to (as defined in target's PortNames.h) * @param mask Bitmask defines which port pins should be an input (0 - ignore, 1 - include) */ - PortIn(PortName port, int mask = 0xFFFFFFFF) - { - core_util_critical_section_enter(); - port_init(&_port, port, mask, PIN_INPUT); - core_util_critical_section_exit(); - } + PortIn(PortName port, int mask = 0xFFFFFFFF); /** Read the value input to the port * @@ -82,12 +81,7 @@ public: * * @param mode PullUp, PullDown, PullNone, OpenDrain */ - void mode(PinMode mode) - { - core_util_critical_section_enter(); - port_mode(&_port, mode); - core_util_critical_section_exit(); - } + void mode(PinMode mode); /** A shorthand for read() */ @@ -100,6 +94,9 @@ private: port_t _port; }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/PortInOut.h b/drivers/PortInOut.h index 2036eba252..839d26651b 100644 --- a/drivers/PortInOut.h +++ b/drivers/PortInOut.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,15 +22,19 @@ #if DEVICE_PORTINOUT || defined(DOXYGEN_ONLY) #include "hal/port_api.h" -#include "platform/mbed_critical.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_PortInOut PortInOut class + * @{ + */ /** A multiple pin digital in/out used to set/read multiple bi-directional pins * * @note Synchronization level: Interrupt safe - * @ingroup drivers */ class PortInOut { public: @@ -40,12 +44,7 @@ public: * @param port Port to connect to (Port0-Port5) * @param mask A bitmask to identify which bits in the port should be included (0 - ignore) */ - PortInOut(PortName port, int mask = 0xFFFFFFFF) - { - core_util_critical_section_enter(); - port_init(&_port, port, mask, PIN_INPUT); - core_util_critical_section_exit(); - } + PortInOut(PortName port, int mask = 0xFFFFFFFF); /** Write the value to the output port * @@ -68,32 +67,17 @@ public: /** Set as an output */ - void output() - { - core_util_critical_section_enter(); - port_dir(&_port, PIN_OUTPUT); - core_util_critical_section_exit(); - } + void output(); /** Set as an input */ - void input() - { - core_util_critical_section_enter(); - port_dir(&_port, PIN_INPUT); - core_util_critical_section_exit(); - } + void input(); /** Set the input pin mode * * @param mode PullUp, PullDown, PullNone, OpenDrain */ - void mode(PinMode mode) - { - core_util_critical_section_enter(); - port_mode(&_port, mode); - core_util_critical_section_exit(); - } + void mode(PinMode mode); /** A shorthand for write() * \sa PortInOut::write() @@ -125,6 +109,9 @@ private: port_t _port; }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/PortOut.h b/drivers/PortOut.h index 18a0bcd3c5..3b3c3ec6a0 100644 --- a/drivers/PortOut.h +++ b/drivers/PortOut.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,10 +22,15 @@ #if DEVICE_PORTOUT || defined(DOXYGEN_ONLY) #include "hal/port_api.h" -#include "platform/mbed_critical.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_PortOut PortOut class + * @{ + */ /** A multiple pin digital output * * @note Synchronization level: Interrupt safe @@ -50,7 +55,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class PortOut { public: @@ -60,12 +64,7 @@ public: * @param port Port to connect to (as defined in target's PortNames.h) * @param mask Bitmask defines which port pins are an output (0 - ignore, 1 - include) */ - PortOut(PortName port, int mask = 0xFFFFFFFF) - { - core_util_critical_section_enter(); - port_init(&_port, port, mask, PIN_OUTPUT); - core_util_critical_section_exit(); - } + PortOut(PortName port, int mask = 0xFFFFFFFF); /** Write the value to the output port * @@ -116,6 +115,9 @@ private: port_t _port; }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/PwmOut.h b/drivers/PwmOut.h index ed8765594a..d151629774 100644 --- a/drivers/PwmOut.h +++ b/drivers/PwmOut.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,11 +21,15 @@ #if DEVICE_PWMOUT || defined(DOXYGEN_ONLY) #include "hal/pwmout_api.h" -#include "platform/mbed_critical.h" -#include "platform/mbed_power_mgmt.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_PwmOut PwmOut class + * @{ + */ /** A pulse-width modulation digital output * @@ -48,7 +52,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class PwmOut { @@ -58,20 +61,9 @@ public: * * @param pin PwmOut pin to connect to */ - PwmOut(PinName pin) : _deep_sleep_locked(false) - { - core_util_critical_section_enter(); - pwmout_init(&_pwm, pin); - core_util_critical_section_exit(); - } + PwmOut(PinName pin); - ~PwmOut() - { - core_util_critical_section_enter(); - pwmout_free(&_pwm); - unlock_deep_sleep(); - core_util_critical_section_exit(); - } + ~PwmOut(); /** Set the output duty-cycle, specified as a percentage (float) * @@ -80,13 +72,7 @@ public: * 0.0f (representing on 0%) and 1.0f (representing on 100%). * Values outside this range will be saturated to 0.0f or 1.0f. */ - void write(float value) - { - core_util_critical_section_enter(); - lock_deep_sleep(); - pwmout_write(&_pwm, value); - core_util_critical_section_exit(); - } + void write(float value); /** Return the current output duty-cycle setting, measured as a percentage (float) * @@ -98,13 +84,7 @@ public: * @note * This value may not match exactly the value set by a previous write(). */ - float read() - { - core_util_critical_section_enter(); - float val = pwmout_read(&_pwm); - core_util_critical_section_exit(); - return val; - } + float read(); /** Set the PWM period, specified in seconds (float), keeping the duty cycle the same. * @@ -113,62 +93,32 @@ public: * The resolution is currently in microseconds; periods smaller than this * will be set to zero. */ - void period(float seconds) - { - core_util_critical_section_enter(); - pwmout_period(&_pwm, seconds); - core_util_critical_section_exit(); - } + void period(float seconds); /** Set the PWM period, specified in milliseconds (int), keeping the duty cycle the same. * @param ms Change the period of a PWM signal in milliseconds without modifying the duty cycle */ - void period_ms(int ms) - { - core_util_critical_section_enter(); - pwmout_period_ms(&_pwm, ms); - core_util_critical_section_exit(); - } + void period_ms(int ms); /** Set the PWM period, specified in microseconds (int), keeping the duty cycle the same. * @param us Change the period of a PWM signal in microseconds without modifying the duty cycle */ - void period_us(int us) - { - core_util_critical_section_enter(); - pwmout_period_us(&_pwm, us); - core_util_critical_section_exit(); - } + void period_us(int us); /** Set the PWM pulsewidth, specified in seconds (float), keeping the period the same. * @param seconds Change the pulse width of a PWM signal specified in seconds (float) */ - void pulsewidth(float seconds) - { - core_util_critical_section_enter(); - pwmout_pulsewidth(&_pwm, seconds); - core_util_critical_section_exit(); - } + void pulsewidth(float seconds); /** Set the PWM pulsewidth, specified in milliseconds (int), keeping the period the same. * @param ms Change the pulse width of a PWM signal specified in milliseconds */ - void pulsewidth_ms(int ms) - { - core_util_critical_section_enter(); - pwmout_pulsewidth_ms(&_pwm, ms); - core_util_critical_section_exit(); - } + void pulsewidth_ms(int ms); /** Set the PWM pulsewidth, specified in microseconds (int), keeping the period the same. * @param us Change the pulse width of a PWM signal specified in microseconds */ - void pulsewidth_us(int us) - { - core_util_critical_section_enter(); - pwmout_pulsewidth_us(&_pwm, us); - core_util_critical_section_exit(); - } + void pulsewidth_us(int us); /** A operator shorthand for write() * \sa PwmOut::write() @@ -202,28 +152,19 @@ public: #if !(DOXYGEN_ONLY) protected: /** Lock deep sleep only if it is not yet locked */ - void lock_deep_sleep() - { - if (_deep_sleep_locked == false) { - sleep_manager_lock_deep_sleep(); - _deep_sleep_locked = true; - } - } + void lock_deep_sleep(); /** Unlock deep sleep in case it is locked */ - void unlock_deep_sleep() - { - if (_deep_sleep_locked == true) { - sleep_manager_unlock_deep_sleep(); - _deep_sleep_locked = false; - } - } + void unlock_deep_sleep(); pwmout_t _pwm; bool _deep_sleep_locked; #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/QSPI.h b/drivers/QSPI.h index e247e8f651..1084e0eec9 100644 --- a/drivers/QSPI.h +++ b/drivers/QSPI.h @@ -30,7 +30,13 @@ namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_QSPI QSPI class + * @{ + */ /** A QSPI Driver, used for communicating with QSPI slave devices * @@ -69,7 +75,6 @@ namespace mbed { * * } * @endcode - * @ingroup drivers */ class QSPI : private NonCopyable { @@ -225,6 +230,9 @@ private: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/RawSerial.h b/drivers/RawSerial.h index 0e6c9c7c8f..061d93fa06 100644 --- a/drivers/RawSerial.h +++ b/drivers/RawSerial.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,12 +23,17 @@ #include "mbed_toolchain.h" #include "drivers/SerialBase.h" -#include "hal/serial_api.h" #include "platform/NonCopyable.h" #include namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_RawSerial RawSerial class + * @{ + */ /** A serial port (UART) for communication with other serial devices * This is a variation of the Serial class that doesn't use streams, @@ -51,7 +56,6 @@ namespace mbed { * pc.putc('A'); * } * @endcode - * @ingroup drivers */ class RawSerial: public SerialBase, private NonCopyable { @@ -105,6 +109,9 @@ protected: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/ResetReason.h b/drivers/ResetReason.h index 8500abd49a..a04ae7c006 100644 --- a/drivers/ResetReason.h +++ b/drivers/ResetReason.h @@ -22,14 +22,19 @@ #include "reset_reason_api.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_ResetReason ResetReason class + * @{ + */ /** A platform-independent method of checking the cause of the last system reset. * * When the system restarts, the reason for the restart is contained in * the system registers at boot time in a platform specific manner. * This API provides a generic method of fetching the reason for the restart. * - * @ingroup drivers */ class ResetReason { public: @@ -71,6 +76,9 @@ public: static uint32_t get_raw(); }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif // DEVICE_RESET_REASON diff --git a/drivers/SPI.h b/drivers/SPI.h index 48ba694695..41075a913c 100644 --- a/drivers/SPI.h +++ b/drivers/SPI.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2015 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -40,12 +40,18 @@ #include "platform/CThunk.h" #include "hal/dma_api.h" #include "platform/CircularBuffer.h" -#include "platform/FunctionPointer.h" +#include "platform/Callback.h" #include "platform/Transaction.h" #endif namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_SPI SPI class + * @{ + */ struct use_gpio_ssel_t { }; const use_gpio_ssel_t use_gpio_ssel; @@ -90,7 +96,6 @@ const use_gpio_ssel_t use_gpio_ssel; * device.unlock(); * } * @endcode - * @ingroup drivers */ class SPI : private NonCopyable { @@ -425,6 +430,9 @@ private: #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif // DEVICE_SPI || DOXYGEN_ONLY diff --git a/drivers/SPISlave.h b/drivers/SPISlave.h index 878bc8d672..13d4f0f68b 100644 --- a/drivers/SPISlave.h +++ b/drivers/SPISlave.h @@ -25,7 +25,13 @@ #include "hal/spi_api.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_SPISlave SPISlave class + * @{ + */ /** A SPI slave, used for communicating with a SPI master device. * @@ -51,7 +57,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class SPISlave : private NonCopyable { @@ -127,6 +132,9 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/Serial.h b/drivers/Serial.h index d19010808d..7dad33a613 100644 --- a/drivers/Serial.h +++ b/drivers/Serial.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,13 +22,18 @@ #if DEVICE_SERIAL || defined(DOXYGEN_ONLY) #include "platform/Stream.h" -#include "SerialBase.h" +#include "drivers/SerialBase.h" #include "platform/PlatformMutex.h" -#include "hal/serial_api.h" #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_Serial Serial class + * @{ + */ /** A serial port (UART) for communication with other serial devices * @@ -49,7 +54,6 @@ namespace mbed { * pc.printf("Hello World\n"); * } * @endcode - * @ingroup drivers */ class Serial : public SerialBase, public Stream, private NonCopyable { @@ -111,6 +115,9 @@ protected: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/SerialBase.h b/drivers/SerialBase.h index 99da7a9b45..3acf9cbf1a 100644 --- a/drivers/SerialBase.h +++ b/drivers/SerialBase.h @@ -32,13 +32,19 @@ #endif namespace mbed { -/** \addtogroup drivers */ +/** \defgroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_SerialBase SerialBase class + * @{ + */ /** A base class for serial port implementations * Can't be instantiated directly (use Serial or RawSerial) * * @note Synchronization level: Set by subclass - * @ingroup drivers */ class SerialBase : private NonCopyable { @@ -289,6 +295,7 @@ protected: virtual ~SerialBase(); int _base_getc(); + int _base_putc(int c); #if DEVICE_SERIAL_ASYNCH @@ -307,6 +314,9 @@ protected: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/SerialWireOutput.h b/drivers/SerialWireOutput.h index 0379687c9b..52f5416c54 100644 --- a/drivers/SerialWireOutput.h +++ b/drivers/SerialWireOutput.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,29 +18,28 @@ #ifndef MBED_SERIALWIREOUTPUT_H #define MBED_SERIALWIREOUTPUT_H +#include "platform/platform.h" + #if defined(DEVICE_ITM) -#include "hal/itm_api.h" #include "platform/FileHandle.h" namespace mbed { +/** \ingroup drivers */ +/** \addtogroup drivers-public-api Public API */ +/** @{*/ +/** + * \defgroup drivers_SerialWireOutput SerialWireOutput class + * @{ + */ class SerialWireOutput : public FileHandle { public: - SerialWireOutput(void) - { - /* Initialize ITM using internal init function. */ - mbed_itm_init(); - } + SerialWireOutput(void); - virtual ssize_t write(const void *buffer, size_t size) - { - mbed_itm_send_block(ITM_PORT_SWO, buffer, size); - - return size; - } + virtual ssize_t write(const void *buffer, size_t size); virtual ssize_t read(void *buffer, size_t size) { @@ -72,6 +71,9 @@ public: } }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif // DEVICE_ITM diff --git a/drivers/Ticker.h b/drivers/Ticker.h index 8a68b4a00f..455283718e 100644 --- a/drivers/Ticker.h +++ b/drivers/Ticker.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,12 +21,16 @@ #include "platform/Callback.h" #include "platform/mbed_toolchain.h" #include "platform/NonCopyable.h" -#include "platform/mbed_power_mgmt.h" #include "hal/lp_ticker_api.h" -#include "platform/mbed_critical.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_Ticker Ticker class + * @{ + */ /** A Ticker is used to call a function at a recurring interval * @@ -62,19 +66,14 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class Ticker : public TimerEvent, private NonCopyable { public: - Ticker() : TimerEvent(), _function(0), _lock_deepsleep(true) - { - } + Ticker(); // When low power ticker is in use, then do not disable deep sleep. - Ticker(const ticker_data_t *data) : TimerEvent(data), _function(0), _lock_deepsleep(!data->interface->runs_in_deep_sleep) - { - } + Ticker(const ticker_data_t *data); /** Attach a function to be called by the Ticker, specifying the interval in seconds * @@ -155,6 +154,9 @@ protected: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/Timeout.h b/drivers/Timeout.h index c155c9bcec..673554f234 100644 --- a/drivers/Timeout.h +++ b/drivers/Timeout.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +19,15 @@ #include "drivers/Ticker.h" #include "platform/NonCopyable.h" -#include "platform/mbed_power_mgmt.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_Timeout Timeout class + * @{ + */ /** A Timeout is used to call a function at a point in the future * @@ -53,7 +58,6 @@ namespace mbed { * } * } * @endcode - * @ingroup drivers */ class Timeout : public Ticker, private NonCopyable { @@ -63,6 +67,9 @@ protected: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/Timer.h b/drivers/Timer.h index 010f6019b5..8d4d22a7ca 100644 --- a/drivers/Timer.h +++ b/drivers/Timer.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,10 +20,15 @@ #include "platform/platform.h" #include "hal/ticker_api.h" #include "platform/NonCopyable.h" -#include "platform/mbed_power_mgmt.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_Timer Timer class + * @{ + */ /** A general purpose timer * @@ -47,7 +52,6 @@ namespace mbed { * printf("Toggle the led takes %d us", end - begin); * } * @endcode - * @ingroup drivers */ class Timer : private NonCopyable { @@ -108,6 +112,9 @@ protected: }; #endif +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/TimerEvent.h b/drivers/TimerEvent.h index 88f4c3b750..5bd6eab7d2 100644 --- a/drivers/TimerEvent.h +++ b/drivers/TimerEvent.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,16 +18,20 @@ #define MBED_TIMEREVENT_H #include "hal/ticker_api.h" -#include "hal/us_ticker_api.h" #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_TimerEvent TimerEvent class + * @{ + */ /** Base abstraction for timer interrupts * * @note Synchronization level: Interrupt safe - * @ingroup drivers */ class TimerEvent : private NonCopyable { public: @@ -82,6 +86,9 @@ protected: #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/UARTSerial.h b/drivers/UARTSerial.h index 5f6d6faee6..1e3d8dd06c 100644 --- a/drivers/UARTSerial.h +++ b/drivers/UARTSerial.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2017 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,10 +23,9 @@ #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) #include "platform/FileHandle.h" -#include "SerialBase.h" -#include "InterruptIn.h" +#include "drivers/SerialBase.h" +#include "drivers/InterruptIn.h" #include "platform/PlatformMutex.h" -#include "hal/serial_api.h" #include "platform/CircularBuffer.h" #include "platform/NonCopyable.h" @@ -40,11 +39,16 @@ namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_UARTSerial UARTSerial class + * @{ + */ /** Class providing buffered UART communication functionality using separate circular buffer for send and receive channels * - * @ingroup drivers */ class UARTSerial : private SerialBase, public FileHandle, private NonCopyable { @@ -312,6 +316,10 @@ private: void dcd_irq(void); }; + +/** @}*/ +/** @}*/ + } //namespace mbed #endif //(DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) diff --git a/drivers/Watchdog.h b/drivers/Watchdog.h index 495965d390..3b20d6fc28 100644 --- a/drivers/Watchdog.h +++ b/drivers/Watchdog.h @@ -28,8 +28,14 @@ #include namespace mbed { +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_Watchdog Watchdog class + * @{ + */ -/** \addtogroup drivers */ /** A hardware watchdog timer that resets the system in the case of system * failures or malfunctions. If you fail to refresh the Watchdog timer periodically, * it resets the system after a set period of time. @@ -56,7 +62,6 @@ namespace mbed { * @endcode * * @note Synchronization level: Interrupt safe - * @ingroup drivers */ class Watchdog : private NonCopyable { public: @@ -149,6 +154,9 @@ private: bool _running; }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif // DEVICE_WATCHDOG diff --git a/drivers/TableCRC.h b/drivers/internal/TableCRC.h similarity index 94% rename from drivers/TableCRC.h rename to drivers/internal/TableCRC.h index 1ab5bf8365..15e460cb61 100644 --- a/drivers/TableCRC.h +++ b/drivers/internal/TableCRC.h @@ -21,7 +21,8 @@ #include namespace mbed { -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-internal-api Internal API */ /** @{*/ #define MBED_CRC_TABLE_SIZE 256 @@ -35,6 +36,7 @@ extern const uint32_t Table_CRC_32bit_ANSI[MBED_CRC_TABLE_SIZE]; extern const uint32_t Table_CRC_32bit_Rev_ANSI[MBED_OPTIMIZED_CRC_TABLE_SIZE]; /** @}*/ + } // namespace mbed #endif diff --git a/drivers/source/AnalogIn.cpp b/drivers/source/AnalogIn.cpp new file mode 100644 index 0000000000..97b1b8e138 --- /dev/null +++ b/drivers/source/AnalogIn.cpp @@ -0,0 +1,51 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/AnalogIn.h" + +#if DEVICE_ANALOGIN + +namespace mbed { + +SingletonPtr AnalogIn::_mutex; + +AnalogIn::AnalogIn(PinName pin) +{ + lock(); + analogin_init(&_adc, pin); + unlock(); +} + +float AnalogIn::read() +{ + lock(); + float ret = analogin_read(&_adc); + unlock(); + return ret; +} + +unsigned short AnalogIn::read_u16() +{ + lock(); + unsigned short ret = analogin_read_u16(&_adc); + unlock(); + return ret; +} + +} // namespace mbed + +#endif diff --git a/drivers/source/AnalogOut.cpp b/drivers/source/AnalogOut.cpp new file mode 100644 index 0000000000..aaba38088e --- /dev/null +++ b/drivers/source/AnalogOut.cpp @@ -0,0 +1,48 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/AnalogOut.h" + +#if DEVICE_ANALOGOUT + +namespace mbed { + +void AnalogOut::write(float value) +{ + lock(); + analogout_write(&_dac, value); + unlock(); +} + +void AnalogOut::write_u16(unsigned short value) +{ + lock(); + analogout_write_u16(&_dac, value); + unlock(); +} + +float AnalogOut::read() +{ + lock(); + float ret = analogout_read(&_dac); + unlock(); + return ret; +} + +} // namespace mbed + +#endif // DEVICE_ANALOGOUT diff --git a/drivers/BusIn.cpp b/drivers/source/BusIn.cpp similarity index 100% rename from drivers/BusIn.cpp rename to drivers/source/BusIn.cpp diff --git a/drivers/BusInOut.cpp b/drivers/source/BusInOut.cpp similarity index 100% rename from drivers/BusInOut.cpp rename to drivers/source/BusInOut.cpp diff --git a/drivers/BusOut.cpp b/drivers/source/BusOut.cpp similarity index 100% rename from drivers/BusOut.cpp rename to drivers/source/BusOut.cpp diff --git a/drivers/CAN.cpp b/drivers/source/CAN.cpp similarity index 98% rename from drivers/CAN.cpp rename to drivers/source/CAN.cpp index a3699e3919..19e5f94b63 100644 --- a/drivers/CAN.cpp +++ b/drivers/source/CAN.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/drivers/AnalogIn.cpp b/drivers/source/DigitalIn.cpp similarity index 70% rename from drivers/AnalogIn.cpp rename to drivers/source/DigitalIn.cpp index dd9d22f306..064503eee4 100644 --- a/drivers/AnalogIn.cpp +++ b/drivers/source/DigitalIn.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,14 +15,17 @@ * limitations under the License. */ -#include "drivers/AnalogIn.h" +#include "drivers/DigitalIn.h" -#if DEVICE_ANALOGIN +#include "platform/mbed_critical.h" namespace mbed { -SingletonPtr AnalogIn::_mutex; +void DigitalIn::mode(PinMode pull) +{ + core_util_critical_section_enter(); + gpio_mode(&gpio, pull); + core_util_critical_section_exit(); +} -}; - -#endif +} // namespace mbed diff --git a/drivers/source/DigitalInOut.cpp b/drivers/source/DigitalInOut.cpp new file mode 100644 index 0000000000..418491e165 --- /dev/null +++ b/drivers/source/DigitalInOut.cpp @@ -0,0 +1,53 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/DigitalInOut.h" + +#include "platform/mbed_critical.h" + +namespace mbed { + +void DigitalInOut::output() +{ + core_util_critical_section_enter(); + gpio_dir(&gpio, PIN_OUTPUT); + core_util_critical_section_exit(); +} + +void DigitalInOut::input() +{ + core_util_critical_section_enter(); + gpio_dir(&gpio, PIN_INPUT); + core_util_critical_section_exit(); +} + +void DigitalInOut::mode(PinMode pull) +{ + core_util_critical_section_enter(); + gpio_mode(&gpio, pull); + core_util_critical_section_exit(); +} + +DigitalInOut &DigitalInOut::operator= (DigitalInOut &rhs) +{ + core_util_critical_section_enter(); + write(rhs.read()); + core_util_critical_section_exit(); + return *this; +} + +} // namespace mbed diff --git a/drivers/source/DigitalOut.cpp b/drivers/source/DigitalOut.cpp new file mode 100644 index 0000000000..1d1855a9ef --- /dev/null +++ b/drivers/source/DigitalOut.cpp @@ -0,0 +1,32 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/DigitalOut.h" + +#include "platform/mbed_critical.h" + +namespace mbed { + +DigitalOut &DigitalOut::operator= (DigitalOut &rhs) +{ + core_util_critical_section_enter(); + write(rhs.read()); + core_util_critical_section_exit(); + return *this; +} + +} // namespace mbed diff --git a/drivers/Ethernet.cpp b/drivers/source/Ethernet.cpp similarity index 100% rename from drivers/Ethernet.cpp rename to drivers/source/Ethernet.cpp diff --git a/drivers/FlashIAP.cpp b/drivers/source/FlashIAP.cpp similarity index 99% rename from drivers/FlashIAP.cpp rename to drivers/source/FlashIAP.cpp index ff01509259..71565b80b0 100644 --- a/drivers/FlashIAP.cpp +++ b/drivers/source/FlashIAP.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/drivers/I2C.cpp b/drivers/source/I2C.cpp similarity index 99% rename from drivers/I2C.cpp rename to drivers/source/I2C.cpp index 3e06825c17..7857d22c6d 100644 --- a/drivers/I2C.cpp +++ b/drivers/source/I2C.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2015 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/drivers/I2CSlave.cpp b/drivers/source/I2CSlave.cpp similarity index 97% rename from drivers/I2CSlave.cpp rename to drivers/source/I2CSlave.cpp index f0697460be..489926c146 100644 --- a/drivers/I2CSlave.cpp +++ b/drivers/source/I2CSlave.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/drivers/InterruptIn.cpp b/drivers/source/InterruptIn.cpp similarity index 100% rename from drivers/InterruptIn.cpp rename to drivers/source/InterruptIn.cpp diff --git a/drivers/InterruptManager.cpp b/drivers/source/InterruptManager.cpp similarity index 100% rename from drivers/InterruptManager.cpp rename to drivers/source/InterruptManager.cpp diff --git a/drivers/MbedCRC.cpp b/drivers/source/MbedCRC.cpp similarity index 96% rename from drivers/MbedCRC.cpp rename to drivers/source/MbedCRC.cpp index 6353e052c3..b6bfda976e 100644 --- a/drivers/MbedCRC.cpp +++ b/drivers/source/MbedCRC.cpp @@ -16,12 +16,9 @@ */ #include -#include "drivers/TableCRC.h" #include "drivers/MbedCRC.h" namespace mbed { -/** \addtogroup drivers */ -/** @{*/ SingletonPtr mbed_crc_mutex; @@ -75,6 +72,4 @@ MbedCRC::MbedCRC(): mbed_crc_ctor(); } -/** @}*/ } // namespace mbed - diff --git a/drivers/source/PortIn.cpp b/drivers/source/PortIn.cpp new file mode 100644 index 0000000000..fc8577b848 --- /dev/null +++ b/drivers/source/PortIn.cpp @@ -0,0 +1,43 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/PortIn.h" + + +#if DEVICE_PORTIN + +#include "platform/mbed_critical.h" + +namespace mbed { + +PortIn::PortIn(PortName port, int mask) +{ + core_util_critical_section_enter(); + port_init(&_port, port, mask, PIN_INPUT); + core_util_critical_section_exit(); +} + +void PortIn::mode(PinMode mode) +{ + core_util_critical_section_enter(); + port_mode(&_port, mode); + core_util_critical_section_exit(); +} + +} // namespace mbed + +#endif // #if DEVICE_PORTIN diff --git a/drivers/source/PortInOut.cpp b/drivers/source/PortInOut.cpp new file mode 100644 index 0000000000..bb49672031 --- /dev/null +++ b/drivers/source/PortInOut.cpp @@ -0,0 +1,57 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/PortInOut.h" + + +#if DEVICE_PORTINOUT + +#include "platform/mbed_critical.h" + +namespace mbed { + +PortInOut::PortInOut(PortName port, int mask) +{ + core_util_critical_section_enter(); + port_init(&_port, port, mask, PIN_INPUT); + core_util_critical_section_exit(); +} + +void PortInOut::output() +{ + core_util_critical_section_enter(); + port_dir(&_port, PIN_OUTPUT); + core_util_critical_section_exit(); +} + +void PortInOut::input() +{ + core_util_critical_section_enter(); + port_dir(&_port, PIN_INPUT); + core_util_critical_section_exit(); +} + +void PortInOut::mode(PinMode mode) +{ + core_util_critical_section_enter(); + port_mode(&_port, mode); + core_util_critical_section_exit(); +} + +} // namespace mbed + +#endif // #if DEVICE_PORTINOUT diff --git a/drivers/source/PortOut.cpp b/drivers/source/PortOut.cpp new file mode 100644 index 0000000000..12a23d00ec --- /dev/null +++ b/drivers/source/PortOut.cpp @@ -0,0 +1,36 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/PortOut.h" + + +#if DEVICE_PORTOUT + +#include "platform/mbed_critical.h" + +namespace mbed { + +PortOut::PortOut(PortName port, int mask) +{ + core_util_critical_section_enter(); + port_init(&_port, port, mask, PIN_OUTPUT); + core_util_critical_section_exit(); +} + +} // namespace mbed + +#endif // #if DEVICE_PORTOUT diff --git a/drivers/source/PwmOut.cpp b/drivers/source/PwmOut.cpp new file mode 100644 index 0000000000..67e5f36b34 --- /dev/null +++ b/drivers/source/PwmOut.cpp @@ -0,0 +1,119 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/PwmOut.h" + + +#if DEVICE_PWMOUT + +#include "platform/mbed_critical.h" +#include "platform/mbed_power_mgmt.h" + +namespace mbed { + +PwmOut::PwmOut(PinName pin) : _deep_sleep_locked(false) +{ + core_util_critical_section_enter(); + pwmout_init(&_pwm, pin); + core_util_critical_section_exit(); +} + +PwmOut::~PwmOut() +{ + core_util_critical_section_enter(); + pwmout_free(&_pwm); + unlock_deep_sleep(); + core_util_critical_section_exit(); +} + +void PwmOut::write(float value) +{ + core_util_critical_section_enter(); + lock_deep_sleep(); + pwmout_write(&_pwm, value); + core_util_critical_section_exit(); +} + +float PwmOut::read() +{ + core_util_critical_section_enter(); + float val = pwmout_read(&_pwm); + core_util_critical_section_exit(); + return val; +} + +void PwmOut::period(float seconds) +{ + core_util_critical_section_enter(); + pwmout_period(&_pwm, seconds); + core_util_critical_section_exit(); +} + +void PwmOut::period_ms(int ms) +{ + core_util_critical_section_enter(); + pwmout_period_ms(&_pwm, ms); + core_util_critical_section_exit(); +} + +void PwmOut::period_us(int us) +{ + core_util_critical_section_enter(); + pwmout_period_us(&_pwm, us); + core_util_critical_section_exit(); +} + +void PwmOut::pulsewidth(float seconds) +{ + core_util_critical_section_enter(); + pwmout_pulsewidth(&_pwm, seconds); + core_util_critical_section_exit(); +} + +void PwmOut::pulsewidth_ms(int ms) +{ + core_util_critical_section_enter(); + pwmout_pulsewidth_ms(&_pwm, ms); + core_util_critical_section_exit(); +} + +void PwmOut::pulsewidth_us(int us) +{ + core_util_critical_section_enter(); + pwmout_pulsewidth_us(&_pwm, us); + core_util_critical_section_exit(); +} + +void PwmOut::lock_deep_sleep() +{ + if (_deep_sleep_locked == false) { + sleep_manager_lock_deep_sleep(); + _deep_sleep_locked = true; + } +} + +void PwmOut::unlock_deep_sleep() +{ + if (_deep_sleep_locked == true) { + sleep_manager_unlock_deep_sleep(); + _deep_sleep_locked = false; + } +} + +} // namespace mbed + +#endif // #if DEVICE_PWMOUT diff --git a/drivers/QSPI.cpp b/drivers/source/QSPI.cpp similarity index 100% rename from drivers/QSPI.cpp rename to drivers/source/QSPI.cpp diff --git a/drivers/RawSerial.cpp b/drivers/source/RawSerial.cpp similarity index 96% rename from drivers/RawSerial.cpp rename to drivers/source/RawSerial.cpp index 1424c6c9af..8fab077f9a 100644 --- a/drivers/RawSerial.cpp +++ b/drivers/source/RawSerial.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,9 +15,7 @@ * limitations under the License. */ #include "drivers/RawSerial.h" -#include "platform/mbed_wait_api.h" #include -#include #if DEVICE_SERIAL diff --git a/drivers/ResetReason.cpp b/drivers/source/ResetReason.cpp similarity index 100% rename from drivers/ResetReason.cpp rename to drivers/source/ResetReason.cpp diff --git a/drivers/SPI.cpp b/drivers/source/SPI.cpp similarity index 99% rename from drivers/SPI.cpp rename to drivers/source/SPI.cpp index ffe696bd6d..61d337dbf0 100644 --- a/drivers/SPI.cpp +++ b/drivers/source/SPI.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -243,7 +243,6 @@ void SPI::abort_transfer() #endif } - void SPI::clear_transfer_buffer() { #if TRANSACTION_QUEUE_SIZE_SPI diff --git a/drivers/SPISlave.cpp b/drivers/source/SPISlave.cpp similarity index 100% rename from drivers/SPISlave.cpp rename to drivers/source/SPISlave.cpp diff --git a/drivers/Serial.cpp b/drivers/source/Serial.cpp similarity index 94% rename from drivers/Serial.cpp rename to drivers/source/Serial.cpp index d0f87263b6..03ee49697a 100644 --- a/drivers/Serial.cpp +++ b/drivers/source/Serial.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +15,6 @@ * limitations under the License. */ #include "drivers/Serial.h" -#include "platform/mbed_wait_api.h" #if DEVICE_SERIAL diff --git a/drivers/SerialBase.cpp b/drivers/source/SerialBase.cpp similarity index 100% rename from drivers/SerialBase.cpp rename to drivers/source/SerialBase.cpp diff --git a/drivers/source/SerialWireOutput.cpp b/drivers/source/SerialWireOutput.cpp new file mode 100644 index 0000000000..92d6bd3c01 --- /dev/null +++ b/drivers/source/SerialWireOutput.cpp @@ -0,0 +1,41 @@ +/* mbed Microcontroller Library + * Copyright (c) 2017-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/SerialWireOutput.h" + +#if defined(DEVICE_ITM) + +#include "hal/itm_api.h" + +namespace mbed { + +SerialWireOutput::SerialWireOutput(void) +{ + /* Initialize ITM using internal init function. */ + mbed_itm_init(); +} + +ssize_t SerialWireOutput::write(const void *buffer, size_t size) +{ + mbed_itm_send_block(ITM_PORT_SWO, buffer, size); + + return size; +} + +} // namespace mbed + +#endif // DEVICE_ITM diff --git a/drivers/TableCRC.cpp b/drivers/source/TableCRC.cpp similarity index 99% rename from drivers/TableCRC.cpp rename to drivers/source/TableCRC.cpp index b0d316e471..6cea67d94a 100644 --- a/drivers/TableCRC.cpp +++ b/drivers/source/TableCRC.cpp @@ -16,11 +16,9 @@ */ #include -#include "drivers/TableCRC.h" +#include "drivers/internal/TableCRC.h" namespace mbed { -/** \addtogroup drivers */ -/** @{*/ extern const uint8_t Table_CRC_7Bit_SD[MBED_CRC_TABLE_SIZE] = { 0x0, 0x12, 0x24, 0x36, 0x48, 0x5a, 0x6c, 0x7e, 0x90, 0x82, 0xb4, 0xa6, 0xd8, 0xca, 0xfc, 0xee, @@ -151,6 +149,4 @@ extern const uint32_t Table_CRC_32bit_Rev_ANSI[MBED_OPTIMIZED_CRC_TABLE_SIZE] = 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c }; - -/** @}*/ } // namespace mbed diff --git a/drivers/Ticker.cpp b/drivers/source/Ticker.cpp similarity index 83% rename from drivers/Ticker.cpp rename to drivers/source/Ticker.cpp index b9540ec0fd..fada56cf64 100644 --- a/drivers/Ticker.cpp +++ b/drivers/source/Ticker.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,9 +20,19 @@ #include "platform/FunctionPointer.h" #include "hal/ticker_api.h" #include "platform/mbed_critical.h" +#include "platform/mbed_power_mgmt.h" namespace mbed { +Ticker::Ticker() : TimerEvent(), _function(0), _lock_deepsleep(true) +{ +} + +// When low power ticker is in use, then do not disable deep sleep. +Ticker::Ticker(const ticker_data_t *data) : TimerEvent(data), _function(0), _lock_deepsleep(!data->interface->runs_in_deep_sleep) +{ +} + void Ticker::detach() { core_util_critical_section_enter(); diff --git a/drivers/Timeout.cpp b/drivers/source/Timeout.cpp similarity index 100% rename from drivers/Timeout.cpp rename to drivers/source/Timeout.cpp diff --git a/drivers/Timer.cpp b/drivers/source/Timer.cpp similarity index 97% rename from drivers/Timer.cpp rename to drivers/source/Timer.cpp index 072581087a..d4f2276a41 100644 --- a/drivers/Timer.cpp +++ b/drivers/source/Timer.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +18,7 @@ #include "hal/ticker_api.h" #include "hal/us_ticker_api.h" #include "platform/mbed_critical.h" +#include "platform/mbed_power_mgmt.h" namespace mbed { diff --git a/drivers/TimerEvent.cpp b/drivers/source/TimerEvent.cpp similarity index 95% rename from drivers/TimerEvent.cpp rename to drivers/source/TimerEvent.cpp index 9c77eb86f5..be3037e62f 100644 --- a/drivers/TimerEvent.cpp +++ b/drivers/source/TimerEvent.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,7 +17,6 @@ #include "drivers/TimerEvent.h" #include -#include "hal/ticker_api.h" #include "hal/us_ticker_api.h" namespace mbed { diff --git a/drivers/UARTSerial.cpp b/drivers/source/UARTSerial.cpp similarity index 99% rename from drivers/UARTSerial.cpp rename to drivers/source/UARTSerial.cpp index 37e992c7ff..0475bf820e 100644 --- a/drivers/UARTSerial.cpp +++ b/drivers/source/UARTSerial.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2017 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/drivers/Watchdog.cpp b/drivers/source/Watchdog.cpp similarity index 100% rename from drivers/Watchdog.cpp rename to drivers/source/Watchdog.cpp diff --git a/events/Event.h b/events/Event.h index 2ce282a748..58310f029f 100644 --- a/events/Event.h +++ b/events/Event.h @@ -1,5 +1,5 @@ -/* events - * Copyright (c) 2016 ARM Limited +/* + * Copyright (c) 2016-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,20 +21,25 @@ #include "platform/mbed_assert.h" namespace events { -/** \addtogroup events */ +/** \ingroup events */ +/** \addtogroup events-public-api Public API */ +/** @{*/ /** Event * * Representation of an event for fine-grain dispatch control - * @ingroup events */ template class Event; +/** + * \defgroup events_Event Event class + * @{ + */ + /** Event * * Representation of an event for fine-grain dispatch control - * @ingroup events */ template class Event { @@ -389,9 +394,8 @@ public: Event(q, mbed::callback(obj, method), b0, b1, b2, b3, b4) { } }; +/** @}*/ -/** \addtogroup events */ -/** @{ */ // Convenience functions declared here to avoid cyclic // dependency between Event and EventQueue @@ -610,8 +614,7 @@ Event EventQueue::event(mbed::Callback(this, cb, c0, c1, c2, c3, c4); } -} - -#endif /** @}*/ +} +#endif diff --git a/events/EventQueue.h b/events/EventQueue.h index b5d567943a..197240473b 100644 --- a/events/EventQueue.h +++ b/events/EventQueue.h @@ -1,5 +1,5 @@ -/* events - * Copyright (c) 2016 ARM Limited +/* + * Copyright (c) 2016-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,14 +18,16 @@ #ifndef EVENT_QUEUE_H #define EVENT_QUEUE_H -#include "equeue/equeue.h" +#include "events/internal/equeue.h" #include "platform/Callback.h" #include "platform/NonCopyable.h" #include #include namespace events { -/** \addtogroup events */ +/** \ingroup events */ +/** \addtogroup events-public-api */ +/** @{*/ /** EVENTS_EVENT_SIZE * Minimum size of an event @@ -43,11 +45,14 @@ namespace events { template class Event; +/** + * \defgroup events_EventQueue EventQueue class + * @{ + */ /** EventQueue * * Flexible event queue for dispatching events - * @ingroup events */ class EventQueue : private mbed::NonCopyable { public: @@ -1186,7 +1191,9 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } #endif - diff --git a/events/equeue/equeue.h b/events/internal/equeue.h similarity index 98% rename from events/equeue/equeue.h rename to events/internal/equeue.h index a2c56e3fc8..d167fe48c8 100644 --- a/events/equeue/equeue.h +++ b/events/internal/equeue.h @@ -1,10 +1,8 @@ -/** \addtogroup events */ -/** @{*/ /* * Flexible event queue for dispatching events * - * Copyright (c) 2016 Christopher Haster + * Copyright (c) 2016-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,11 +24,14 @@ extern "C" { #endif // Platform specific files -#include "equeue/equeue_platform.h" +#include "events/internal/equeue_platform.h" #include #include +/** \ingroup events */ +/** \addtogroup events-internal-api Internal API */ +/** @{*/ // The minimum size of an event // This size is guaranteed to fit events created by event_call @@ -225,11 +226,10 @@ void equeue_background(equeue_t *queue, // platform-specific error code. int equeue_chain(equeue_t *queue, equeue_t *target); +/** @}*/ #ifdef __cplusplus } #endif #endif - -/** @}*/ diff --git a/events/equeue/equeue_platform.h b/events/internal/equeue_platform.h similarity index 98% rename from events/equeue/equeue_platform.h rename to events/internal/equeue_platform.h index a63a7400e9..ceefd942fa 100644 --- a/events/equeue/equeue_platform.h +++ b/events/internal/equeue_platform.h @@ -1,10 +1,7 @@ - -/** \addtogroup events */ -/** @{*/ /* * System specific implementation * - * Copyright (c) 2016 Christopher Haster + * Copyright (c) 2016-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +25,10 @@ extern "C" { #include #include +/** \ingroup events */ +/** \addtogroup events-internal-api */ +/** @{*/ + // Currently supported platforms // // Uncomment to select a supported platform or reimplement this file @@ -150,11 +151,10 @@ void equeue_sema_destroy(equeue_sema_t *sema); void equeue_sema_signal(equeue_sema_t *sema); bool equeue_sema_wait(equeue_sema_t *sema, int ms); +/** @}*/ #ifdef __cplusplus } #endif #endif - -/** @}*/ diff --git a/events/mbed_events.h b/events/mbed_events.h index 466b82bb17..39e4695edd 100644 --- a/events/mbed_events.h +++ b/events/mbed_events.h @@ -1,8 +1,6 @@ - /** \addtogroup events */ /** @{*/ -/* events - * Copyright (c) 2016 ARM Limited +/* Copyright (c) 2016-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,10 +18,6 @@ #ifndef MBED_EVENTS_H #define MBED_EVENTS_H - -#include "equeue/equeue.h" - - #ifdef __cplusplus #include "events/EventQueue.h" diff --git a/events/mbed_shared_queues.h b/events/mbed_shared_queues.h index eb8d91e791..741bddbe5f 100644 --- a/events/mbed_shared_queues.h +++ b/events/mbed_shared_queues.h @@ -1,8 +1,5 @@ - -/** \addtogroup events */ -/** @{*/ -/* events - * Copyright (c) 2017 ARM Limited +/* + * Copyright (c) 2016-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +19,9 @@ #include "events/EventQueue.h" namespace mbed { +/** \ingroup events */ +/** \addtogroup events-public-api */ +/** @{*/ /** * Return a pointer to an EventQueue, on which normal tasks can be queued. @@ -85,8 +85,8 @@ events::EventQueue *mbed_highprio_event_queue(); #endif // MBED_CONF_RTOS_PRESENT -}; +/** @}*/ + +} #endif - -/** @}*/ diff --git a/events/equeue/.mbedignore b/events/source/.mbedignore similarity index 100% rename from events/equeue/.mbedignore rename to events/source/.mbedignore diff --git a/events/EventQueue.cpp b/events/source/EventQueue.cpp similarity index 100% rename from events/EventQueue.cpp rename to events/source/EventQueue.cpp diff --git a/events/equeue/Makefile b/events/source/Makefile similarity index 96% rename from events/equeue/Makefile rename to events/source/Makefile index 1323c96bf0..6e636bc87b 100644 --- a/events/equeue/Makefile +++ b/events/source/Makefile @@ -17,7 +17,7 @@ endif ifdef WORD CFLAGS += -m$(WORD) endif -CFLAGS += -I. -I.. +CFLAGS += -I. -I.. -I../.. CFLAGS += -std=c99 CFLAGS += -Wall CFLAGS += -D_XOPEN_SOURCE=600 diff --git a/events/equeue/README.md b/events/source/README.md similarity index 99% rename from events/equeue/README.md rename to events/source/README.md index 10f500c56f..625c355571 100644 --- a/events/equeue/README.md +++ b/events/source/README.md @@ -207,4 +207,3 @@ comparison with previous runs: make prof | tee results.txt cat results.txt | make prof ``` - diff --git a/events/equeue/equeue.c b/events/source/equeue.c similarity index 99% rename from events/equeue/equeue.c rename to events/source/equeue.c index 3c89b5cfb9..0a49c46f5c 100644 --- a/events/equeue/equeue.c +++ b/events/source/equeue.c @@ -1,7 +1,7 @@ /* * Flexible event queue for dispatching events * - * Copyright (c) 2016 Christopher Haster + * Copyright (c) 2016-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "equeue/equeue.h" +#include "events/internal/equeue.h" #include #include diff --git a/events/equeue/equeue_mbed.cpp b/events/source/equeue_mbed.cpp similarity index 97% rename from events/equeue/equeue_mbed.cpp rename to events/source/equeue_mbed.cpp index 8f2e5f3f7a..394e12efbb 100644 --- a/events/equeue/equeue_mbed.cpp +++ b/events/source/equeue_mbed.cpp @@ -2,7 +2,7 @@ * Implementation for the mbed library * https://github.com/mbedmicro/mbed * - * Copyright (c) 2016 Christopher Haster + * Copyright (c) 2016-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "equeue/equeue_platform.h" +#include "events/internal/equeue_platform.h" #if defined(EQUEUE_PLATFORM_MBED) @@ -24,6 +24,7 @@ #include #include "cmsis.h" #include "platform/mbed_critical.h" +#include "platform/mbed_power_mgmt.h" #include "drivers/Timer.h" #include "drivers/Ticker.h" #include "drivers/Timeout.h" diff --git a/events/equeue/equeue_posix.c b/events/source/equeue_posix.c similarity index 96% rename from events/equeue/equeue_posix.c rename to events/source/equeue_posix.c index a39b1e1193..5053223ff5 100644 --- a/events/equeue/equeue_posix.c +++ b/events/source/equeue_posix.c @@ -1,7 +1,7 @@ /* * Implementation for Posix compliant platforms * - * Copyright (c) 2016 Christopher Haster + * Copyright (c) 2016-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "equeue/equeue_platform.h" +#include "events/internal/equeue_platform.h" #if defined(EQUEUE_PLATFORM_POSIX) diff --git a/events/mbed_shared_queues.cpp b/events/source/mbed_shared_queues.cpp similarity index 100% rename from events/mbed_shared_queues.cpp rename to events/source/mbed_shared_queues.cpp diff --git a/events/equeue/tests/prof.c b/events/source/tests/prof.c similarity index 99% rename from events/equeue/tests/prof.c rename to events/source/tests/prof.c index 82b5c93e0c..6f535aacb7 100644 --- a/events/equeue/tests/prof.c +++ b/events/source/tests/prof.c @@ -1,7 +1,7 @@ /* * Profiling framework for the events library * - * Copyright (c) 2016 Christopher Haster + * Copyright (c) 2016 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "equeue.h" +#include "events/internal/equeue.h" #include #include #include diff --git a/events/equeue/tests/tests.c b/events/source/tests/tests.c similarity index 99% rename from events/equeue/tests/tests.c rename to events/source/tests/tests.c index 96f1842962..5950cd5e82 100644 --- a/events/equeue/tests/tests.c +++ b/events/source/tests/tests.c @@ -1,7 +1,7 @@ /* * Testing framework for the events library * - * Copyright (c) 2016 Christopher Haster + * Copyright (c) 2016 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "equeue.h" +#include "events/internal/equeue.h" #include #include #include diff --git a/features/device_key/source/DeviceKey.h b/features/device_key/source/DeviceKey.h index 6ca024127e..861d1592a0 100644 --- a/features/device_key/source/DeviceKey.h +++ b/features/device_key/source/DeviceKey.h @@ -32,7 +32,7 @@ #if (DEVICEKEY_ENABLED) || defined(DOXYGEN_ONLY) namespace mbed { -/** \addtogroup drivers */ +/** \addtogroup device-key Device Key */ #define DEVICE_KEY_16BYTE 16 #define DEVICE_KEY_32BYTE 32 @@ -56,7 +56,7 @@ enum DeviceKeyStatus { /** Use this singleton if you need to derive a new key from the device root of trust. * * @note Synchronization level: Thread safe - * @ingroup drivers + * @ingroup device-key */ class DeviceKey : private mbed::NonCopyable { diff --git a/hal/LowPowerTickerWrapper.h b/hal/LowPowerTickerWrapper.h index 5ce81c59e3..7a59261726 100644 --- a/hal/LowPowerTickerWrapper.h +++ b/hal/LowPowerTickerWrapper.h @@ -2,7 +2,7 @@ /** \addtogroup hal */ /** @{*/ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,6 +26,8 @@ #include "hal/us_ticker_api.h" #include "drivers/Timeout.h" +#include "platform/mbed_critical.h" + class LowPowerTickerWrapper { public: diff --git a/hal/ethernet_api.h b/hal/ethernet_api.h index 1a14fda06e..442f1ea47e 100644 --- a/hal/ethernet_api.h +++ b/hal/ethernet_api.h @@ -29,32 +29,67 @@ extern "C" { #endif // Connection constants - +MBED_DEPRECATED( + "Ethernet drivers are provided by a class derived from `EMAC` attached to" + " either lwIP or Nanostack." +) int ethernet_init(void); +MBED_DEPRECATED( + "Ethernet drivers are provided by a class derived from `EMAC` attached to" + " either lwIP or Nanostack." +) void ethernet_free(void); // write size bytes from data to ethernet buffer // return num bytes written // or -1 if size is too big +MBED_DEPRECATED( + "Ethernet drivers are provided by a class derived from `EMAC` attached to" + " either lwIP or Nanostack." +) int ethernet_write(const char *data, int size); // send ethernet write buffer, returning the packet size sent +MBED_DEPRECATED( + "Ethernet drivers are provided by a class derived from `EMAC` attached to" + " either lwIP or Nanostack." +) int ethernet_send(void); // receive from ethernet buffer, returning packet size, or 0 if no packet +MBED_DEPRECATED( + "Ethernet drivers are provided by a class derived from `EMAC` attached to" + " either lwIP or Nanostack." +) int ethernet_receive(void); // read size bytes in to data, return actual num bytes read (0..size) // if data == NULL, throw the bytes away +MBED_DEPRECATED( + "Ethernet drivers are provided by a class derived from `EMAC` attached to" + " either lwIP or Nanostack." +) int ethernet_read(char *data, int size); // get the ethernet address +MBED_DEPRECATED( + "Ethernet drivers are provided by a class derived from `EMAC` attached to" + " either lwIP or Nanostack." +) void ethernet_address(char *mac); // see if the link is up +MBED_DEPRECATED( + "Ethernet drivers are provided by a class derived from `EMAC` attached to" + " either lwIP or Nanostack." +) int ethernet_link(void); // force link settings +MBED_DEPRECATED( + "Ethernet drivers are provided by a class derived from `EMAC` attached to" + " either lwIP or Nanostack." +) void ethernet_set_link(int speed, int duplex); #ifdef __cplusplus diff --git a/rtos/ConditionVariable.h b/rtos/ConditionVariable.h index 35ecbf5709..2d2ffd7e6b 100644 --- a/rtos/ConditionVariable.h +++ b/rtos/ConditionVariable.h @@ -1,5 +1,5 @@ /* Mbed Microcontroller Library - * Copyright (c) 2017-2018 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,10 +32,15 @@ #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api Public API */ /** @{*/ struct Waiter; +/** + * \defgroup rtos_ConditionVariable ConditionVariable class + * @{ + */ /** The ConditionVariable class is a synchronization primitive that allows * threads to wait until a particular condition occurs. @@ -327,9 +332,9 @@ protected: #endif // !defined(DOXYGEN_ONLY) }; -} -#endif - -#endif - /** @}*/ +/** @}*/ +} // namespace rtos +#endif + +#endif diff --git a/rtos/EventFlags.h b/rtos/EventFlags.h index 2ac7c1ee2f..7c808766c5 100644 --- a/rtos/EventFlags.h +++ b/rtos/EventFlags.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2017 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,8 @@ #include "platform/NonCopyable.h" namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_EventFlags EventFlags class @@ -127,4 +128,3 @@ private: } #endif - diff --git a/rtos/Kernel.h b/rtos/Kernel.h index 5a73aadf40..43ca0a6fc8 100644 --- a/rtos/Kernel.h +++ b/rtos/Kernel.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,8 @@ #include "rtos/mbed_rtos_types.h" namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** Functions in the Kernel namespace control RTOS kernel information. */ @@ -60,7 +61,6 @@ void attach_thread_terminate_hook(void (*fptr)(osThreadId_t id)); } // namespace Kernel +/** @}*/ } // namespace rtos #endif - -/** @}*/ diff --git a/rtos/Mail.h b/rtos/Mail.h index 67b6b0212a..a7bbda6da4 100644 --- a/rtos/Mail.h +++ b/rtos/Mail.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2017 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,7 +41,8 @@ using namespace rtos; #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_Mail Mail class diff --git a/rtos/MemoryPool.h b/rtos/MemoryPool.h index 6196096a84..0bce9373df 100644 --- a/rtos/MemoryPool.h +++ b/rtos/MemoryPool.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,10 +29,14 @@ #include "rtos/mbed_rtos1_types.h" #include "rtos/mbed_rtos_storage.h" #include "platform/NonCopyable.h" +#include "platform/mbed_assert.h" +#include "Kernel.h" + #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_MemoryPool MemoryPool class diff --git a/rtos/Mutex.h b/rtos/Mutex.h index 2a48e2dec2..457d4a1d5f 100644 --- a/rtos/Mutex.h +++ b/rtos/Mutex.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,7 +32,8 @@ #include "platform/mbed_toolchain.h" namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ class Mutex; @@ -227,5 +228,3 @@ inline void Mutex::unlock() /** @}*/ } #endif - - diff --git a/rtos/Queue.h b/rtos/Queue.h index 7e0149634f..ac1b98c344 100644 --- a/rtos/Queue.h +++ b/rtos/Queue.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,7 +31,8 @@ #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_Queue Queue class diff --git a/rtos/RtosTimer.h b/rtos/RtosTimer.h index dfff795574..a6ec7e97ec 100644 --- a/rtos/RtosTimer.h +++ b/rtos/RtosTimer.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,7 +33,8 @@ #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_RtosTimer RtosTimer class diff --git a/rtos/Semaphore.h b/rtos/Semaphore.h index 8b89e7b48d..32639155b4 100644 --- a/rtos/Semaphore.h +++ b/rtos/Semaphore.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,8 @@ #include "platform/NonCopyable.h" namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_Semaphore Semaphore class @@ -156,5 +157,3 @@ private: /** @}*/ } #endif - - diff --git a/rtos/TARGET_CORTEX/mbed_boot.h b/rtos/TARGET_CORTEX/mbed_boot.h index 65f7af6fcb..98229b3929 100644 --- a/rtos/TARGET_CORTEX/mbed_boot.h +++ b/rtos/TARGET_CORTEX/mbed_boot.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018-2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,6 +25,10 @@ extern "C" { #include "mbed_rtx.h" +/** \ingroup rtos */ +/** \addtogroup mbed-os-internal */ +/** @{*/ + /** * \defgroup boot Boot sequence * Boot sequence overview @@ -158,6 +162,7 @@ void mbed_sdk_init(void); */ void mbed_main(void); +/**@}*/ /**@}*/ #ifdef __cplusplus diff --git a/rtos/TARGET_CORTEX/mbed_rtx_handlers.c b/rtos/TARGET_CORTEX/mbed_rtx_handlers.c index 31ce7f81d7..b5e46f812e 100644 --- a/rtos/TARGET_CORTEX/mbed_rtx_handlers.c +++ b/rtos/TARGET_CORTEX/mbed_rtx_handlers.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2016 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,8 +22,8 @@ #include "mbed_error.h" #include "mbed_interface.h" #include "RTX_Config.h" -#include "rtos/rtos_handlers.h" -#include "rtos/rtos_idle.h" +#include "rtos/source/rtos_handlers.h" +#include "rtos/source/rtos_idle.h" #ifdef RTE_Compiler_EventRecorder #include "EventRecorder.h" // Keil::Compiler:Event Recorder diff --git a/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp b/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp index 6d4431d8d9..27b6d5e478 100644 --- a/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp +++ b/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,7 @@ * SOFTWARE. */ -#include "rtos/rtos_idle.h" +#include "rtos/source/rtos_idle.h" #include "platform/mbed_power_mgmt.h" #include "platform/mbed_os_timer.h" #include "TimerEvent.h" diff --git a/rtos/TARGET_CORTEX/mbed_rtx_storage.h b/rtos/TARGET_CORTEX/mbed_rtx_storage.h index d14f78abc2..bcc5ea0c3a 100644 --- a/rtos/TARGET_CORTEX/mbed_rtx_storage.h +++ b/rtos/TARGET_CORTEX/mbed_rtx_storage.h @@ -26,31 +26,48 @@ extern "C" { #endif -/** \addtogroup rtos */ +#include "rtx_os.h" +#include "mbed_rtx_conf.h" + +/** \ingroup rtos */ +/** \addtogroup mbed-os-internal */ /** @{*/ -/** @brief RTOS primitives storage types for RTX - +/** \defgroup rtos_storage RTOS primitives storage types for RTX Types defined in this file should be utilized, when the direct RTOS C API usage is required, to provide backing memory for internal RTX data. Allocated object should be wrapped in attribute struct and passed to os*New call, for details see CMSIS-RTOS2 documentation. - @note This file breaks abstraction layers and uses RTX internal types, but it limits the contamination to single, RTOS implementation specific, header file, therefore limiting scope of possible changes. - */ - -#include "rtx_os.h" -#include "mbed_rtx_conf.h" + @{ +*/ +/** RTX Mutex storage */ typedef osRtxMutex_t mbed_rtos_storage_mutex_t; + +/** RTX Semaphore storage */ typedef osRtxSemaphore_t mbed_rtos_storage_semaphore_t; + +/** RTX Thread storage */ typedef osRtxThread_t mbed_rtos_storage_thread_t; + +/** RTX Memory Pool storage */ typedef osRtxMemoryPool_t mbed_rtos_storage_mem_pool_t; + +/** RTX Message Queue storage */ typedef osRtxMessageQueue_t mbed_rtos_storage_msg_queue_t; + +/** RTX Event Flags storage */ typedef osRtxEventFlags_t mbed_rtos_storage_event_flags_t; + +/** RTX Message storage */ typedef osRtxMessage_t mbed_rtos_storage_message_t; + +/** RTX Timer storage */ typedef osRtxTimer_t mbed_rtos_storage_timer_t; +/** @}*/ +/** @}*/ #define MBED_RTOS_STORAGE_MEM_POOL_MEM_SIZE(block_count, block_size) \ osRtxMemoryPoolMemSize(block_count, block_size) @@ -60,5 +77,3 @@ typedef osRtxTimer_t mbed_rtos_storage_timer_t; #endif #endif - -/** @}*/ diff --git a/rtos/ThisThread.h b/rtos/ThisThread.h index b3a67a62f2..88097d07b7 100644 --- a/rtos/ThisThread.h +++ b/rtos/ThisThread.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2018 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,8 @@ #include "rtos/mbed_rtos_types.h" namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_ThisThread ThisThread namespace @@ -198,5 +199,3 @@ bool non_rtos_check_flags(void *handle); } } #endif - - diff --git a/rtos/Thread.h b/rtos/Thread.h index f272a5d600..ecf4954649 100644 --- a/rtos/Thread.h +++ b/rtos/Thread.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,7 +35,8 @@ #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) || defined(UNITTEST) namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_Thread Thread class diff --git a/rtos/rtos.h b/rtos/rtos.h index b480d25dfc..ce44c0fd47 100644 --- a/rtos/rtos.h +++ b/rtos/rtos.h @@ -42,8 +42,6 @@ using namespace rtos; #endif -#include "platform/mbed_version.h" - #endif /** @}*/ diff --git a/rtos/ConditionVariable.cpp b/rtos/source/ConditionVariable.cpp similarity index 98% rename from rtos/ConditionVariable.cpp rename to rtos/source/ConditionVariable.cpp index f4e03701d5..87810464ea 100644 --- a/rtos/ConditionVariable.cpp +++ b/rtos/source/ConditionVariable.cpp @@ -23,8 +23,8 @@ #include "rtos/Kernel.h" #include "rtos/ThisThread.h" -#include "mbed_error.h" -#include "mbed_assert.h" +#include "platform/mbed_error.h" +#include "platform/mbed_assert.h" #if MBED_CONF_RTOS_PRESENT diff --git a/rtos/EventFlags.cpp b/rtos/source/EventFlags.cpp similarity index 98% rename from rtos/EventFlags.cpp rename to rtos/source/EventFlags.cpp index df4a273e26..7543fb647f 100644 --- a/rtos/EventFlags.cpp +++ b/rtos/source/EventFlags.cpp @@ -23,8 +23,8 @@ #include "rtos/ThisThread.h" #include "mbed_os_timer.h" #include -#include "mbed_error.h" -#include "mbed_assert.h" +#include "platform/mbed_error.h" +#include "platform/mbed_assert.h" namespace rtos { diff --git a/rtos/Kernel.cpp b/rtos/source/Kernel.cpp similarity index 98% rename from rtos/Kernel.cpp rename to rtos/source/Kernel.cpp index 21664292a1..e5e3443300 100644 --- a/rtos/Kernel.cpp +++ b/rtos/source/Kernel.cpp @@ -21,8 +21,8 @@ */ #include "rtos/Kernel.h" -#include "rtos/rtos_idle.h" -#include "rtos/rtos_handlers.h" +#include "rtos_idle.h" +#include "rtos_handlers.h" #include "platform/mbed_critical.h" #include "platform/mbed_os_timer.h" diff --git a/rtos/Mutex.cpp b/rtos/source/Mutex.cpp similarity index 98% rename from rtos/Mutex.cpp rename to rtos/source/Mutex.cpp index 8316168b6c..7752f6670c 100644 --- a/rtos/Mutex.cpp +++ b/rtos/source/Mutex.cpp @@ -23,8 +23,8 @@ #include "rtos/Kernel.h" #include -#include "mbed_error.h" -#include "mbed_assert.h" +#include "platform/mbed_error.h" +#include "platform/mbed_assert.h" #if MBED_CONF_RTOS_PRESENT diff --git a/rtos/RtosTimer.cpp b/rtos/source/RtosTimer.cpp similarity index 100% rename from rtos/RtosTimer.cpp rename to rtos/source/RtosTimer.cpp diff --git a/rtos/Semaphore.cpp b/rtos/source/Semaphore.cpp similarity index 100% rename from rtos/Semaphore.cpp rename to rtos/source/Semaphore.cpp diff --git a/rtos/ThisThread.cpp b/rtos/source/ThisThread.cpp similarity index 99% rename from rtos/ThisThread.cpp rename to rtos/source/ThisThread.cpp index 4d7fb052e3..0ee2d73f29 100644 --- a/rtos/ThisThread.cpp +++ b/rtos/source/ThisThread.cpp @@ -252,5 +252,3 @@ const char *get_name() } } - - diff --git a/rtos/Thread.cpp b/rtos/source/Thread.cpp similarity index 99% rename from rtos/Thread.cpp rename to rtos/source/Thread.cpp index c3eb83dd50..1a7a5f1377 100644 --- a/rtos/Thread.cpp +++ b/rtos/source/Thread.cpp @@ -21,8 +21,8 @@ */ #include "rtos/Thread.h" #include "rtos/ThisThread.h" -#include "rtos/rtos_idle.h" -#include "rtos/rtos_handlers.h" +#include "rtos_idle.h" +#include "rtos_handlers.h" #include "platform/mbed_assert.h" #include "platform/mbed_error.h" diff --git a/rtos/rtos_handlers.h b/rtos/source/rtos_handlers.h similarity index 95% rename from rtos/rtos_handlers.h rename to rtos/source/rtos_handlers.h index 351682b12b..1e2b25bb85 100644 --- a/rtos/rtos_handlers.h +++ b/rtos/source/rtos_handlers.h @@ -1,6 +1,3 @@ - -/** \addtogroup rtos */ -/** @{*/ /* mbed Microcontroller Library * Copyright (c) 2006-2012 ARM Limited * @@ -31,6 +28,10 @@ extern "C" { #endif +/** \ingroup rtos */ +/** \addtogroup rtos-internal-api Internal API */ +/** @{*/ + /** * \defgroup rtos_handlers RTOS hook functions * @{ @@ -42,12 +43,10 @@ extern "C" { */ void rtos_attach_thread_terminate_hook(void (*fptr)(osThreadId_t id)); /** @}*/ +/** @}*/ #ifdef __cplusplus } #endif #endif - -/** @}*/ - diff --git a/rtos/rtos_idle.h b/rtos/source/rtos_idle.h similarity index 95% rename from rtos/rtos_idle.h rename to rtos/source/rtos_idle.h index f1f5d6fc3d..b6b2850078 100644 --- a/rtos/rtos_idle.h +++ b/rtos/source/rtos_idle.h @@ -1,6 +1,3 @@ - -/** \addtogroup rtos */ -/** @{*/ /* mbed Microcontroller Library * Copyright (c) 2006-2012 ARM Limited * @@ -26,12 +23,16 @@ #define RTOS_IDLE_H #include "mbed_toolchain.h" -#include #ifdef __cplusplus extern "C" { #endif + +/** \ingroup rtos */ +/** \addtogroup rtos-internal-api Internal API */ +/** @{*/ + /** * \defgroup rtos_Idle Idle hook function * @{ @@ -46,6 +47,7 @@ void rtos_attach_idle_hook(void (*fptr)(void)); /** @private */ MBED_NORETURN void rtos_idle_loop(void); +/** @}*/ /** @}*/ #ifdef __cplusplus @@ -53,6 +55,3 @@ MBED_NORETURN void rtos_idle_loop(void); #endif #endif - -/** @}*/ - diff --git a/tools/test/travis-ci/doxy-spellchecker/spell.sh b/tools/test/travis-ci/doxy-spellchecker/spell.sh index e56c33e646..9574e69eb6 100755 --- a/tools/test/travis-ci/doxy-spellchecker/spell.sh +++ b/tools/test/travis-ci/doxy-spellchecker/spell.sh @@ -20,6 +20,7 @@ while read file; do # matched. start_tokens=( "/@code" "/addtogroup" + "ingroup" "defgroup" "<" "()" @@ -28,6 +29,7 @@ while read file; do formats=( 'strip_between' 'strip_between' 'strip_line' + 'strip_line' 'strip_between_sameline' 'strip_token' ) @@ -35,6 +37,7 @@ while read file; do end_tokens=( "/@endcode" "/\*" "" + "" ">" "" ) diff --git a/usb/device/utilities/events/PolledQueue.h b/usb/device/utilities/events/PolledQueue.h index 61492b727d..a2bfc0ac78 100644 --- a/usb/device/utilities/events/PolledQueue.h +++ b/usb/device/utilities/events/PolledQueue.h @@ -22,14 +22,14 @@ #include "platform/Callback.h" #include "LinkedList.h" namespace events { -/** \addtogroup events */ - +/** \ingroup events */ +/** \addtogroup events-internal-api */ +/** @{*/ /** PolledQueue * * This class is an implementation of TaskQueue which is * processed synchronously by calls to dispatch. - * @ingroup events */ class PolledQueue: public TaskQueue { public: @@ -67,6 +67,7 @@ protected: }; +/** @}*/ + } #endif - diff --git a/usb/device/utilities/events/Task.h b/usb/device/utilities/events/Task.h index 966db97152..b1e2a517fa 100644 --- a/usb/device/utilities/events/Task.h +++ b/usb/device/utilities/events/Task.h @@ -24,7 +24,9 @@ #include "platform/Callback.h" namespace events { -/** \addtogroup events */ +/** \ingroup events */ +/** \addtogroup events-internal-api */ +/** @{*/ template @@ -583,7 +585,6 @@ private: /** Task * * Representation of a postable task - * @ingroup events */ template class Task: public TaskBase { @@ -647,8 +648,8 @@ private: All _args; }; -} - /** @}*/ +} + #endif diff --git a/usb/device/utilities/events/TaskBase.h b/usb/device/utilities/events/TaskBase.h index b88e4d4336..8aceba6b5e 100644 --- a/usb/device/utilities/events/TaskBase.h +++ b/usb/device/utilities/events/TaskBase.h @@ -27,7 +27,9 @@ class Semaphore; } namespace events { -/** \addtogroup events */ +/** \ingroup events */ +/** \addtogroup events-internal-api */ +/** @{*/ class TaskQueue; @@ -35,7 +37,6 @@ class TaskQueue; /** TaskBase * * Representation of a caller allocated task - * @ingroup events */ class TaskBase : public LinkEntry { public: @@ -158,8 +159,8 @@ private: void _wake_check(); }; +/** @}*/ + } #endif - -/** @}*/ diff --git a/usb/device/utilities/events/TaskQueue.h b/usb/device/utilities/events/TaskQueue.h index 5623fd65e0..8fae4e676b 100644 --- a/usb/device/utilities/events/TaskQueue.h +++ b/usb/device/utilities/events/TaskQueue.h @@ -25,14 +25,15 @@ #define MBED_MAX_TASK_SIZE 32 namespace events { -/** \addtogroup events */ +/** \ingroup events */ +/** \addtogroup events-internal-api */ +/** @{*/ /** TaskQueue * * Flexible task queue for dispatching tasks - * @ingroup events */ class TaskQueue { public: @@ -134,6 +135,7 @@ protected: } }; +/** @}*/ + } #endif - From 83354e46a734d83c04ef2d557fe77b9a9afe3184 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Thu, 27 Jun 2019 09:49:22 +0100 Subject: [PATCH 02/10] Platform: Separate internal APIs from public APIs Also includes: * rename `mbed_sleep_manager.c` to `mbed_power_mgmt.c` to match its header file * create Doxygen groups for public and internal APIs * use relative path to include header files where inconsistent * update references to internal APIs throughout libraries * update the copyright year for all modified files --- drivers/InterruptManager.h | 4 +- drivers/RawSerial.h | 2 +- platform/ATCmdParser.h | 11 ++-- platform/CThunk.h | 10 +-- platform/Callback.h | 5 +- platform/CircularBuffer.h | 5 +- platform/CriticalSectionLock.h | 36 +++-------- platform/DeepSleepLock.h | 43 +++---------- platform/DirHandle.h | 8 +-- platform/FileBase.h | 6 +- platform/FileHandle.h | 7 ++- platform/FileLike.h | 6 +- platform/FilePath.h | 5 +- platform/FileSystemHandle.h | 6 +- platform/FileSystemLike.h | 6 +- platform/FunctionPointer.h | 5 +- platform/LocalFileSystem.h | 5 +- platform/NonCopyable.h | 9 +-- platform/PlatformMutex.h | 8 +-- platform/ScopedLock.h | 5 +- platform/ScopedRamExecutionLock.h | 5 +- platform/ScopedRomWriteLock.h | 5 +- platform/SingletonPtr.h | 5 +- platform/Span.h | 5 +- platform/Stream.h | 8 +-- platform/Transaction.h | 6 +- platform/{ => internal}/CThunkBase.h | 12 +++- platform/{ => internal}/CallChain.h | 10 +-- platform/mbed_assert.h | 8 +-- platform/mbed_atomic.h | 7 ++- platform/mbed_critical.h | 8 +-- platform/mbed_debug.h | 7 ++- platform/mbed_error.h | 5 +- platform/mbed_interface.h | 9 +-- platform/mbed_mem_trace.h | 5 +- platform/mbed_mktime.h | 5 +- platform/mbed_mpu_mgmt.h | 7 +-- platform/mbed_poll.h | 5 +- platform/mbed_power_mgmt.h | 9 +-- platform/mbed_preprocessor.h | 5 +- platform/mbed_retarget.h | 5 +- platform/mbed_rtc_time.h | 5 +- platform/mbed_semihost_api.h | 3 +- platform/mbed_stats.h | 5 +- platform/mbed_toolchain.h | 7 ++- platform/mbed_version.h | 5 +- platform/mbed_wait_api.h | 5 +- platform/{ => source}/ATCmdParser.cpp | 1 - platform/{ => source}/CThunkBase.cpp | 4 +- platform/{ => source}/CallChain.cpp | 4 +- platform/source/CriticalSectionLock.cpp | 53 ++++++++++++++++ platform/source/DeepSleepLock.cpp | 62 +++++++++++++++++++ platform/{ => source}/FileBase.cpp | 1 - platform/{ => source}/FileHandle.cpp | 6 +- platform/{ => source}/FilePath.cpp | 0 platform/{ => source}/FileSystemHandle.cpp | 5 +- platform/{ => source}/LocalFileSystem.cpp | 0 platform/{ => source}/Stream.cpp | 0 platform/{ => source}/mbed_alloc_wrappers.cpp | 0 platform/{ => source}/mbed_application.c | 2 +- platform/{ => source}/mbed_assert.c | 4 +- .../{internal => source}/mbed_atomic_impl.c | 0 platform/{ => source}/mbed_board.c | 0 .../{ => source}/mbed_crash_data_offsets.h | 12 ++-- platform/{ => source}/mbed_critical.c | 3 +- platform/{ => source}/mbed_error.c | 8 +-- platform/{ => source}/mbed_error_hist.c | 6 +- platform/{ => source}/mbed_error_hist.h | 9 ++- platform/{ => source}/mbed_interface.c | 6 +- platform/{ => source}/mbed_mem_trace.cpp | 4 +- platform/{ => source}/mbed_mktime.c | 4 +- platform/{ => source}/mbed_mpu_mgmt.c | 4 +- platform/{ => source}/mbed_poll.cpp | 0 .../mbed_power_mgmt.c} | 16 ++--- platform/{ => source}/mbed_retarget.cpp | 8 +-- platform/{ => source}/mbed_rtc_time.cpp | 3 +- platform/{ => source}/mbed_sdk_boot.c | 0 platform/{ => source}/mbed_semihost_api.c | 1 - platform/{ => source}/mbed_stats.c | 24 +++++-- platform/{ => source}/mbed_wait_api_no_rtos.c | 0 platform/{ => source}/mbed_wait_api_rtos.cpp | 4 +- platform/toolchain.h | 5 +- 82 files changed, 363 insertions(+), 259 deletions(-) rename platform/{ => internal}/CThunkBase.h (93%) rename platform/{ => internal}/CallChain.h (97%) rename platform/{ => source}/ATCmdParser.cpp (99%) rename platform/{ => source}/CThunkBase.cpp (98%) rename platform/{ => source}/CallChain.cpp (97%) create mode 100644 platform/source/CriticalSectionLock.cpp create mode 100644 platform/source/DeepSleepLock.cpp rename platform/{ => source}/FileBase.cpp (99%) rename platform/{ => source}/FileHandle.cpp (87%) rename platform/{ => source}/FilePath.cpp (100%) rename platform/{ => source}/FileSystemHandle.cpp (93%) rename platform/{ => source}/LocalFileSystem.cpp (100%) rename platform/{ => source}/Stream.cpp (100%) rename platform/{ => source}/mbed_alloc_wrappers.cpp (100%) rename platform/{ => source}/mbed_application.c (99%) rename platform/{ => source}/mbed_assert.c (92%) rename platform/{internal => source}/mbed_atomic_impl.c (100%) rename platform/{ => source}/mbed_board.c (100%) rename platform/{ => source}/mbed_crash_data_offsets.h (93%) rename platform/{ => source}/mbed_critical.c (95%) rename platform/{ => source}/mbed_error.c (99%) rename platform/{ => source}/mbed_error_hist.c (95%) rename platform/{ => source}/mbed_error_hist.h (97%) rename platform/{ => source}/mbed_interface.c (94%) rename platform/{ => source}/mbed_mem_trace.cpp (98%) rename platform/{ => source}/mbed_mktime.c (98%) rename platform/{ => source}/mbed_mpu_mgmt.c (96%) rename platform/{ => source}/mbed_poll.cpp (100%) rename platform/{mbed_sleep_manager.c => source/mbed_power_mgmt.c} (96%) rename platform/{ => source}/mbed_retarget.cpp (99%) rename platform/{ => source}/mbed_rtc_time.cpp (97%) rename platform/{ => source}/mbed_sdk_boot.c (100%) rename platform/{ => source}/mbed_semihost_api.c (99%) rename platform/{ => source}/mbed_stats.c (86%) rename platform/{ => source}/mbed_wait_api_no_rtos.c (100%) rename platform/{ => source}/mbed_wait_api_rtos.cpp (97%) diff --git a/drivers/InterruptManager.h b/drivers/InterruptManager.h index f53d206a63..2ed04be8ae 100644 --- a/drivers/InterruptManager.h +++ b/drivers/InterruptManager.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,7 @@ #define MBED_INTERRUPTMANAGER_H #include "cmsis.h" -#include "platform/CallChain.h" +#include "platform/internal/CallChain.h" #include "platform/PlatformMutex.h" #include "platform/NonCopyable.h" #include diff --git a/drivers/RawSerial.h b/drivers/RawSerial.h index 061d93fa06..ae1786f357 100644 --- a/drivers/RawSerial.h +++ b/drivers/RawSerial.h @@ -21,7 +21,7 @@ #if DEVICE_SERIAL || defined(DOXYGEN_ONLY) -#include "mbed_toolchain.h" +#include "platform/mbed_toolchain.h" #include "drivers/SerialBase.h" #include "platform/NonCopyable.h" #include diff --git a/platform/ATCmdParser.h b/platform/ATCmdParser.h index ee60813834..f3d9bb195b 100644 --- a/platform/ATCmdParser.h +++ b/platform/ATCmdParser.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017 ARM Limited +/* Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,13 +22,14 @@ #define MBED_ATCMDPARSER_H #include -#include "Callback.h" -#include "NonCopyable.h" -#include "FileHandle.h" +#include "platform/Callback.h" +#include "platform/NonCopyable.h" +#include "platform/FileHandle.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api Public API */ /** @{*/ /** * \defgroup platform_ATCmdParser ATCmdParser class diff --git a/platform/CThunk.h b/platform/CThunk.h index 288cac141e..e90aaf0db3 100644 --- a/platform/CThunk.h +++ b/platform/CThunk.h @@ -1,5 +1,5 @@ - -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_CThunk CThunk class @@ -12,7 +12,7 @@ * - supports an optional context parameter for the called function * - ideally suited for class object receiving interrupts (NVIC_SetVector) * - * Copyright (c) 2014-2015 ARM Limited + * Copyright (c) 2014-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,7 +39,7 @@ #ifndef __CTHUNK_H__ #define __CTHUNK_H__ -#include "CThunkBase.h" +#include "platform/internal/CThunkBase.h" /** * Class for created a pointer with data bound to it @@ -47,7 +47,7 @@ * @note Synchronization level: Not protected */ template -class CThunk: public CThunkBase { +class CThunk: private CThunkBase { public: typedef void (T::*CCallbackSimple)(void); typedef void (T::*CCallback)(void *context); diff --git a/platform/Callback.h b/platform/Callback.h index a72143a8ea..1ad9b1df65 100644 --- a/platform/Callback.h +++ b/platform/Callback.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2015 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,7 +24,8 @@ #include "platform/mbed_toolchain.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_Callback Callback class diff --git a/platform/CircularBuffer.h b/platform/CircularBuffer.h index 77e8bb400d..3fc87dd2db 100644 --- a/platform/CircularBuffer.h +++ b/platform/CircularBuffer.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2015 ARM Limited + * Copyright (c) 2015-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -51,7 +51,8 @@ struct is_unsigned { }; }; -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_CircularBuffer CircularBuffer functions diff --git a/platform/CriticalSectionLock.h b/platform/CriticalSectionLock.h index cf861f93a2..3f8ed52a85 100644 --- a/platform/CriticalSectionLock.h +++ b/platform/CriticalSectionLock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,12 +18,12 @@ #ifndef MBED_CRITICALSECTIONLOCK_H #define MBED_CRITICALSECTIONLOCK_H -#include "platform/mbed_critical.h" #include "platform/mbed_toolchain.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_CriticalSectionLock CriticalSectionLock functions @@ -57,15 +57,9 @@ namespace mbed { */ class CriticalSectionLock { public: - CriticalSectionLock() - { - core_util_critical_section_enter(); - } + CriticalSectionLock(); - ~CriticalSectionLock() - { - core_util_critical_section_exit(); - } + ~CriticalSectionLock(); /** Mark the start of a critical section * @deprecated This function is inconsistent with RAII and is being removed in the future. Replaced by static function CriticalSectionLock::enable. @@ -74,10 +68,7 @@ public: MBED_DEPRECATED_SINCE("mbed-os-5.8", "This function is inconsistent with RAII and is being removed in the future." "Replaced by static function CriticalSectionLock::enable.") - void lock() - { - core_util_critical_section_enter(); - } + void lock(); /** Mark the end of a critical section * @deprecated This function is inconsistent with RAII and is being removed in the future. Replaced by static function CriticalSectionLock::enable. @@ -86,24 +77,15 @@ public: MBED_DEPRECATED_SINCE("mbed-os-5.8", "This function is inconsistent with RAII and is being removed in the future." "Replaced by static function CriticalSectionLock::disable.") - void unlock() - { - core_util_critical_section_exit(); - } + void unlock(); /** Mark the start of a critical section */ - static void enable() - { - core_util_critical_section_enter(); - } + static void enable(); /** Mark the end of a critical section */ - static void disable() - { - core_util_critical_section_exit(); - } + static void disable(); }; /**@}*/ diff --git a/platform/DeepSleepLock.h b/platform/DeepSleepLock.h index 1fe95db265..fb6cd418e0 100644 --- a/platform/DeepSleepLock.h +++ b/platform/DeepSleepLock.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,12 +18,12 @@ #define MBED_DEEPSLEEPLOCK_H #include -#include "platform/mbed_power_mgmt.h" -#include "platform/mbed_atomic.h" +#include namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_DeepSleepLock DeepSleepLock functions @@ -49,44 +49,17 @@ private: uint16_t _lock_count; public: - DeepSleepLock(): _lock_count(1) - { - sleep_manager_lock_deep_sleep(); - } + DeepSleepLock(); - ~DeepSleepLock() - { - if (_lock_count) { - sleep_manager_unlock_deep_sleep(); - } - } + ~DeepSleepLock(); /** Mark the start of a locked deep sleep section */ - void lock() - { - uint16_t count = core_util_atomic_incr_u16(&_lock_count, 1); - if (1 == count) { - sleep_manager_lock_deep_sleep(); - } - if (0 == count) { - MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_OVERFLOW), "DeepSleepLock overflow (> USHRT_MAX)", count); - } - } + void lock(); /** Mark the end of a locked deep sleep section */ - void unlock() - { - uint16_t count = core_util_atomic_decr_u16(&_lock_count, 1); - if (count == 0) { - sleep_manager_unlock_deep_sleep(); - } - if (count == USHRT_MAX) { - core_util_critical_section_exit(); - MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_UNDERFLOW), "DeepSleepLock underflow (< 0)", count); - } - } + void unlock(); }; /**@}*/ diff --git a/platform/DirHandle.h b/platform/DirHandle.h index 859d833428..7005e10aa7 100644 --- a/platform/DirHandle.h +++ b/platform/DirHandle.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,12 +18,12 @@ #define MBED_DIRHANDLE_H #include -#include "platform/platform.h" -#include "platform/FileHandle.h" +#include "platform/mbed_toolchain.h" #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_DirHandle DirHandle functions diff --git a/platform/FileBase.h b/platform/FileBase.h index 68b74ed968..d0244a0853 100644 --- a/platform/FileBase.h +++ b/platform/FileBase.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +31,8 @@ typedef enum { FileSystemPathType } PathType; -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_FileBase FileBase class @@ -72,4 +73,3 @@ private: } // namespace mbed #endif - diff --git a/platform/FileHandle.h b/platform/FileHandle.h index 5488169667..69144a8cca 100644 --- a/platform/FileHandle.h +++ b/platform/FileHandle.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,13 +20,14 @@ typedef int FILEHANDLE; #include -#include "Callback.h" +#include "platform/Callback.h" #include "platform/mbed_poll.h" #include "platform/platform.h" #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_FileHandle FileHandle functions diff --git a/platform/FileLike.h b/platform/FileLike.h index f4e1911f23..56e34456a2 100644 --- a/platform/FileLike.h +++ b/platform/FileLike.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,13 +17,13 @@ #ifndef MBED_FILELIKE_H #define MBED_FILELIKE_H -#include "platform/mbed_toolchain.h" #include "platform/FileBase.h" #include "platform/FileHandle.h" #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_FileLike FileLike class diff --git a/platform/FilePath.h b/platform/FilePath.h index 19f1c1b94a..f9a0ab0854 100644 --- a/platform/FilePath.h +++ b/platform/FilePath.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,8 @@ #include "platform/FileLike.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_FilePath FilePath class diff --git a/platform/FileSystemHandle.h b/platform/FileSystemHandle.h index d5bd217fc0..47b56ccf62 100644 --- a/platform/FileSystemHandle.h +++ b/platform/FileSystemHandle.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,13 +19,13 @@ #include "platform/platform.h" -#include "platform/FileBase.h" #include "platform/FileHandle.h" #include "platform/DirHandle.h" #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_FileSystemHandle FileSystemHandle functions diff --git a/platform/FileSystemLike.h b/platform/FileSystemLike.h index ce6df43881..9f604cf1b4 100644 --- a/platform/FileSystemLike.h +++ b/platform/FileSystemLike.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,13 +19,15 @@ #include "platform/platform.h" +#include "platform/FileBase.h" #include "platform/FileSystemHandle.h" #include "platform/FileHandle.h" #include "platform/DirHandle.h" #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_FileSystemLike FileSystemLike functions diff --git a/platform/FunctionPointer.h b/platform/FunctionPointer.h index 90a808015c..7129b671c9 100644 --- a/platform/FunctionPointer.h +++ b/platform/FunctionPointer.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2015 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,8 @@ #include namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_FunctionPointer FunctionPointer class diff --git a/platform/LocalFileSystem.h b/platform/LocalFileSystem.h index 7314320d44..5803e3dfe4 100644 --- a/platform/LocalFileSystem.h +++ b/platform/LocalFileSystem.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,7 +26,8 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_LocalFileSystem LocalFileSystem functions diff --git a/platform/NonCopyable.h b/platform/NonCopyable.h index 70f76e7177..7fe72841ac 100644 --- a/platform/NonCopyable.h +++ b/platform/NonCopyable.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017 ARM Limited +/* Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,13 +18,14 @@ #define MBED_NONCOPYABLE_H_ #if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0)) -#include "mbed_toolchain.h" -#include "mbed_debug.h" +#include "platform/mbed_toolchain.h" +#include "platform/mbed_debug.h" #endif namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_NonCopyable NonCopyable class diff --git a/platform/PlatformMutex.h b/platform/PlatformMutex.h index 3f751c4149..0f2116af0e 100644 --- a/platform/PlatformMutex.h +++ b/platform/PlatformMutex.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +19,9 @@ #include "platform/NonCopyable.h" -/** \addtogroup platform - * @{ - */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ +/** @{*/ /** \defgroup platform_PlatformMutex PlatformMutex class * @{ diff --git a/platform/ScopedLock.h b/platform/ScopedLock.h index d6d1854d9a..55176576fa 100644 --- a/platform/ScopedLock.h +++ b/platform/ScopedLock.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,8 @@ namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_ScopedLock ScopedLock functions diff --git a/platform/ScopedRamExecutionLock.h b/platform/ScopedRamExecutionLock.h index d45b3f9066..97f6a551b1 100644 --- a/platform/ScopedRamExecutionLock.h +++ b/platform/ScopedRamExecutionLock.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,8 @@ namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** RAII object for disabling, then restoring RAM execute never mode diff --git a/platform/ScopedRomWriteLock.h b/platform/ScopedRomWriteLock.h index 7cd6d5f355..08ed049287 100644 --- a/platform/ScopedRomWriteLock.h +++ b/platform/ScopedRomWriteLock.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,8 @@ namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** RAII object for disabling, then restoring ROM write never mode diff --git a/platform/SingletonPtr.h b/platform/SingletonPtr.h index ed3f8e33e1..524dbb6919 100644 --- a/platform/SingletonPtr.h +++ b/platform/SingletonPtr.h @@ -1,12 +1,13 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_SingletonPtr SingletonPtr class * @{ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/Span.h b/platform/Span.h index 9859402aa2..0f46eb6b04 100644 --- a/platform/Span.h +++ b/platform/Span.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018-2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,7 +26,8 @@ namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_Span Span class diff --git a/platform/Stream.h b/platform/Stream.h index e8783038f4..2db7f5aafe 100644 --- a/platform/Stream.h +++ b/platform/Stream.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,14 +19,14 @@ #include "platform/platform.h" #include "platform/FileLike.h" -#include "platform/FileHandle.h" #include "platform/NonCopyable.h" -#include "mbed_toolchain.h" +#include "platform/mbed_toolchain.h" #include #include namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_Stream Stream class diff --git a/platform/Transaction.h b/platform/Transaction.h index 6917c4d12b..7da3635d6f 100644 --- a/platform/Transaction.h +++ b/platform/Transaction.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2015 ARM Limited + * Copyright (c) 2015-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,10 +18,10 @@ #define MBED_TRANSACTION_H #include "platform/platform.h" -#include "platform/FunctionPointer.h" namespace mbed { -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_Transaction Transaction class diff --git a/platform/CThunkBase.h b/platform/internal/CThunkBase.h similarity index 93% rename from platform/CThunkBase.h rename to platform/internal/CThunkBase.h index c2ae68c28c..c338a3ba4d 100644 --- a/platform/CThunkBase.h +++ b/platform/internal/CThunkBase.h @@ -21,6 +21,13 @@ /* IRQ/Exception compatible thunk entry function */ typedef void (*CThunkEntry)(void); +/** \ingroup platform */ +/** \addtogroup platform-internal-api */ +/** @{*/ +/** + * \defgroup platform_CThunkBase CThunkBase class + * @{ + */ class CThunkBase { protected: typedef void (*Trampoline)(CThunkBase *); @@ -74,5 +81,8 @@ private: } }; -#endif/*__CTHUNK_BASE_H__*/ +/**@}*/ +/**@}*/ + +#endif/*__CTHUNK_BASE_H__*/ diff --git a/platform/CallChain.h b/platform/internal/CallChain.h similarity index 97% rename from platform/CallChain.h rename to platform/internal/CallChain.h index 0f35dc1b5e..d51f9b25b5 100644 --- a/platform/CallChain.h +++ b/platform/internal/CallChain.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +28,8 @@ namespace mbed { typedef Callback *pFunctionPointer_t; class CallChainLink; -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-internal-api Internal API */ /** @{*/ /** * \defgroup platform_CallChain CallChain class @@ -73,7 +74,9 @@ class CallChainLink; * } * @endcode */ -class CallChain : private NonCopyable { +class + MBED_DEPRECATED("CallChain has been deprecated and will be removed.") + CallChain : private NonCopyable { public: /** Create an empty chain * @deprecated @@ -262,4 +265,3 @@ private: } // namespace mbed #endif - diff --git a/platform/mbed_assert.h b/platform/mbed_assert.h index 7b2be2cfaa..3f9708ddef 100644 --- a/platform/mbed_assert.h +++ b/platform/mbed_assert.h @@ -1,12 +1,13 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_Assert Assert macros * @{ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,8 +25,7 @@ #ifndef MBED_ASSERT_H #define MBED_ASSERT_H -#include "mbed_preprocessor.h" -#include "mbed_toolchain.h" +#include "platform/mbed_toolchain.h" #ifdef __cplusplus extern "C" { diff --git a/platform/mbed_atomic.h b/platform/mbed_atomic.h index e10f6f5286..3ad2c87827 100644 --- a/platform/mbed_atomic.h +++ b/platform/mbed_atomic.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2015-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2015-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -24,9 +24,10 @@ #include #include #include -#include "mbed_toolchain.h" +#include "platform/mbed_toolchain.h" -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_critical.h b/platform/mbed_critical.h index b6e68f533c..af7eda387b 100644 --- a/platform/mbed_critical.h +++ b/platform/mbed_critical.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2015-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2015-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -25,7 +25,8 @@ extern "C" { #endif -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_critical critical section function @@ -96,6 +97,3 @@ bool core_util_in_critical_section(void); #endif #endif // __MBED_UTIL_CRITICAL_H__ - - - diff --git a/platform/mbed_debug.h b/platform/mbed_debug.h index f560f3db33..f19fc33b14 100644 --- a/platform/mbed_debug.h +++ b/platform/mbed_debug.h @@ -1,5 +1,6 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_debug Debug functions @@ -7,7 +8,7 @@ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +29,7 @@ #include #include #endif -#include "mbed_toolchain.h" +#include "platform/mbed_toolchain.h" #ifdef __cplusplus extern "C" { diff --git a/platform/mbed_error.h b/platform/mbed_error.h index 8ff8abc942..8724c3fde0 100644 --- a/platform/mbed_error.h +++ b/platform/mbed_error.h @@ -1,11 +1,12 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_error Error functions * @{ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mbed_interface.h b/platform/mbed_interface.h index ac12b60036..4eb0ab3f62 100644 --- a/platform/mbed_interface.h +++ b/platform/mbed_interface.h @@ -1,5 +1,6 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_interface Network interface and other utility functions @@ -7,7 +8,7 @@ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,7 +28,7 @@ #include -#include "mbed_toolchain.h" +#include "platform/mbed_toolchain.h" #include "device.h" /* Mbed interface mac address @@ -58,7 +59,7 @@ extern "C" { * * mbed Microcontrollers have a built-in interface to provide functionality such as * drag-n-drop download, reset, serial-over-usb, and access to the mbed local file - * system. These functions provide means to control the interface suing semihost + * system. These functions provide means to control the interface using semihost * calls it supports. */ diff --git a/platform/mbed_mem_trace.h b/platform/mbed_mem_trace.h index 28760b8607..e1156be0a9 100644 --- a/platform/mbed_mem_trace.h +++ b/platform/mbed_mem_trace.h @@ -1,9 +1,10 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /* mbed Microcontroller Library - * Copyright (c) 2006-2016 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mbed_mktime.h b/platform/mbed_mktime.h index 58b7624969..a1dc7e6aed 100644 --- a/platform/mbed_mktime.h +++ b/platform/mbed_mktime.h @@ -1,8 +1,9 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mbed_mpu_mgmt.h b/platform/mbed_mpu_mgmt.h index 8364941d79..b96adc303e 100644 --- a/platform/mbed_mpu_mgmt.h +++ b/platform/mbed_mpu_mgmt.h @@ -1,4 +1,5 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_mpu_mgmt MPU management functions @@ -6,7 +7,7 @@ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2018 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,9 +24,7 @@ #ifndef MBED_MPU_MGMT_H #define MBED_MPU_MGMT_H -#include "mbed_toolchain.h" #include "hal/mpu_api.h" -#include #ifdef __cplusplus extern "C" { diff --git a/platform/mbed_poll.h b/platform/mbed_poll.h index 43d7cce57c..6061943a2c 100644 --- a/platform/mbed_poll.h +++ b/platform/mbed_poll.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,7 +27,8 @@ namespace mbed { class FileHandle; -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_poll poll functions diff --git a/platform/mbed_power_mgmt.h b/platform/mbed_power_mgmt.h index 3b8791f2b1..75764b9581 100644 --- a/platform/mbed_power_mgmt.h +++ b/platform/mbed_power_mgmt.h @@ -1,4 +1,5 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_power_mgmt Power management functions @@ -6,7 +7,7 @@ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2018 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,8 +25,8 @@ #ifndef MBED_POWER_MGMT_H #define MBED_POWER_MGMT_H -#include "hal/sleep_api.h" -#include "mbed_toolchain.h" + +#include "platform/mbed_toolchain.h" #include "hal/ticker_api.h" #include diff --git a/platform/mbed_preprocessor.h b/platform/mbed_preprocessor.h index 42685cda1c..e01afb9fab 100644 --- a/platform/mbed_preprocessor.h +++ b/platform/mbed_preprocessor.h @@ -1,4 +1,5 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_preprocessor preprocessor macros @@ -6,7 +7,7 @@ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mbed_retarget.h b/platform/mbed_retarget.h index 5875d0474f..18fac7bcbe 100644 --- a/platform/mbed_retarget.h +++ b/platform/mbed_retarget.h @@ -1,6 +1,6 @@ /* * mbed Microcontroller Library - * Copyright (c) 2006-2016 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -79,7 +79,8 @@ typedef unsigned int gid_t; ///< Group ID #include -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_retarget Retarget functions diff --git a/platform/mbed_rtc_time.h b/platform/mbed_rtc_time.h index 14ead3339f..09e42c0a7e 100644 --- a/platform/mbed_rtc_time.h +++ b/platform/mbed_rtc_time.h @@ -1,12 +1,13 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_rtc_time rtc_time functions * @{ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mbed_semihost_api.h b/platform/mbed_semihost_api.h index dde34f8a53..977696f3ba 100644 --- a/platform/mbed_semihost_api.h +++ b/platform/mbed_semihost_api.h @@ -1,6 +1,6 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,7 +19,6 @@ #define MBED_SEMIHOST_H #include "device.h" -#include "platform/mbed_toolchain.h" #ifdef __cplusplus extern "C" { diff --git a/platform/mbed_stats.h b/platform/mbed_stats.h index 1f93f42d95..46ca8f5822 100644 --- a/platform/mbed_stats.h +++ b/platform/mbed_stats.h @@ -1,12 +1,13 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_stats stats functions * @{ */ /* mbed Microcontroller Library - * Copyright (c) 2016-2018 ARM Limited + * Copyright (c) 2016-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mbed_toolchain.h b/platform/mbed_toolchain.h index 12c18b3241..3d8292d1cf 100644 --- a/platform/mbed_toolchain.h +++ b/platform/mbed_toolchain.h @@ -1,5 +1,6 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_toolchain Toolchain functions @@ -7,7 +8,7 @@ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,7 +26,7 @@ #ifndef MBED_TOOLCHAIN_H #define MBED_TOOLCHAIN_H -#include "mbed_preprocessor.h" +#include "platform/mbed_preprocessor.h" // Warning for unsupported compilers diff --git a/platform/mbed_version.h b/platform/mbed_version.h index a178579369..61aedbd4d6 100644 --- a/platform/mbed_version.h +++ b/platform/mbed_version.h @@ -1,12 +1,13 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_version Version macros * @{ */ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mbed_wait_api.h b/platform/mbed_wait_api.h index f6e72266a8..bf1e752760 100644 --- a/platform/mbed_wait_api.h +++ b/platform/mbed_wait_api.h @@ -1,5 +1,6 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /** * \defgroup platform_wait_api wait_api functions @@ -7,7 +8,7 @@ */ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/ATCmdParser.cpp b/platform/source/ATCmdParser.cpp similarity index 99% rename from platform/ATCmdParser.cpp rename to platform/source/ATCmdParser.cpp index 7ff2ae00ac..7a54f55fba 100644 --- a/platform/ATCmdParser.cpp +++ b/platform/source/ATCmdParser.cpp @@ -402,4 +402,3 @@ bool ATCmdParser::process_oob() } } - diff --git a/platform/CThunkBase.cpp b/platform/source/CThunkBase.cpp similarity index 98% rename from platform/CThunkBase.cpp rename to platform/source/CThunkBase.cpp index ce9271bc53..ddae39c4bc 100644 --- a/platform/CThunkBase.cpp +++ b/platform/source/CThunkBase.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018-2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ #include "platform/mbed_error.h" -#include "CThunkBase.h" +#include "platform/internal/CThunkBase.h" MBED_STATIC_ASSERT(MBED_CONF_PLATFORM_CTHUNK_COUNT_MAX < 256, "MBED_CONF_PLATFORM_CTHUNK_COUNT_MAX must be less than 256"); MBED_STATIC_ASSERT(MBED_CONF_PLATFORM_CTHUNK_COUNT_MAX > 0, "MBED_CONF_PLATFORM_CTHUNK_COUNT_MAX must be greater than 0"); diff --git a/platform/CallChain.cpp b/platform/source/CallChain.cpp similarity index 97% rename from platform/CallChain.cpp rename to platform/source/CallChain.cpp index db8be12f7e..5c892d7820 100644 --- a/platform/CallChain.cpp +++ b/platform/source/CallChain.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,7 +21,7 @@ #undef MBED_DEPRECATED_SINCE #define MBED_DEPRECATED_SINCE(...) -#include "platform/CallChain.h" +#include "platform/internal/CallChain.h" #include "cmsis.h" #include "platform/mbed_critical.h" diff --git a/platform/source/CriticalSectionLock.cpp b/platform/source/CriticalSectionLock.cpp new file mode 100644 index 0000000000..61e775ce39 --- /dev/null +++ b/platform/source/CriticalSectionLock.cpp @@ -0,0 +1,53 @@ +/* mbed Microcontroller Library + * Copyright (c) 2017-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "platform/CriticalSectionLock.h" + +#include "platform/mbed_critical.h" + +namespace mbed { + +CriticalSectionLock::CriticalSectionLock() +{ + core_util_critical_section_enter(); +} + +CriticalSectionLock::~CriticalSectionLock() +{ + core_util_critical_section_exit(); +} + +void CriticalSectionLock::lock() +{ + core_util_critical_section_enter(); +} + +void CriticalSectionLock::unlock() +{ + core_util_critical_section_exit(); +} + +void CriticalSectionLock::enable() +{ + core_util_critical_section_enter(); +} + +void CriticalSectionLock::disable() +{ + core_util_critical_section_exit(); +} + +} // namespace mbed diff --git a/platform/source/DeepSleepLock.cpp b/platform/source/DeepSleepLock.cpp new file mode 100644 index 0000000000..fac9c6fe8b --- /dev/null +++ b/platform/source/DeepSleepLock.cpp @@ -0,0 +1,62 @@ +/* mbed Microcontroller Library + * Copyright (c) 2017-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "platform/DeepSleepLock.h" + +#include "platform/mbed_atomic.h" +#include "platform/mbed_critical.h" +#include "platform/mbed_error.h" +#include "platform/mbed_power_mgmt.h" + +namespace mbed { + +DeepSleepLock::DeepSleepLock(): _lock_count(1) +{ + sleep_manager_lock_deep_sleep(); +} + +DeepSleepLock::~DeepSleepLock() +{ + if (_lock_count) { + sleep_manager_unlock_deep_sleep(); + } +} + +void DeepSleepLock::lock() +{ + uint16_t count = core_util_atomic_incr_u16(&_lock_count, 1); + if (1 == count) { + sleep_manager_lock_deep_sleep(); + } + if (0 == count) { + MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_OVERFLOW), "DeepSleepLock overflow (> USHRT_MAX)", count); + } +} + +void DeepSleepLock::unlock() +{ + uint16_t count = core_util_atomic_decr_u16(&_lock_count, 1); + if (count == 0) { + sleep_manager_unlock_deep_sleep(); + } + if (count == USHRT_MAX) { + core_util_critical_section_exit(); + MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_UNDERFLOW), "DeepSleepLock underflow (< 0)", count); + } +} + +} // namespace mbed diff --git a/platform/FileBase.cpp b/platform/source/FileBase.cpp similarity index 99% rename from platform/FileBase.cpp rename to platform/source/FileBase.cpp index 7a6f0a32b7..cc0be5b62c 100644 --- a/platform/FileBase.cpp +++ b/platform/source/FileBase.cpp @@ -127,4 +127,3 @@ PathType FileBase::getPathType(void) } } // namespace mbed - diff --git a/platform/FileHandle.cpp b/platform/source/FileHandle.cpp similarity index 87% rename from platform/FileHandle.cpp rename to platform/source/FileHandle.cpp index be8b9cef45..8f10348929 100644 --- a/platform/FileHandle.cpp +++ b/platform/source/FileHandle.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2016 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,9 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "FileHandle.h" -#include "platform/mbed_retarget.h" -#include "platform/mbed_critical.h" +#include "platform/FileHandle.h" namespace mbed { diff --git a/platform/FilePath.cpp b/platform/source/FilePath.cpp similarity index 100% rename from platform/FilePath.cpp rename to platform/source/FilePath.cpp diff --git a/platform/FileSystemHandle.cpp b/platform/source/FileSystemHandle.cpp similarity index 93% rename from platform/FileSystemHandle.cpp rename to platform/source/FileSystemHandle.cpp index 24dc0b2acb..836c48f8ef 100644 --- a/platform/FileSystemHandle.cpp +++ b/platform/source/FileSystemHandle.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,8 +15,7 @@ * limitations under the License. */ -#include "FileSystemHandle.h" -#include +#include "platform/FileSystemHandle.h" namespace mbed { diff --git a/platform/LocalFileSystem.cpp b/platform/source/LocalFileSystem.cpp similarity index 100% rename from platform/LocalFileSystem.cpp rename to platform/source/LocalFileSystem.cpp diff --git a/platform/Stream.cpp b/platform/source/Stream.cpp similarity index 100% rename from platform/Stream.cpp rename to platform/source/Stream.cpp diff --git a/platform/mbed_alloc_wrappers.cpp b/platform/source/mbed_alloc_wrappers.cpp similarity index 100% rename from platform/mbed_alloc_wrappers.cpp rename to platform/source/mbed_alloc_wrappers.cpp diff --git a/platform/mbed_application.c b/platform/source/mbed_application.c similarity index 99% rename from platform/mbed_application.c rename to platform/source/mbed_application.c index 53eb08d7ef..5cd70c6c4d 100644 --- a/platform/mbed_application.c +++ b/platform/source/mbed_application.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2017 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mbed_assert.c b/platform/source/mbed_assert.c similarity index 92% rename from platform/mbed_assert.c rename to platform/source/mbed_assert.c index 0871bab9e9..d0e8f78b9e 100644 --- a/platform/mbed_assert.c +++ b/platform/source/mbed_assert.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,11 +18,9 @@ #include #include "platform/mbed_assert.h" -#include "platform/mbed_critical.h" #include "platform/mbed_error.h" MBED_NORETURN void mbed_assert_internal(const char *expr, const char *file, int line) { mbed_error(MBED_ERROR_ASSERTION_FAILED, expr, 0, file, line); } - diff --git a/platform/internal/mbed_atomic_impl.c b/platform/source/mbed_atomic_impl.c similarity index 100% rename from platform/internal/mbed_atomic_impl.c rename to platform/source/mbed_atomic_impl.c diff --git a/platform/mbed_board.c b/platform/source/mbed_board.c similarity index 100% rename from platform/mbed_board.c rename to platform/source/mbed_board.c diff --git a/platform/mbed_crash_data_offsets.h b/platform/source/mbed_crash_data_offsets.h similarity index 93% rename from platform/mbed_crash_data_offsets.h rename to platform/source/mbed_crash_data_offsets.h index 657682ce42..56a466866e 100644 --- a/platform/mbed_crash_data_offsets.h +++ b/platform/source/mbed_crash_data_offsets.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,14 @@ #ifndef MBED_CRASH_DATA_INFO_H #define MBED_CRASH_DATA_INFO_H -#include "platform/mbed_retarget.h" -#include "platform/mbed_toolchain.h" - #ifdef __cplusplus extern "C" { #endif #if MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED +/** \ingroup platform */ +/** \addtogroup platform-internal-api */ +/** @{*/ #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$RW_m_crash_data$$ZI$$Base[]; extern uint32_t Image$$RW_m_crash_data$$ZI$$Size; @@ -43,6 +43,7 @@ extern uint32_t __CRASH_DATA_RAM_END__[]; #define ERROR_CONTEXT_SIZE (0x80 / 4) //32 words(128 bytes) bytes for Error Context #define FAULT_CONTEXT_LOCATION (__CRASH_DATA_RAM_START__ + FAULT_CONTEXT_OFFSET) #define ERROR_CONTEXT_LOCATION (__CRASH_DATA_RAM_START__ + ERROR_CONTEXT_OFFSET) +/**@}*/ #endif #ifdef __cplusplus @@ -50,6 +51,3 @@ extern uint32_t __CRASH_DATA_RAM_END__[]; #endif #endif - - - diff --git a/platform/mbed_critical.c b/platform/source/mbed_critical.c similarity index 95% rename from platform/mbed_critical.c rename to platform/source/mbed_critical.c index 4fe7e6abff..8d2ded8699 100644 --- a/platform/mbed_critical.c +++ b/platform/source/mbed_critical.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2015-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -22,7 +22,6 @@ #include "cmsis.h" #include "platform/mbed_assert.h" #include "platform/mbed_critical.h" -#include "platform/mbed_toolchain.h" static uint32_t critical_section_reentrancy_counter = 0; diff --git a/platform/mbed_error.c b/platform/source/mbed_error.c similarity index 99% rename from platform/mbed_error.c rename to platform/source/mbed_error.c index b50b86b8ab..3ffc22f5b1 100644 --- a/platform/mbed_error.c +++ b/platform/source/mbed_error.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,12 +18,11 @@ #include #include #include "device.h" -#include "platform/mbed_crash_data_offsets.h" -#include "platform/mbed_retarget.h" +#include "platform/source/mbed_crash_data_offsets.h" #include "platform/mbed_atomic.h" #include "platform/mbed_critical.h" #include "platform/mbed_error.h" -#include "platform/mbed_error_hist.h" +#include "platform/source/mbed_error_hist.h" #include "platform/mbed_interface.h" #include "platform/mbed_power_mgmt.h" #include "platform/mbed_stats.h" @@ -635,4 +634,3 @@ exit: return ret; } #endif - diff --git a/platform/mbed_error_hist.c b/platform/source/mbed_error_hist.c similarity index 95% rename from platform/mbed_error_hist.c rename to platform/source/mbed_error_hist.c index 9a618e5dda..4a686885f7 100644 --- a/platform/mbed_error_hist.c +++ b/platform/source/mbed_error_hist.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,12 +18,10 @@ #include #include "device.h" #include "platform/mbed_error.h" -#include "platform/mbed_toolchain.h" #include "platform/mbed_critical.h" -#include "platform/mbed_interface.h" #if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED -#include "platform/mbed_error_hist.h" +#include "platform/source/mbed_error_hist.h" static mbed_error_ctx mbed_error_ctx_log[MBED_CONF_PLATFORM_ERROR_HIST_SIZE] = {0}; static int error_log_count = -1; diff --git a/platform/mbed_error_hist.h b/platform/source/mbed_error_hist.h similarity index 97% rename from platform/mbed_error_hist.h rename to platform/source/mbed_error_hist.h index 791b562b65..96378c7921 100644 --- a/platform/mbed_error_hist.h +++ b/platform/source/mbed_error_hist.h @@ -28,6 +28,11 @@ #ifdef __cplusplus extern "C" { #endif + +/** \ingroup platform */ +/** \addtogroup platform-internal-api */ +/** @{*/ + /* * Puts/Adds an error entry into the error history list * @@ -112,6 +117,6 @@ mbed_error_status_t mbed_save_error_hist(const char *path); } #endif +/**@}*/ + #endif - - diff --git a/platform/mbed_interface.c b/platform/source/mbed_interface.c similarity index 94% rename from platform/mbed_interface.c rename to platform/source/mbed_interface.c index ddacbb99ae..d275537c50 100644 --- a/platform/mbed_interface.c +++ b/platform/source/mbed_interface.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,11 +17,7 @@ #include #include "platform/mbed_interface.h" -#include "hal/gpio_api.h" -#include "platform/mbed_wait_api.h" #include "platform/mbed_semihost_api.h" -#include "platform/mbed_error.h" -#include "platform/mbed_toolchain.h" #if DEVICE_SEMIHOST diff --git a/platform/mbed_mem_trace.cpp b/platform/source/mbed_mem_trace.cpp similarity index 98% rename from platform/mbed_mem_trace.cpp rename to platform/source/mbed_mem_trace.cpp index 8ba4dd8095..75a61c4c9a 100644 --- a/platform/mbed_mem_trace.cpp +++ b/platform/source/mbed_mem_trace.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2016 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,7 +19,6 @@ #include #include #include "platform/mbed_mem_trace.h" -#include "platform/mbed_critical.h" #include "platform/SingletonPtr.h" #include "platform/PlatformMutex.h" @@ -152,4 +151,3 @@ void mbed_mem_trace_default_callback(uint8_t op, void *res, void *caller, ...) } va_end(va); } - diff --git a/platform/mbed_mktime.c b/platform/source/mbed_mktime.c similarity index 98% rename from platform/mbed_mktime.c rename to platform/source/mbed_mktime.c index 7c282325a4..9691fd23a0 100644 --- a/platform/mbed_mktime.c +++ b/platform/source/mbed_mktime.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +15,7 @@ * limitations under the License. */ -#include "mbed_mktime.h" +#include "platform/mbed_mktime.h" /* Time constants. */ #define SECONDS_BY_MINUTES 60 diff --git a/platform/mbed_mpu_mgmt.c b/platform/source/mbed_mpu_mgmt.c similarity index 96% rename from platform/mbed_mpu_mgmt.c rename to platform/source/mbed_mpu_mgmt.c index d34eb30aa5..ebdfb2d5fa 100644 --- a/platform/mbed_mpu_mgmt.c +++ b/platform/source/mbed_mpu_mgmt.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2018-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ #include "platform/mbed_mpu_mgmt.h" #include "platform/mbed_critical.h" #include "platform/mbed_assert.h" -#include "hal/mpu_api.h" #include +#include #if DEVICE_MPU && MBED_CONF_PLATFORM_USE_MPU diff --git a/platform/mbed_poll.cpp b/platform/source/mbed_poll.cpp similarity index 100% rename from platform/mbed_poll.cpp rename to platform/source/mbed_poll.cpp diff --git a/platform/mbed_sleep_manager.c b/platform/source/mbed_power_mgmt.c similarity index 96% rename from platform/mbed_sleep_manager.c rename to platform/source/mbed_power_mgmt.c index 01ce380a39..9d7724aea3 100644 --- a/platform/mbed_sleep_manager.c +++ b/platform/source/mbed_power_mgmt.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,14 +15,14 @@ * limitations under the License. */ -#include "mbed_power_mgmt.h" -#include "mbed_interface.h" -#include "mbed_atomic.h" -#include "mbed_critical.h" -#include "mbed_assert.h" -#include "mbed_error.h" -#include "mbed_stats.h" +#include "platform/mbed_power_mgmt.h" +#include "platform/mbed_interface.h" +#include "platform/mbed_atomic.h" +#include "platform/mbed_critical.h" +#include "platform/mbed_error.h" +#include "platform/mbed_stats.h" +#include "hal/sleep_api.h" #include "hal/us_ticker_api.h" #include "hal/lp_ticker_api.h" #include "platform/mbed_wait_api.h" diff --git a/platform/mbed_retarget.cpp b/platform/source/mbed_retarget.cpp similarity index 99% rename from platform/mbed_retarget.cpp rename to platform/source/mbed_retarget.cpp index fa4951bfbb..b55902a4e2 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/source/mbed_retarget.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2015 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,14 +26,12 @@ #include "platform/SingletonPtr.h" #include "platform/PlatformMutex.h" #include "platform/mbed_error.h" -#include "platform/mbed_stats.h" #include "platform/mbed_atomic.h" #include "platform/mbed_critical.h" #include "platform/mbed_poll.h" -#include "platform/PlatformMutex.h" #include "drivers/UARTSerial.h" -#include "us_ticker_api.h" -#include "lp_ticker_api.h" +#include "hal/us_ticker_api.h" +#include "hal/lp_ticker_api.h" #include #include #include diff --git a/platform/mbed_rtc_time.cpp b/platform/source/mbed_rtc_time.cpp similarity index 97% rename from platform/mbed_rtc_time.cpp rename to platform/source/mbed_rtc_time.cpp index b481ef908b..2465ae2bbc 100644 --- a/platform/mbed_rtc_time.cpp +++ b/platform/source/mbed_rtc_time.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,7 +16,6 @@ */ #include "hal/rtc_api.h" -#include "platform/mbed_critical.h" #include "platform/mbed_rtc_time.h" #include "platform/SingletonPtr.h" #include "platform/PlatformMutex.h" diff --git a/platform/mbed_sdk_boot.c b/platform/source/mbed_sdk_boot.c similarity index 100% rename from platform/mbed_sdk_boot.c rename to platform/source/mbed_sdk_boot.c diff --git a/platform/mbed_semihost_api.c b/platform/source/mbed_semihost_api.c similarity index 99% rename from platform/mbed_semihost_api.c rename to platform/source/mbed_semihost_api.c index c9975519fc..f88c1fbf51 100644 --- a/platform/mbed_semihost_api.c +++ b/platform/source/mbed_semihost_api.c @@ -181,4 +181,3 @@ int semihost_disabledebug(void) } #endif - diff --git a/platform/mbed_stats.c b/platform/source/mbed_stats.c similarity index 86% rename from platform/mbed_stats.c rename to platform/source/mbed_stats.c index e2d0a6bf00..f7d9ad101d 100644 --- a/platform/mbed_stats.c +++ b/platform/source/mbed_stats.c @@ -1,7 +1,23 @@ -#include "mbed_assert.h" -#include "mbed_stats.h" -#include "mbed_power_mgmt.h" -#include "mbed_version.h" +/* mbed Microcontroller Library + * Copyright (c) 2006-2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "platform/mbed_assert.h" +#include "platform/mbed_stats.h" +#include "platform/mbed_power_mgmt.h" +#include "platform/mbed_version.h" #include #include diff --git a/platform/mbed_wait_api_no_rtos.c b/platform/source/mbed_wait_api_no_rtos.c similarity index 100% rename from platform/mbed_wait_api_no_rtos.c rename to platform/source/mbed_wait_api_no_rtos.c diff --git a/platform/mbed_wait_api_rtos.cpp b/platform/source/mbed_wait_api_rtos.cpp similarity index 97% rename from platform/mbed_wait_api_rtos.cpp rename to platform/source/mbed_wait_api_rtos.cpp index da2c0f464e..163054753b 100644 --- a/platform/mbed_wait_api_rtos.cpp +++ b/platform/source/mbed_wait_api_rtos.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +28,6 @@ #include "platform/mbed_critical.h" #include "platform/mbed_power_mgmt.h" #include "platform/mbed_error.h" -#include "rtos/ThisThread.h" void wait(float s) { @@ -67,4 +66,3 @@ void wait_ms(int ms) } #endif // #if MBED_CONF_RTOS_PRESENT - diff --git a/platform/toolchain.h b/platform/toolchain.h index cf561fca75..6d23b3661d 100644 --- a/platform/toolchain.h +++ b/platform/toolchain.h @@ -1,8 +1,9 @@ -/** \addtogroup platform */ +/** \ingroup platform */ +/** \addtogroup platform-public-api */ /** @{*/ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); From 8013af2f1e000247df73227c051fcf6e2d548819 Mon Sep 17 00:00:00 2001 From: Evelyne Donnaes Date: Thu, 18 Jul 2019 12:38:51 +0100 Subject: [PATCH 03/10] Fixing include files due to latest rebase --- TESTS/mbed_hal/lp_ticker/main.cpp | 1 + TESTS/usb_device/hid/main.cpp | 1 + TESTS/usb_device/serial/main.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/TESTS/mbed_hal/lp_ticker/main.cpp b/TESTS/mbed_hal/lp_ticker/main.cpp index 1d56bda276..77fcd6644a 100644 --- a/TESTS/mbed_hal/lp_ticker/main.cpp +++ b/TESTS/mbed_hal/lp_ticker/main.cpp @@ -21,6 +21,7 @@ #include "lp_ticker_api_tests.h" #include "hal/lp_ticker_api.h" #include "hal/mbed_lp_ticker_wrapper.h" +#include "hal/us_ticker_api.h" #if !DEVICE_LPTICKER #error [NOT_SUPPORTED] Low power timer not supported for this target diff --git a/TESTS/usb_device/hid/main.cpp b/TESTS/usb_device/hid/main.cpp index e8816b99fa..5bb9c9e02d 100644 --- a/TESTS/usb_device/hid/main.cpp +++ b/TESTS/usb_device/hid/main.cpp @@ -27,6 +27,7 @@ #include "USBHID.h" #include "USBMouse.h" #include "USBKeyboard.h" +#include "hal/us_ticker_api.h" // Reuse the VID & PID from basic USB test. #define USB_HID_VID 0x0d28 diff --git a/TESTS/usb_device/serial/main.cpp b/TESTS/usb_device/serial/main.cpp index b84819bff9..ae4410becf 100644 --- a/TESTS/usb_device/serial/main.cpp +++ b/TESTS/usb_device/serial/main.cpp @@ -26,6 +26,7 @@ #include "usb_phy_api.h" #include "USBCDC.h" #include "USBSerial.h" +#include "hal/us_ticker_api.h" #define USB_CDC_VID 0x1f00 #define USB_CDC_PID 0x2013 From df5baf603184b53cd957c285f8a3546bc872a954 Mon Sep 17 00:00:00 2001 From: George Psimenos Date: Thu, 18 Jul 2019 16:55:26 +0100 Subject: [PATCH 04/10] USB public APIs cleanup (#11034) The contents of the usb directory were moved to appropriate locations and the usb directory removed. * Public USB headers moved under drivers/ * Internal USB headers moved under drivers/internal/ * USB Source code moved under drivers/source/usb/ * Moved usb/device/hal/ under hal/usb/ * Moved usb/device/USBPhy/ under hal/usb/ * Merged usb/device/targets/ into targets/ * Separated public and private USB API documentation under Doxygen groups drivers-public-api and drivers-internal-api. --- .travis.yml | 4 ++-- TESTS/usb_device/hid/main.cpp | 2 +- TESTS/usb_device/serial/main.cpp | 2 +- {usb/device/USBAudio => drivers}/USBAudio.h | 12 ++++++++++ {usb/device/USBSerial => drivers}/USBCDC.h | 11 +++++++++ .../USBCDC_ECM => drivers}/USBCDC_ECM.h | 13 +++++++++- {usb/device/USBHID => drivers}/USBHID.h | 10 ++++++++ {usb/device/USBHID => drivers}/USBKeyboard.h | 13 +++++++++- {usb/device/USBMIDI => drivers}/USBMIDI.h | 11 +++++++++ {usb/device/USBMSD => drivers}/USBMSD.h | 17 ++++++++++--- {usb/device/USBHID => drivers}/USBMouse.h | 11 +++++++++ .../USBHID => drivers}/USBMouseKeyboard.h | 13 +++++++++- {usb/device/USBSerial => drivers}/USBSerial.h | 11 +++++++++ .../utilities => drivers/internal}/AsyncOp.h | 10 ++++++++ .../internal}/ByteBuffer.h | 9 +++++++ .../internal}/EndpointResolver.h | 11 ++++++++- .../internal}/LinkEntry.h | 9 +++++++ .../internal}/LinkedList.h | 10 ++++++++ .../internal}/LinkedListBase.h | 10 ++++++++ .../internal}/MIDIMessage.h | 11 +++++++++ .../internal}/OperationList.h | 2 +- .../internal}/OperationListBase.h | 5 ++-- .../events => drivers/internal}/PolledQueue.h | 2 +- .../events => drivers/internal}/Task.h | 2 +- .../events => drivers/internal}/TaskBase.h | 0 .../events => drivers/internal}/TaskQueue.h | 4 ++-- .../internal}/USBAudio_Types.h | 0 .../internal}/USBDescriptor.h | 0 .../internal}/USBDevice.h | 24 +++++++++---------- .../internal}/USBDevice_Types.h | 0 .../internal}/USBHID_Types.h | 0 .../source/usb/device}/EndpointResolver.cpp | 0 .../source/usb/device}/USBAudio.cpp | 1 - .../source/usb/device}/USBCDC.cpp | 0 .../source/usb/device}/USBCDC_ECM.cpp | 0 .../source/usb/device}/USBDevice.cpp | 0 .../source/usb/device}/USBHID.cpp | 0 .../source/usb/device}/USBKeyboard.cpp | 0 .../source/usb/device}/USBMIDI.cpp | 0 .../source/usb/device}/USBMSD.cpp | 0 .../source/usb/device}/USBMouse.cpp | 0 .../source/usb/device}/USBMouseKeyboard.cpp | 0 .../source/usb/device}/USBSerial.cpp | 0 .../source/usb}/device/utilities/AsyncOp.cpp | 0 .../usb}/device/utilities/ByteBuffer.cpp | 1 - .../usb}/device/utilities/LinkedListBase.cpp | 0 .../device/utilities/OperationListBase.cpp | 0 .../device/utilities/events/PolledQueue.cpp | 2 +- .../usb}/device/utilities/events/TaskBase.cpp | 4 ++-- {usb/device/USBPhy => hal/usb}/USBPhy.h | 2 +- {usb/device/USBPhy => hal/usb}/USBPhyEvents.h | 0 {usb/device/USBPhy => hal/usb}/USBPhyTypes.h | 0 {usb/device/hal => hal/usb}/mbed_usb_phy.cpp | 0 {usb/device/hal => hal/usb}/usb_phy_api.h | 0 .../TARGET_Freescale/USBEndpoints_Kinetis.h | 0 .../TARGET_Freescale/USBPhyHw.h | 0 .../TARGET_Freescale/USBPhy_Kinetis.cpp | 0 .../TARGET_MCU_NRF52840/USBPhyHw.h | 0 .../TARGET_MCU_NRF52840/USBPhy_Nordic.cpp | 0 .../TARGET_NXP/USBEndpoints_LPC17_LPC23.h | 0 .../TARGET_NXP/USBHAL_LPC17.cpp | 0 .../targets => targets}/TARGET_NXP/USBPhyHw.h | 0 .../TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h | 0 .../TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h | 0 .../TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp | 0 .../TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h | 2 +- .../TARGET_STM/USBEndpoints_STM32.h | 0 .../targets => targets}/TARGET_STM/USBPhyHw.h | 0 .../TARGET_STM/USBPhy_STM32.cpp | 0 .../TARGET_Template/USBPhyHw.h | 0 .../TARGET_Template/USBPhy_template.cpp | 0 .../travis-ci/doxy-spellchecker/ignore.en.pws | 3 ++- usb/mbed_lib.json | 3 --- 73 files changed, 214 insertions(+), 43 deletions(-) rename {usb/device/USBAudio => drivers}/USBAudio.h (98%) rename {usb/device/USBSerial => drivers}/USBCDC.h (97%) rename {usb/device/USBCDC_ECM => drivers}/USBCDC_ECM.h (97%) rename {usb/device/USBHID => drivers}/USBHID.h (98%) rename {usb/device/USBHID => drivers}/USBKeyboard.h (96%) rename {usb/device/USBMIDI => drivers}/USBMIDI.h (97%) rename {usb/device/USBMSD => drivers}/USBMSD.h (96%) rename {usb/device/USBHID => drivers}/USBMouse.h (97%) rename {usb/device/USBHID => drivers}/USBMouseKeyboard.h (96%) rename {usb/device/USBSerial => drivers}/USBSerial.h (97%) rename {usb/device/utilities => drivers/internal}/AsyncOp.h (94%) rename {usb/device/utilities => drivers/internal}/ByteBuffer.h (94%) rename {usb/device/USBDevice => drivers/internal}/EndpointResolver.h (93%) rename {usb/device/utilities => drivers/internal}/LinkEntry.h (85%) rename {usb/device/utilities => drivers/internal}/LinkedList.h (91%) rename {usb/device/utilities => drivers/internal}/LinkedListBase.h (90%) rename {usb/device/USBMIDI => drivers/internal}/MIDIMessage.h (98%) rename {usb/device/utilities => drivers/internal}/OperationList.h (97%) rename {usb/device/utilities => drivers/internal}/OperationListBase.h (95%) rename {usb/device/utilities/events => drivers/internal}/PolledQueue.h (97%) rename {usb/device/utilities/events => drivers/internal}/Task.h (99%) rename {usb/device/utilities/events => drivers/internal}/TaskBase.h (100%) rename {usb/device/utilities/events => drivers/internal}/TaskQueue.h (97%) rename {usb/device/USBAudio => drivers/internal}/USBAudio_Types.h (100%) rename {usb/device/USBDevice => drivers/internal}/USBDescriptor.h (100%) rename {usb/device/USBDevice => drivers/internal}/USBDevice.h (98%) rename {usb/device/USBDevice => drivers/internal}/USBDevice_Types.h (100%) rename {usb/device/USBHID => drivers/internal}/USBHID_Types.h (100%) rename {usb/device/USBDevice => drivers/source/usb/device}/EndpointResolver.cpp (100%) rename {usb/device/USBAudio => drivers/source/usb/device}/USBAudio.cpp (99%) rename {usb/device/USBSerial => drivers/source/usb/device}/USBCDC.cpp (100%) rename {usb/device/USBCDC_ECM => drivers/source/usb/device}/USBCDC_ECM.cpp (100%) rename {usb/device/USBDevice => drivers/source/usb/device}/USBDevice.cpp (100%) rename {usb/device/USBHID => drivers/source/usb/device}/USBHID.cpp (100%) rename {usb/device/USBHID => drivers/source/usb/device}/USBKeyboard.cpp (100%) rename {usb/device/USBMIDI => drivers/source/usb/device}/USBMIDI.cpp (100%) rename {usb/device/USBMSD => drivers/source/usb/device}/USBMSD.cpp (100%) rename {usb/device/USBHID => drivers/source/usb/device}/USBMouse.cpp (100%) rename {usb/device/USBHID => drivers/source/usb/device}/USBMouseKeyboard.cpp (100%) rename {usb/device/USBSerial => drivers/source/usb/device}/USBSerial.cpp (100%) rename {usb => drivers/source/usb}/device/utilities/AsyncOp.cpp (100%) rename {usb => drivers/source/usb}/device/utilities/ByteBuffer.cpp (99%) rename {usb => drivers/source/usb}/device/utilities/LinkedListBase.cpp (100%) rename {usb => drivers/source/usb}/device/utilities/OperationListBase.cpp (100%) rename {usb => drivers/source/usb}/device/utilities/events/PolledQueue.cpp (98%) rename {usb => drivers/source/usb}/device/utilities/events/TaskBase.cpp (97%) rename {usb/device/USBPhy => hal/usb}/USBPhy.h (99%) rename {usb/device/USBPhy => hal/usb}/USBPhyEvents.h (100%) rename {usb/device/USBPhy => hal/usb}/USBPhyTypes.h (100%) rename {usb/device/hal => hal/usb}/mbed_usb_phy.cpp (100%) rename {usb/device/hal => hal/usb}/usb_phy_api.h (100%) rename {usb/device/targets => targets}/TARGET_Freescale/USBEndpoints_Kinetis.h (100%) rename {usb/device/targets => targets}/TARGET_Freescale/USBPhyHw.h (100%) rename {usb/device/targets => targets}/TARGET_Freescale/USBPhy_Kinetis.cpp (100%) rename {usb/device/targets/TARGET_NORDIC => targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52}/TARGET_MCU_NRF52840/USBPhyHw.h (100%) rename {usb/device/targets/TARGET_NORDIC => targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52}/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp (100%) rename {usb/device/targets => targets}/TARGET_NXP/USBEndpoints_LPC17_LPC23.h (100%) rename {usb/device/targets => targets}/TARGET_NXP/USBHAL_LPC17.cpp (100%) rename {usb/device/targets => targets}/TARGET_NXP/USBPhyHw.h (100%) rename {usb/device/targets => targets}/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h (100%) rename {usb/device/targets => targets}/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h (100%) rename {usb/device/targets => targets}/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp (100%) rename {usb/device/targets => targets}/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h (99%) rename {usb/device/targets => targets}/TARGET_STM/USBEndpoints_STM32.h (100%) rename {usb/device/targets => targets}/TARGET_STM/USBPhyHw.h (100%) rename {usb/device/targets => targets}/TARGET_STM/USBPhy_STM32.cpp (100%) rename {usb/device/targets => targets}/TARGET_Template/USBPhyHw.h (100%) rename {usb/device/targets => targets}/TARGET_Template/USBPhy_template.cpp (100%) delete mode 100644 usb/mbed_lib.json diff --git a/.travis.yml b/.travis.yml index 31b754d8cb..23c3ab8c63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2018 Arm Limited. All rights reserved. +# Copyright (c) 2013-2019 Arm Limited. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 # @@ -222,7 +222,7 @@ matrix: # Check that example compiles without rtos - sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' ${EVENTS}/README.md > main.cpp - | - rm -r rtos usb features/cellular features/netsocket features/nanostack \ + rm -r rtos drivers/source/usb features/cellular features/netsocket features/nanostack \ features/lwipstack features/frameworks/greentea-client \ features/frameworks/utest features/frameworks/unity components BUILD - python tools/make.py -t GCC_ARM -m DISCO_F401VC --source=. --build=BUILD/DISCO_F401VC/GCC_ARM -j0 diff --git a/TESTS/usb_device/hid/main.cpp b/TESTS/usb_device/hid/main.cpp index 5bb9c9e02d..a9c5db76b7 100644 --- a/TESTS/usb_device/hid/main.cpp +++ b/TESTS/usb_device/hid/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited, All Rights Reserved + * Copyright (c) 2018-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/TESTS/usb_device/serial/main.cpp b/TESTS/usb_device/serial/main.cpp index ae4410becf..11dc3acd8c 100644 --- a/TESTS/usb_device/serial/main.cpp +++ b/TESTS/usb_device/serial/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited, All Rights Reserved + * Copyright (c) 2018-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/usb/device/USBAudio/USBAudio.h b/drivers/USBAudio.h similarity index 98% rename from usb/device/USBAudio/USBAudio.h rename to drivers/USBAudio.h index 8e69519f07..846e47b241 100644 --- a/usb/device/USBAudio/USBAudio.h +++ b/drivers/USBAudio.h @@ -28,6 +28,15 @@ #include "ByteBuffer.h" #include "rtos/EventFlags.h" +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBAudio USBAudio class + * @{ + */ + + /** * USBAudio example * @@ -373,4 +382,7 @@ private: }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBSerial/USBCDC.h b/drivers/USBCDC.h similarity index 97% rename from usb/device/USBSerial/USBCDC.h rename to drivers/USBCDC.h index 7b57a8dd65..0c2044ed50 100644 --- a/usb/device/USBSerial/USBCDC.h +++ b/drivers/USBCDC.h @@ -27,6 +27,14 @@ class AsyncOp; +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBCDC USBCDC class + * @{ + */ + class USBCDC: public USBDevice { public: @@ -224,4 +232,7 @@ protected: uint32_t _rx_size; }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBCDC_ECM/USBCDC_ECM.h b/drivers/USBCDC_ECM.h similarity index 97% rename from usb/device/USBCDC_ECM/USBCDC_ECM.h rename to drivers/USBCDC_ECM.h index 323c4405f6..4502ef5d71 100644 --- a/usb/device/USBCDC_ECM/USBCDC_ECM.h +++ b/drivers/USBCDC_ECM.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Arm Limited and affiliates. + * Copyright (c) 2018-2019, Arm Limited and affiliates. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,6 +38,14 @@ #define PACKET_TYPE_BROADCAST (1<<3) #define PACKET_TYPE_MULTICAST (1<<4) +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBCDC_ECM USBCDC_ECM class + * @{ + */ + class USBCDC_ECM: public USBDevice { public: @@ -267,4 +275,7 @@ private: void _notify_connect(); }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBHID/USBHID.h b/drivers/USBHID.h similarity index 98% rename from usb/device/USBHID/USBHID.h rename to drivers/USBHID.h index 85380e4148..8723a64880 100644 --- a/usb/device/USBHID/USBHID.h +++ b/drivers/USBHID.h @@ -26,6 +26,13 @@ #include "OperationList.h" +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBHID USBHID class + * @{ + */ /** * USBHID example @@ -268,4 +275,7 @@ private: }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBHID/USBKeyboard.h b/drivers/USBKeyboard.h similarity index 96% rename from usb/device/USBHID/USBKeyboard.h rename to drivers/USBKeyboard.h index ca24255780..70777abe3c 100644 --- a/usb/device/USBHID/USBKeyboard.h +++ b/drivers/USBKeyboard.h @@ -74,6 +74,14 @@ enum FUNCTION_KEY { UP_ARROW, /* Up arrow */ }; +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBKeyboard USBKeyboard class + * @{ + */ + /** * USBKeyboard example * @code @@ -181,7 +189,7 @@ public: virtual void report_rx(); /** - * Read status of lock keys. Useful to switch-on/off leds according to key pressed. Only the first three bits of the result is important: + * Read status of lock keys. Useful to switch-on/off LEDs according to key pressed. Only the first three bits of the result is important: * - First bit: NUM_LOCK * - Second bit: CAPS_LOCK * - Third bit: SCROLL_LOCK @@ -209,4 +217,7 @@ private: }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBMIDI/USBMIDI.h b/drivers/USBMIDI.h similarity index 97% rename from usb/device/USBMIDI/USBMIDI.h rename to drivers/USBMIDI.h index 2e6e5659cc..e1872bb802 100644 --- a/usb/device/USBMIDI/USBMIDI.h +++ b/drivers/USBMIDI.h @@ -30,6 +30,14 @@ #define DEFAULT_CONFIGURATION (1) +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBMIDI USBMIDI class + * @{ + */ + /** * USBMIDI example * @@ -182,4 +190,7 @@ private: bool _next_message(); }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBMSD/USBMSD.h b/drivers/USBMSD.h similarity index 96% rename from usb/device/USBMSD/USBMSD.h rename to drivers/USBMSD.h index 2a22cc0c1f..ce5e3b7244 100644 --- a/usb/device/USBMSD/USBMSD.h +++ b/drivers/USBMSD.h @@ -22,19 +22,27 @@ #include "USBDescriptor.h" #include "USBDevice_Types.h" #include "platform/Callback.h" -#include "events/PolledQueue.h" -#include "events/Task.h" +#include "drivers/internal/PolledQueue.h" +#include "drivers/internal/Task.h" #include "BlockDevice.h" #include "Mutex.h" #include "USBDevice.h" +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBMSD USBMSD class + * @{ + */ + /** * USBMSD class: generic class in order to use all kinds of blocks storage chip * * Introduction * - * USBMSD implements the MSD protocol. It permits to access a block device (flash, sdcard,...) + * USBMSD implements the MSD protocol. It permits to access a block device (flash, SD Card,...) * from a computer over USB. * * @code @@ -304,4 +312,7 @@ private: void fail(); }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBHID/USBMouse.h b/drivers/USBMouse.h similarity index 97% rename from usb/device/USBHID/USBMouse.h rename to drivers/USBMouse.h index 0e4edcfe99..b4450025ef 100644 --- a/usb/device/USBHID/USBMouse.h +++ b/drivers/USBMouse.h @@ -49,6 +49,14 @@ enum MOUSE_TYPE { REL_MOUSE, }; +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBMouse USBMouse class + * @{ + */ + /** * * USBMouse example @@ -232,4 +240,7 @@ private: bool mouse_send(int8_t x, int8_t y, uint8_t buttons, int8_t z); }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBHID/USBMouseKeyboard.h b/drivers/USBMouseKeyboard.h similarity index 96% rename from usb/device/USBHID/USBMouseKeyboard.h rename to drivers/USBMouseKeyboard.h index 77d233331c..f54238724a 100644 --- a/usb/device/USBHID/USBMouseKeyboard.h +++ b/drivers/USBMouseKeyboard.h @@ -28,6 +28,14 @@ #include "USBHID.h" #include "PlatformMutex.h" +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBMouseKeyboard USBMouseKeyboard class + * @{ + */ + /** * USBMouseKeyboard example * @code @@ -207,7 +215,7 @@ public: bool media_control(MEDIA_KEY key); /** - * Read status of lock keys. Useful to switch-on/off leds according to key pressed. Only the first three bits of the result is important: + * Read status of lock keys. Useful to switch-on/off LEDs according to key pressed. Only the first three bits of the result is important: * - First bit: NUM_LOCK * - Second bit: CAPS_LOCK * - Third bit: SCROLL_LOCK @@ -243,4 +251,7 @@ private: virtual int _getc(); }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBSerial/USBSerial.h b/drivers/USBSerial.h similarity index 97% rename from usb/device/USBSerial/USBSerial.h rename to drivers/USBSerial.h index b0bf2f18d7..f7e0f38035 100644 --- a/usb/device/USBSerial/USBSerial.h +++ b/drivers/USBSerial.h @@ -22,6 +22,14 @@ #include "Stream.h" #include "Callback.h" +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ +/** + * \defgroup drivers_USBSerial USBSerial class + * @{ + */ + /** * USBSerial example * @@ -216,4 +224,7 @@ private: void (*_settings_changed_callback)(int baud, int bits, int parity, int stop); }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/utilities/AsyncOp.h b/drivers/internal/AsyncOp.h similarity index 94% rename from usb/device/utilities/AsyncOp.h rename to drivers/internal/AsyncOp.h index 625d6eddf1..a9a2f1d9be 100644 --- a/usb/device/utilities/AsyncOp.h +++ b/drivers/internal/AsyncOp.h @@ -25,6 +25,13 @@ #include "LinkEntry.h" #include "OperationListBase.h" +/** \ingroup drivers */ +/** \addtogroup drivers-internal-api */ +/** @{*/ +/** + * \defgroup drivers_AsyncOp AsyncOp class + * @{ + */ class AsyncOp: public LinkEntry { public: @@ -109,4 +116,7 @@ private: static void _host_unlock(rtos::Mutex *host_mutex); }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/utilities/ByteBuffer.h b/drivers/internal/ByteBuffer.h similarity index 94% rename from usb/device/utilities/ByteBuffer.h rename to drivers/internal/ByteBuffer.h index 9351450870..e39488767f 100644 --- a/usb/device/utilities/ByteBuffer.h +++ b/drivers/internal/ByteBuffer.h @@ -20,6 +20,13 @@ #include +/** \ingroup drivers */ +/** \addtogroup drivers-internal-api */ +/** @{*/ +/** + * \defgroup drivers_ByteBuffer ByteBuffer class + * @{ + */ class ByteBuffer { public: @@ -116,5 +123,7 @@ private: uint8_t *_buf; }; +/** @}*/ +/** @}*/ #endif diff --git a/usb/device/USBDevice/EndpointResolver.h b/drivers/internal/EndpointResolver.h similarity index 93% rename from usb/device/USBDevice/EndpointResolver.h rename to drivers/internal/EndpointResolver.h index 53e241f020..212b4f2355 100644 --- a/usb/device/USBDevice/EndpointResolver.h +++ b/drivers/internal/EndpointResolver.h @@ -29,7 +29,14 @@ * to check if the device has enough resources for the * given configuration. * - * @ingroup usb_device_core + */ + +/** \ingroup drivers */ +/** \addtogroup drivers-internal-api */ +/** @{*/ +/** + * \defgroup drivers_EndpointResolver EndpointResolver class + * @{ */ class EndpointResolver { public: @@ -89,5 +96,7 @@ private: bool _valid; }; +/** @}*/ +/** @}*/ #endif diff --git a/usb/device/utilities/LinkEntry.h b/drivers/internal/LinkEntry.h similarity index 85% rename from usb/device/utilities/LinkEntry.h rename to drivers/internal/LinkEntry.h index dadf07ddb6..6cbd8e1c30 100644 --- a/usb/device/utilities/LinkEntry.h +++ b/drivers/internal/LinkEntry.h @@ -20,6 +20,13 @@ #include +/** \ingroup drivers */ +/** \addtogroup drivers-internal-api */ +/** @{*/ +/** + * \defgroup drivers_LinkEntry LinkEntry class + * @{ + */ class LinkEntry { public: LinkEntry(): _next(NULL) @@ -32,5 +39,7 @@ private: LinkEntry *_next; }; +/** @}*/ +/** @}*/ #endif diff --git a/usb/device/utilities/LinkedList.h b/drivers/internal/LinkedList.h similarity index 91% rename from usb/device/utilities/LinkedList.h rename to drivers/internal/LinkedList.h index 03e7cff592..cc1f613133 100644 --- a/usb/device/utilities/LinkedList.h +++ b/drivers/internal/LinkedList.h @@ -21,6 +21,13 @@ #include "LinkEntry.h" #include "LinkedListBase.h" +/** \ingroup drivers */ +/** \addtogroup drivers-internal-api */ +/** @{*/ +/** + * \defgroup drivers_LinkedList LinkedList class + * @{ + */ template class LinkedList: public LinkedListBase { public: @@ -58,4 +65,7 @@ public: } }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/utilities/LinkedListBase.h b/drivers/internal/LinkedListBase.h similarity index 90% rename from usb/device/utilities/LinkedListBase.h rename to drivers/internal/LinkedListBase.h index 63dab981c9..ed7df8d1cb 100644 --- a/usb/device/utilities/LinkedListBase.h +++ b/drivers/internal/LinkedListBase.h @@ -20,6 +20,13 @@ #include "LinkEntry.h" +/** \ingroup drivers */ +/** \addtogroup drivers-internal-api */ +/** @{*/ +/** + * \defgroup drivers_LinkedListBase LinkedListBase class + * @{ + */ class LinkedListBase { public: LinkedListBase(); @@ -58,4 +65,7 @@ private: LinkEntry *_tail; }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBMIDI/MIDIMessage.h b/drivers/internal/MIDIMessage.h similarity index 98% rename from usb/device/USBMIDI/MIDIMessage.h rename to drivers/internal/MIDIMessage.h index 74e8d25bd6..5e9c502dde 100644 --- a/usb/device/USBMIDI/MIDIMessage.h +++ b/drivers/internal/MIDIMessage.h @@ -40,6 +40,14 @@ #define CABLE_NUM (0<<4) +/** \ingroup drivers */ +/** \addtogroup drivers-internal-api */ +/** @{*/ +/** + * \defgroup drivers_MIDIMessage MIDIMessage class + * @{ + */ + /** A MIDI message container */ class MIDIMessage { public: @@ -472,4 +480,7 @@ public: uint16_t length; }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/utilities/OperationList.h b/drivers/internal/OperationList.h similarity index 97% rename from usb/device/utilities/OperationList.h rename to drivers/internal/OperationList.h index 9f82c6b2ee..bbb543a9f2 100644 --- a/usb/device/utilities/OperationList.h +++ b/drivers/internal/OperationList.h @@ -75,7 +75,7 @@ public: * Additionally process() must be called on this object * if there are still elements in the list. * - * @return The async op at the head of the list + * @return The asynchronous op at the head of the list */ T *dequeue_raw() { diff --git a/usb/device/utilities/OperationListBase.h b/drivers/internal/OperationListBase.h similarity index 95% rename from usb/device/utilities/OperationListBase.h rename to drivers/internal/OperationListBase.h index 8c7bd6897c..0e973aa28a 100644 --- a/usb/device/utilities/OperationListBase.h +++ b/drivers/internal/OperationListBase.h @@ -18,8 +18,7 @@ #ifndef MBED_OPERATION_LIST_BASE_H #define MBED_OPERATION_LIST_BASE_H -#include "LinkedListBase.h" -#include "Mutex.h" +#include "drivers/internal/LinkedListBase.h" class AsyncOp; @@ -72,7 +71,7 @@ public: * Additionally process() must be called on this object * if there are still elements in the list. * - * @return The async op at the head of the list + * @return The asynchronous op at the head of the list */ AsyncOp *dequeue_raw(); diff --git a/usb/device/utilities/events/PolledQueue.h b/drivers/internal/PolledQueue.h similarity index 97% rename from usb/device/utilities/events/PolledQueue.h rename to drivers/internal/PolledQueue.h index a2bfc0ac78..47d049c638 100644 --- a/usb/device/utilities/events/PolledQueue.h +++ b/drivers/internal/PolledQueue.h @@ -18,7 +18,7 @@ #ifndef POLLED_QUEUE_H #define POLLED_QUEUE_H -#include "events/TaskQueue.h" +#include "drivers/internal/TaskQueue.h" #include "platform/Callback.h" #include "LinkedList.h" namespace events { diff --git a/usb/device/utilities/events/Task.h b/drivers/internal/Task.h similarity index 99% rename from usb/device/utilities/events/Task.h rename to drivers/internal/Task.h index b1e2a517fa..e484358253 100644 --- a/usb/device/utilities/events/Task.h +++ b/drivers/internal/Task.h @@ -19,7 +19,7 @@ #define MBED_TASK_H #include "events/EventQueue.h" -#include "events/TaskBase.h" +#include "drivers/internal/TaskBase.h" #include "platform/mbed_assert.h" #include "platform/Callback.h" diff --git a/usb/device/utilities/events/TaskBase.h b/drivers/internal/TaskBase.h similarity index 100% rename from usb/device/utilities/events/TaskBase.h rename to drivers/internal/TaskBase.h diff --git a/usb/device/utilities/events/TaskQueue.h b/drivers/internal/TaskQueue.h similarity index 97% rename from usb/device/utilities/events/TaskQueue.h rename to drivers/internal/TaskQueue.h index 8fae4e676b..cfdf488153 100644 --- a/usb/device/utilities/events/TaskQueue.h +++ b/drivers/internal/TaskQueue.h @@ -18,7 +18,7 @@ #ifndef TASK_QUEUE_H #define TASK_QUEUE_H -#include "events/TaskBase.h" +#include "drivers/internal/TaskBase.h" #include "platform/Callback.h" #include "mbed_critical.h" @@ -68,7 +68,7 @@ public: * * Cancels the given event so the event's memory can be reused. * - * The cancel function is irq safe. + * The cancel function is IRQ safe. * * If called while the event queue's dispatch loop is active, the cancel * function does not guarantee that the event will not execute after it diff --git a/usb/device/USBAudio/USBAudio_Types.h b/drivers/internal/USBAudio_Types.h similarity index 100% rename from usb/device/USBAudio/USBAudio_Types.h rename to drivers/internal/USBAudio_Types.h diff --git a/usb/device/USBDevice/USBDescriptor.h b/drivers/internal/USBDescriptor.h similarity index 100% rename from usb/device/USBDevice/USBDescriptor.h rename to drivers/internal/USBDescriptor.h diff --git a/usb/device/USBDevice/USBDevice.h b/drivers/internal/USBDevice.h similarity index 98% rename from usb/device/USBDevice/USBDevice.h rename to drivers/internal/USBDevice.h index 01e2514141..d0de70cdc8 100644 --- a/usb/device/USBDevice/USBDevice.h +++ b/drivers/internal/USBDevice.h @@ -23,23 +23,18 @@ #include "USBPhy.h" #include "mbed_critical.h" +/** \ingroup drivers */ +/** \addtogroup drivers-internal-api */ +/** @{*/ /** - * \defgroup usb_device USB Device - * - */ - -/** - * \defgroup usb_device_core Core - * - * @ingroup usb_device + * \defgroup drivers_USBDevice USBDevice class + * @{ */ /** * Core USB Device driver * * USB driver which wraps and provides synchronization for a USBPhy object. - * - * @ingroup usb_device_core */ class USBDevice: public USBPhyEvents { public: @@ -189,13 +184,13 @@ public: void endpoint_stall(usb_ep_t endpoint); /** - * Unstall an endpoint + * Un-stall an endpoint * - * Unstalling an endpoint resets data toggle back to DATA0. + * Un-stalling an endpoint resets data toggle back to DATA0. * Additionally, if there is an ongoing transfer on this endpoint * it will be aborted. * - * @param endpoint Endpoint to unstall + * @param endpoint Endpoint to un-stall * @note This endpoint must already have been setup with endpoint_add */ void endpoint_unstall(usb_ep_t endpoint); @@ -617,4 +612,7 @@ private: uint32_t _locked; }; +/** @}*/ +/** @}*/ + #endif diff --git a/usb/device/USBDevice/USBDevice_Types.h b/drivers/internal/USBDevice_Types.h similarity index 100% rename from usb/device/USBDevice/USBDevice_Types.h rename to drivers/internal/USBDevice_Types.h diff --git a/usb/device/USBHID/USBHID_Types.h b/drivers/internal/USBHID_Types.h similarity index 100% rename from usb/device/USBHID/USBHID_Types.h rename to drivers/internal/USBHID_Types.h diff --git a/usb/device/USBDevice/EndpointResolver.cpp b/drivers/source/usb/device/EndpointResolver.cpp similarity index 100% rename from usb/device/USBDevice/EndpointResolver.cpp rename to drivers/source/usb/device/EndpointResolver.cpp diff --git a/usb/device/USBAudio/USBAudio.cpp b/drivers/source/usb/device/USBAudio.cpp similarity index 99% rename from usb/device/USBAudio/USBAudio.cpp rename to drivers/source/usb/device/USBAudio.cpp index a72c3a4071..8409d84031 100644 --- a/usb/device/USBAudio/USBAudio.cpp +++ b/drivers/source/usb/device/USBAudio.cpp @@ -998,4 +998,3 @@ void USBAudio::_send_isr() _tx_done.call(Transfer); } } - diff --git a/usb/device/USBSerial/USBCDC.cpp b/drivers/source/usb/device/USBCDC.cpp similarity index 100% rename from usb/device/USBSerial/USBCDC.cpp rename to drivers/source/usb/device/USBCDC.cpp diff --git a/usb/device/USBCDC_ECM/USBCDC_ECM.cpp b/drivers/source/usb/device/USBCDC_ECM.cpp similarity index 100% rename from usb/device/USBCDC_ECM/USBCDC_ECM.cpp rename to drivers/source/usb/device/USBCDC_ECM.cpp diff --git a/usb/device/USBDevice/USBDevice.cpp b/drivers/source/usb/device/USBDevice.cpp similarity index 100% rename from usb/device/USBDevice/USBDevice.cpp rename to drivers/source/usb/device/USBDevice.cpp diff --git a/usb/device/USBHID/USBHID.cpp b/drivers/source/usb/device/USBHID.cpp similarity index 100% rename from usb/device/USBHID/USBHID.cpp rename to drivers/source/usb/device/USBHID.cpp diff --git a/usb/device/USBHID/USBKeyboard.cpp b/drivers/source/usb/device/USBKeyboard.cpp similarity index 100% rename from usb/device/USBHID/USBKeyboard.cpp rename to drivers/source/usb/device/USBKeyboard.cpp diff --git a/usb/device/USBMIDI/USBMIDI.cpp b/drivers/source/usb/device/USBMIDI.cpp similarity index 100% rename from usb/device/USBMIDI/USBMIDI.cpp rename to drivers/source/usb/device/USBMIDI.cpp diff --git a/usb/device/USBMSD/USBMSD.cpp b/drivers/source/usb/device/USBMSD.cpp similarity index 100% rename from usb/device/USBMSD/USBMSD.cpp rename to drivers/source/usb/device/USBMSD.cpp diff --git a/usb/device/USBHID/USBMouse.cpp b/drivers/source/usb/device/USBMouse.cpp similarity index 100% rename from usb/device/USBHID/USBMouse.cpp rename to drivers/source/usb/device/USBMouse.cpp diff --git a/usb/device/USBHID/USBMouseKeyboard.cpp b/drivers/source/usb/device/USBMouseKeyboard.cpp similarity index 100% rename from usb/device/USBHID/USBMouseKeyboard.cpp rename to drivers/source/usb/device/USBMouseKeyboard.cpp diff --git a/usb/device/USBSerial/USBSerial.cpp b/drivers/source/usb/device/USBSerial.cpp similarity index 100% rename from usb/device/USBSerial/USBSerial.cpp rename to drivers/source/usb/device/USBSerial.cpp diff --git a/usb/device/utilities/AsyncOp.cpp b/drivers/source/usb/device/utilities/AsyncOp.cpp similarity index 100% rename from usb/device/utilities/AsyncOp.cpp rename to drivers/source/usb/device/utilities/AsyncOp.cpp diff --git a/usb/device/utilities/ByteBuffer.cpp b/drivers/source/usb/device/utilities/ByteBuffer.cpp similarity index 99% rename from usb/device/utilities/ByteBuffer.cpp rename to drivers/source/usb/device/utilities/ByteBuffer.cpp index cfe59260f1..87ee3dbd3b 100644 --- a/usb/device/utilities/ByteBuffer.cpp +++ b/drivers/source/usb/device/utilities/ByteBuffer.cpp @@ -149,4 +149,3 @@ bool ByteBuffer::empty() { return _head == _tail; } - diff --git a/usb/device/utilities/LinkedListBase.cpp b/drivers/source/usb/device/utilities/LinkedListBase.cpp similarity index 100% rename from usb/device/utilities/LinkedListBase.cpp rename to drivers/source/usb/device/utilities/LinkedListBase.cpp diff --git a/usb/device/utilities/OperationListBase.cpp b/drivers/source/usb/device/utilities/OperationListBase.cpp similarity index 100% rename from usb/device/utilities/OperationListBase.cpp rename to drivers/source/usb/device/utilities/OperationListBase.cpp diff --git a/usb/device/utilities/events/PolledQueue.cpp b/drivers/source/usb/device/utilities/events/PolledQueue.cpp similarity index 98% rename from usb/device/utilities/events/PolledQueue.cpp rename to drivers/source/usb/device/utilities/events/PolledQueue.cpp index ec79cfb4f1..0f6e5e7f24 100644 --- a/usb/device/utilities/events/PolledQueue.cpp +++ b/drivers/source/usb/device/utilities/events/PolledQueue.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ -#include "events/PolledQueue.h" +#include "drivers/internal/PolledQueue.h" #include "events/mbed_events.h" #include "platform/Callback.h" diff --git a/usb/device/utilities/events/TaskBase.cpp b/drivers/source/usb/device/utilities/events/TaskBase.cpp similarity index 97% rename from usb/device/utilities/events/TaskBase.cpp rename to drivers/source/usb/device/utilities/events/TaskBase.cpp index ab52c2c69c..feabb7af45 100644 --- a/usb/device/utilities/events/TaskBase.cpp +++ b/drivers/source/usb/device/utilities/events/TaskBase.cpp @@ -15,8 +15,8 @@ * limitations under the License. */ -#include "events/TaskBase.h" -#include "events/TaskQueue.h" +#include "drivers/internal/TaskBase.h" +#include "drivers/internal/TaskQueue.h" #include "events/mbed_events.h" #include "rtos/Semaphore.h" #include "platform/mbed_critical.h" diff --git a/usb/device/USBPhy/USBPhy.h b/hal/usb/USBPhy.h similarity index 99% rename from usb/device/USBPhy/USBPhy.h rename to hal/usb/USBPhy.h index a1b5a9930d..c7c69bb9b6 100644 --- a/usb/device/USBPhy/USBPhy.h +++ b/hal/usb/USBPhy.h @@ -259,7 +259,7 @@ public: virtual void endpoint_stall(usb_ep_t endpoint) = 0; /** - * Unstall the endpoint + * Un-stall the endpoint * * Clear the HALT feature on this endpoint so communication can * resume. diff --git a/usb/device/USBPhy/USBPhyEvents.h b/hal/usb/USBPhyEvents.h similarity index 100% rename from usb/device/USBPhy/USBPhyEvents.h rename to hal/usb/USBPhyEvents.h diff --git a/usb/device/USBPhy/USBPhyTypes.h b/hal/usb/USBPhyTypes.h similarity index 100% rename from usb/device/USBPhy/USBPhyTypes.h rename to hal/usb/USBPhyTypes.h diff --git a/usb/device/hal/mbed_usb_phy.cpp b/hal/usb/mbed_usb_phy.cpp similarity index 100% rename from usb/device/hal/mbed_usb_phy.cpp rename to hal/usb/mbed_usb_phy.cpp diff --git a/usb/device/hal/usb_phy_api.h b/hal/usb/usb_phy_api.h similarity index 100% rename from usb/device/hal/usb_phy_api.h rename to hal/usb/usb_phy_api.h diff --git a/usb/device/targets/TARGET_Freescale/USBEndpoints_Kinetis.h b/targets/TARGET_Freescale/USBEndpoints_Kinetis.h similarity index 100% rename from usb/device/targets/TARGET_Freescale/USBEndpoints_Kinetis.h rename to targets/TARGET_Freescale/USBEndpoints_Kinetis.h diff --git a/usb/device/targets/TARGET_Freescale/USBPhyHw.h b/targets/TARGET_Freescale/USBPhyHw.h similarity index 100% rename from usb/device/targets/TARGET_Freescale/USBPhyHw.h rename to targets/TARGET_Freescale/USBPhyHw.h diff --git a/usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp b/targets/TARGET_Freescale/USBPhy_Kinetis.cpp similarity index 100% rename from usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp rename to targets/TARGET_Freescale/USBPhy_Kinetis.cpp diff --git a/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhyHw.h b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/USBPhyHw.h similarity index 100% rename from usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhyHw.h rename to targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/USBPhyHw.h diff --git a/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp similarity index 100% rename from usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp rename to targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp diff --git a/usb/device/targets/TARGET_NXP/USBEndpoints_LPC17_LPC23.h b/targets/TARGET_NXP/USBEndpoints_LPC17_LPC23.h similarity index 100% rename from usb/device/targets/TARGET_NXP/USBEndpoints_LPC17_LPC23.h rename to targets/TARGET_NXP/USBEndpoints_LPC17_LPC23.h diff --git a/usb/device/targets/TARGET_NXP/USBHAL_LPC17.cpp b/targets/TARGET_NXP/USBHAL_LPC17.cpp similarity index 100% rename from usb/device/targets/TARGET_NXP/USBHAL_LPC17.cpp rename to targets/TARGET_NXP/USBHAL_LPC17.cpp diff --git a/usb/device/targets/TARGET_NXP/USBPhyHw.h b/targets/TARGET_NXP/USBPhyHw.h similarity index 100% rename from usb/device/targets/TARGET_NXP/USBPhyHw.h rename to targets/TARGET_NXP/USBPhyHw.h diff --git a/usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h similarity index 100% rename from usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h rename to targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h diff --git a/usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h similarity index 100% rename from usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h rename to targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h diff --git a/usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp similarity index 100% rename from usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp rename to targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp diff --git a/usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h similarity index 99% rename from usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h rename to targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h index 5506260e58..f00f0847d8 100644 --- a/usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h @@ -498,7 +498,7 @@ /* Host L1 Control Register 1 */ /* HL1CTRL1 */ #define USB_L1STATUS (0x0006u) /* b2-1: L1 request completion state */ -#define USB_L1REQ (0x0001u) /* b0: L1 changes request bit +#define USB_L1REQ (0x0001u) /* b0: L1 changes request bit */ /* Host L1 Control Register 2 */ diff --git a/usb/device/targets/TARGET_STM/USBEndpoints_STM32.h b/targets/TARGET_STM/USBEndpoints_STM32.h similarity index 100% rename from usb/device/targets/TARGET_STM/USBEndpoints_STM32.h rename to targets/TARGET_STM/USBEndpoints_STM32.h diff --git a/usb/device/targets/TARGET_STM/USBPhyHw.h b/targets/TARGET_STM/USBPhyHw.h similarity index 100% rename from usb/device/targets/TARGET_STM/USBPhyHw.h rename to targets/TARGET_STM/USBPhyHw.h diff --git a/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp b/targets/TARGET_STM/USBPhy_STM32.cpp similarity index 100% rename from usb/device/targets/TARGET_STM/USBPhy_STM32.cpp rename to targets/TARGET_STM/USBPhy_STM32.cpp diff --git a/usb/device/targets/TARGET_Template/USBPhyHw.h b/targets/TARGET_Template/USBPhyHw.h similarity index 100% rename from usb/device/targets/TARGET_Template/USBPhyHw.h rename to targets/TARGET_Template/USBPhyHw.h diff --git a/usb/device/targets/TARGET_Template/USBPhy_template.cpp b/targets/TARGET_Template/USBPhy_template.cpp similarity index 100% rename from usb/device/targets/TARGET_Template/USBPhy_template.cpp rename to targets/TARGET_Template/USBPhy_template.cpp diff --git a/tools/test/travis-ci/doxy-spellchecker/ignore.en.pws b/tools/test/travis-ci/doxy-spellchecker/ignore.en.pws index b9058b661e..c4b9cefb6a 100644 --- a/tools/test/travis-ci/doxy-spellchecker/ignore.en.pws +++ b/tools/test/travis-ci/doxy-spellchecker/ignore.en.pws @@ -99,4 +99,5 @@ TCPSocket UDPSocket Socket unregister -_doxy_ \ No newline at end of file +deinit +_doxy_ diff --git a/usb/mbed_lib.json b/usb/mbed_lib.json deleted file mode 100644 index dc0cd0d8b6..0000000000 --- a/usb/mbed_lib.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "usb" -} From c6b0a1488b9a194ce5c85ca357e4fac0ac768e17 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Tue, 23 Jul 2019 15:43:19 +0100 Subject: [PATCH 05/10] Fix Ethernet driver build (#11096) Include the missing header file inclusion to find the added MBED_DEPRECATED macro. --- hal/ethernet_api.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hal/ethernet_api.h b/hal/ethernet_api.h index 442f1ea47e..46e89ea5f0 100644 --- a/hal/ethernet_api.h +++ b/hal/ethernet_api.h @@ -21,6 +21,7 @@ #define MBED_ETHERNET_API_H #include "device.h" +#include "platform/mbed_toolchain.h" #if DEVICE_ETHERNET From 20f81e19beb2cf6a7426e5d5f3e3b74856c0e7f4 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Wed, 24 Jul 2019 16:59:40 +0100 Subject: [PATCH 06/10] Change Doxygen groups structure, splitting first by Public/Internal (#11105) * Change Doxygen groups structure, splitting first by Public/Internal This commit also does the following: * groups the documentation of related API * moves `events/internal/equeue.h` to `events/equeue.h` * merges `events/source/README.md` to `events/README.md` --- UNITTESTS/target_h/drivers/LowPowerTicker.h | 1 - drivers/AnalogIn.h | 15 +- drivers/AnalogOut.h | 5 +- drivers/BusIn.h | 9 +- drivers/BusInOut.h | 5 +- drivers/BusOut.h | 5 +- drivers/CAN.h | 10 +- drivers/DigitalIn.h | 5 +- drivers/DigitalInOut.h | 5 +- drivers/DigitalOut.h | 5 +- drivers/Ethernet.h | 2 +- drivers/FlashIAP.h | 2 +- drivers/I2C.h | 9 +- drivers/I2CSlave.h | 7 +- drivers/InterruptIn.h | 9 +- drivers/InterruptManager.h | 5 +- drivers/LowPowerTicker.h | 9 +- drivers/LowPowerTimeout.h | 7 +- drivers/LowPowerTimer.h | 7 +- drivers/MbedCRC.h | 2 +- drivers/PortIn.h | 5 +- drivers/PortInOut.h | 5 +- drivers/PortOut.h | 6 +- drivers/PwmOut.h | 5 +- drivers/QSPI.h | 8 +- drivers/RawSerial.h | 9 +- drivers/ResetReason.h | 2 +- drivers/SPI.h | 7 +- drivers/SPISlave.h | 5 +- drivers/Serial.h | 5 +- drivers/SerialBase.h | 6 +- drivers/SerialWireOutput.h | 5 +- drivers/Ticker.h | 7 +- drivers/Timeout.h | 7 +- drivers/Timer.h | 7 +- drivers/TimerEvent.h | 7 +- drivers/UARTSerial.h | 6 +- drivers/USBAudio.h | 9 +- drivers/USBCDC.h | 5 +- drivers/USBCDC_ECM.h | 5 +- drivers/USBHID.h | 6 +- drivers/USBKeyboard.h | 5 +- drivers/USBMIDI.h | 5 +- drivers/USBMSD.h | 5 +- drivers/USBMouse.h | 5 +- drivers/USBMouseKeyboard.h | 5 +- drivers/USBSerial.h | 5 +- drivers/Watchdog.h | 2 +- drivers/internal/AsyncOp.h | 11 +- drivers/internal/ByteBuffer.h | 5 +- drivers/internal/EndpointResolver.h | 15 +- drivers/internal/LinkEntry.h | 5 +- drivers/internal/LinkedList.h | 9 +- drivers/internal/LinkedListBase.h | 5 +- drivers/internal/MIDIMessage.h | 6 +- drivers/internal/PolledQueue.h | 15 +- drivers/internal/TableCRC.h | 7 +- drivers/internal/Task.h | 7 +- drivers/internal/TaskBase.h | 10 +- drivers/internal/TaskQueue.h | 9 +- events/Event.h | 8 +- events/EventQueue.h | 9 +- events/README.md | 211 ++++++++++++++++++++ events/{internal => }/equeue.h | 7 +- events/internal/equeue_platform.h | 8 +- events/mbed_events.h | 15 +- events/mbed_shared_queues.h | 2 +- events/source/README.md | 209 ------------------- events/source/equeue.c | 2 +- events/source/tests/prof.c | 2 +- events/source/tests/tests.c | 2 +- platform/ATCmdParser.h | 4 +- platform/CThunk.h | 2 +- platform/Callback.h | 2 +- platform/CircularBuffer.h | 2 +- platform/CriticalSectionLock.h | 2 +- platform/DeepSleepLock.h | 2 +- platform/DirHandle.h | 2 +- platform/FileBase.h | 11 +- platform/FileHandle.h | 8 +- platform/FileLike.h | 7 +- platform/FilePath.h | 11 +- platform/FileSystemHandle.h | 6 +- platform/FileSystemLike.h | 6 +- platform/FunctionPointer.h | 2 +- platform/LocalFileSystem.h | 2 +- platform/NonCopyable.h | 2 +- platform/PlatformMutex.h | 2 +- platform/ScopedLock.h | 2 +- platform/ScopedRamExecutionLock.h | 2 +- platform/ScopedRomWriteLock.h | 2 +- platform/SingletonPtr.h | 2 +- platform/Span.h | 2 +- platform/Stream.h | 2 +- platform/Transaction.h | 2 +- platform/internal/CThunkBase.h | 2 +- platform/internal/CallChain.h | 4 +- platform/mbed_assert.h | 2 +- platform/mbed_atomic.h | 2 +- platform/mbed_critical.h | 2 +- platform/mbed_debug.h | 2 +- platform/mbed_error.h | 2 +- platform/mbed_interface.h | 2 +- platform/mbed_mem_trace.h | 2 +- platform/mbed_mktime.h | 2 +- platform/mbed_mpu_mgmt.h | 2 +- platform/mbed_poll.h | 2 +- platform/mbed_power_mgmt.h | 2 +- platform/mbed_preprocessor.h | 2 +- platform/mbed_retarget.h | 2 +- platform/mbed_rtc_time.h | 2 +- platform/mbed_stats.h | 2 +- platform/mbed_toolchain.h | 2 +- platform/mbed_version.h | 2 +- platform/mbed_wait_api.h | 2 +- platform/platform.h | 4 - platform/source/mbed_crash_data_offsets.h | 2 +- platform/source/mbed_error_hist.h | 2 +- platform/toolchain.h | 2 +- rtos/ConditionVariable.h | 4 +- rtos/EventFlags.h | 2 +- rtos/Kernel.h | 2 +- rtos/Mail.h | 2 +- rtos/MemoryPool.h | 2 +- rtos/Mutex.h | 2 +- rtos/Queue.h | 2 +- rtos/RtosTimer.h | 2 +- rtos/Semaphore.h | 2 +- rtos/TARGET_CORTEX/mbed_boot.h | 4 +- rtos/TARGET_CORTEX/mbed_rtx_storage.h | 4 +- rtos/ThisThread.h | 2 +- rtos/Thread.h | 2 +- rtos/rtos.h | 8 +- rtos/source/rtos_handlers.h | 4 +- rtos/source/rtos_idle.h | 4 +- 135 files changed, 477 insertions(+), 572 deletions(-) rename events/{internal => }/equeue.h (98%) delete mode 100644 events/source/README.md diff --git a/UNITTESTS/target_h/drivers/LowPowerTicker.h b/UNITTESTS/target_h/drivers/LowPowerTicker.h index 793ee0eab7..1d0bb6b5da 100644 --- a/UNITTESTS/target_h/drivers/LowPowerTicker.h +++ b/UNITTESTS/target_h/drivers/LowPowerTicker.h @@ -21,7 +21,6 @@ #include "Callback.h" namespace mbed { -/** \addtogroup drivers */ /** mock Low Power Ticker * diff --git a/drivers/AnalogIn.h b/drivers/AnalogIn.h index 172a2e5cfd..60637146a5 100644 --- a/drivers/AnalogIn.h +++ b/drivers/AnalogIn.h @@ -26,11 +26,19 @@ #include "platform/PlatformMutex.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api Public API */ -/** @{*/ +/** \defgroup mbed-os-public Public API */ + +/** \addtogroup drivers-public-api Drivers + * \ingroup mbed-os-public + */ + +/** \defgroup drivers-public-api-gpio GPIO + * \ingroup drivers-public-api + */ + /** * \defgroup drivers_AnalogIn AnalogIn class + * \ingroup drivers-public-api-gpio * @{ */ @@ -120,7 +128,6 @@ protected: }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/AnalogOut.h b/drivers/AnalogOut.h index 7b0e5d70f7..fee78fd940 100644 --- a/drivers/AnalogOut.h +++ b/drivers/AnalogOut.h @@ -25,11 +25,11 @@ #include "platform/PlatformMutex.h" namespace mbed { -/** \ingroup drivers */ /** \addtogroup drivers-public-api */ -/** @{*/ + /** * \defgroup drivers_AnalogOut AnalogOut class + * \ingroup drivers-public-api-gpio * @{ */ @@ -147,7 +147,6 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/BusIn.h b/drivers/BusIn.h index 85d9c9256d..0e7d7f4875 100644 --- a/drivers/BusIn.h +++ b/drivers/BusIn.h @@ -23,11 +23,13 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ +/** \defgroup drivers-public-api-bus Bus + * \ingroup drivers-public-api + */ + /** * \defgroup drivers_BusIn BusIn class + * \ingroup drivers-public-api-bus * @{ */ @@ -130,7 +132,6 @@ private: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/BusInOut.h b/drivers/BusInOut.h index d2470874e2..e42a9a52ad 100644 --- a/drivers/BusInOut.h +++ b/drivers/BusInOut.h @@ -22,11 +22,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_BusInOut BusInOut class + * \ingroup drivers-public-api-bus * @{ */ @@ -152,7 +150,6 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/BusOut.h b/drivers/BusOut.h index cbd58ed198..459a6d7813 100644 --- a/drivers/BusOut.h +++ b/drivers/BusOut.h @@ -22,11 +22,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_BusOut BusOut class + * \ingroup drivers-public-api-bus * @{ */ @@ -130,7 +128,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/CAN.h b/drivers/CAN.h index 2de35c8ffd..0485cf32a0 100644 --- a/drivers/CAN.h +++ b/drivers/CAN.h @@ -27,11 +27,13 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ +/** \defgroup drivers-public-api-can CAN + * \ingroup drivers-public-api + */ + /** * \defgroup drivers_CANMessage CANMessage class + * \ingroup drivers-public-api-can * @{ */ @@ -107,6 +109,7 @@ public: /** * \defgroup drivers_CAN CAN class + * \ingroup drivers-public-api-can * @{ */ @@ -333,7 +336,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/DigitalIn.h b/drivers/DigitalIn.h index ae2bf52df4..a6adf0bc9c 100644 --- a/drivers/DigitalIn.h +++ b/drivers/DigitalIn.h @@ -22,11 +22,9 @@ #include "hal/gpio_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_DigitalIn DigitalIn class + * \ingroup drivers-public-api-gpio * @{ */ @@ -127,7 +125,6 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/DigitalInOut.h b/drivers/DigitalInOut.h index ccae13e997..26fafcac51 100644 --- a/drivers/DigitalInOut.h +++ b/drivers/DigitalInOut.h @@ -22,11 +22,9 @@ #include "hal/gpio_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_DigitalInOut DigitalInOut class + * \ingroup drivers-public-api-gpio * @{ */ @@ -154,7 +152,6 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/DigitalOut.h b/drivers/DigitalOut.h index 87387d98d8..c7896ac476 100644 --- a/drivers/DigitalOut.h +++ b/drivers/DigitalOut.h @@ -21,11 +21,9 @@ #include "hal/gpio_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_DigitalOut DigitalOut class + * \ingroup drivers-public-api-gpio * @{ */ @@ -148,7 +146,6 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/Ethernet.h b/drivers/Ethernet.h index f070bd524a..ff8cbd2cc2 100644 --- a/drivers/Ethernet.h +++ b/drivers/Ethernet.h @@ -23,7 +23,7 @@ #if DEVICE_ETHERNET || defined(DOXYGEN_ONLY) namespace mbed { -/** \ingroup drivers */ +/** \ingroup mbed-os-public */ /** \addtogroup drivers-public-api */ /** @{*/ /** diff --git a/drivers/FlashIAP.h b/drivers/FlashIAP.h index f0397eb68c..fdcda768f0 100644 --- a/drivers/FlashIAP.h +++ b/drivers/FlashIAP.h @@ -49,7 +49,7 @@ extern uint32_t Load$$LR$$LR_IROM1$$Limit[]; namespace mbed { -/** \ingroup drivers */ +/** \ingroup mbed-os-public */ /** \addtogroup drivers-public-api */ /** @{*/ /** diff --git a/drivers/I2C.h b/drivers/I2C.h index ffcbe1ae27..4fb06a3d26 100644 --- a/drivers/I2C.h +++ b/drivers/I2C.h @@ -34,11 +34,13 @@ #endif namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ +/** \defgroup drivers-public-api-i2c I2C + * \ingroup drivers-public-api + */ + /** * \defgroup drivers_I2C I2C class + * \ingroup drivers-public-api-i2c * @{ */ @@ -247,7 +249,6 @@ private: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/I2CSlave.h b/drivers/I2CSlave.h index f2075d1d60..e2d123a991 100644 --- a/drivers/I2CSlave.h +++ b/drivers/I2CSlave.h @@ -24,11 +24,9 @@ #include "hal/i2c_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** - * \defgroup drivers_I2CSlave I2CSlave class + * \addtogroup drivers_I2CSlave I2CSlave class + * \ingroup drivers-public-api-i2c * @{ */ @@ -165,7 +163,6 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/InterruptIn.h b/drivers/InterruptIn.h index 3c6cf092d2..7537ce96e8 100644 --- a/drivers/InterruptIn.h +++ b/drivers/InterruptIn.h @@ -29,11 +29,13 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ +/** \defgroup drivers-public-api-interrupt Interrupt + * \ingroup drivers-public-api + */ + /** * \defgroup drivers_InterruptIn InterruptIn class + * \ingroup drivers-public-api-interrupt * @{ */ @@ -180,7 +182,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/InterruptManager.h b/drivers/InterruptManager.h index 2ed04be8ae..08487875a5 100644 --- a/drivers/InterruptManager.h +++ b/drivers/InterruptManager.h @@ -24,11 +24,9 @@ #include namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_InterruptManager InterruptManager class + * \ingroup drivers-public-api-interrupt * @{ */ @@ -209,7 +207,6 @@ private: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/LowPowerTicker.h b/drivers/LowPowerTicker.h index 1c616a457b..9a2a93cdf4 100644 --- a/drivers/LowPowerTicker.h +++ b/drivers/LowPowerTicker.h @@ -26,11 +26,13 @@ #include "hal/lp_ticker_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ +/** \defgroup drivers-public-api-ticker Ticker + * \ingroup drivers-public-api + */ + /** * \defgroup drivers_LowPowerTicker LowPowerTicker class + * \ingroup drivers-public-api-ticker * @{ */ @@ -50,7 +52,6 @@ public: } }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/LowPowerTimeout.h b/drivers/LowPowerTimeout.h index e678809c0f..08137329fa 100644 --- a/drivers/LowPowerTimeout.h +++ b/drivers/LowPowerTimeout.h @@ -26,11 +26,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** - * \defgroup drivers_LowPowerTimeout LowPowerTimeout class + * \addtogroup drivers_LowPowerTimeout LowPowerTimeout class + * \ingroup drivers-public-api-ticker * @{ */ @@ -48,7 +46,6 @@ private: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/LowPowerTimer.h b/drivers/LowPowerTimer.h index 250fea5e40..df886c7564 100644 --- a/drivers/LowPowerTimer.h +++ b/drivers/LowPowerTimer.h @@ -26,11 +26,9 @@ #include "hal/lp_ticker_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** - * \defgroup drivers_LowPowerTimer LowPowerTimer class + * \addtogroup drivers_LowPowerTimer LowPowerTimer class + * \ingroup drivers-public-api-ticker * @{ */ @@ -47,7 +45,6 @@ public: }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/MbedCRC.h b/drivers/MbedCRC.h index 1d666da445..18ac97abc4 100644 --- a/drivers/MbedCRC.h +++ b/drivers/MbedCRC.h @@ -40,7 +40,7 @@ but we check for ( width < 8) before performing shift, so it should not be an is #endif namespace mbed { -/** \ingroup drivers */ +/** \ingroup mbed-os-public */ /** \addtogroup drivers-public-api */ /** @{*/ /** diff --git a/drivers/PortIn.h b/drivers/PortIn.h index bf77d70e3f..9525828287 100644 --- a/drivers/PortIn.h +++ b/drivers/PortIn.h @@ -24,11 +24,9 @@ #include "hal/port_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_PortIn PortIn class + * \ingroup drivers-public-api-gpio * @{ */ @@ -94,7 +92,6 @@ private: port_t _port; }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/PortInOut.h b/drivers/PortInOut.h index 839d26651b..46a036b940 100644 --- a/drivers/PortInOut.h +++ b/drivers/PortInOut.h @@ -24,11 +24,9 @@ #include "hal/port_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_PortInOut PortInOut class + * \ingroup drivers-public-api-gpio * @{ */ @@ -109,7 +107,6 @@ private: port_t _port; }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/PortOut.h b/drivers/PortOut.h index 3b3c3ec6a0..aa5b00722d 100644 --- a/drivers/PortOut.h +++ b/drivers/PortOut.h @@ -24,13 +24,12 @@ #include "hal/port_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_PortOut PortOut class + * \ingroup drivers-public-api-gpio * @{ */ + /** A multiple pin digital output * * @note Synchronization level: Interrupt safe @@ -115,7 +114,6 @@ private: port_t _port; }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/PwmOut.h b/drivers/PwmOut.h index d151629774..68102caaa5 100644 --- a/drivers/PwmOut.h +++ b/drivers/PwmOut.h @@ -23,11 +23,9 @@ #include "hal/pwmout_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_PwmOut PwmOut class + * \ingroup drivers-public-api-gpio * @{ */ @@ -162,7 +160,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/QSPI.h b/drivers/QSPI.h index 1084e0eec9..4ab356a009 100644 --- a/drivers/QSPI.h +++ b/drivers/QSPI.h @@ -29,12 +29,13 @@ #define ONE_MHZ 1000000 namespace mbed { +/** \defgroup drivers-public-api-spi SPI + * \ingroup drivers-public-api + */ -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_QSPI QSPI class + * \ingroup drivers-public-api-spi * @{ */ @@ -230,7 +231,6 @@ private: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/RawSerial.h b/drivers/RawSerial.h index ae1786f357..41b0522b27 100644 --- a/drivers/RawSerial.h +++ b/drivers/RawSerial.h @@ -27,11 +27,13 @@ #include namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ +/** \defgroup drivers-public-api-uart UART + * \ingroup drivers-public-api + */ + /** * \defgroup drivers_RawSerial RawSerial class + * \ingroup drivers-public-api-uart * @{ */ @@ -109,7 +111,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/ResetReason.h b/drivers/ResetReason.h index a04ae7c006..289b4b9808 100644 --- a/drivers/ResetReason.h +++ b/drivers/ResetReason.h @@ -22,7 +22,7 @@ #include "reset_reason_api.h" namespace mbed { -/** \ingroup drivers */ +/** \ingroup mbed-os-public */ /** \addtogroup drivers-public-api */ /** @{*/ /** diff --git a/drivers/SPI.h b/drivers/SPI.h index 41075a913c..eaaabceeef 100644 --- a/drivers/SPI.h +++ b/drivers/SPI.h @@ -45,11 +45,9 @@ #endif namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** - * \defgroup drivers_SPI SPI class + * \addtogroup drivers_SPI SPI class + * \ingroup drivers-public-api-spi * @{ */ @@ -430,7 +428,6 @@ private: #endif //!defined(DOXYGEN_ONLY) }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/SPISlave.h b/drivers/SPISlave.h index 13d4f0f68b..5b9ae58557 100644 --- a/drivers/SPISlave.h +++ b/drivers/SPISlave.h @@ -25,11 +25,9 @@ #include "hal/spi_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_SPISlave SPISlave class + * \ingroup drivers-public-api-spi * @{ */ @@ -132,7 +130,6 @@ protected: #endif //!defined(DOXYGEN_ONLY) }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/Serial.h b/drivers/Serial.h index 7dad33a613..d167e69580 100644 --- a/drivers/Serial.h +++ b/drivers/Serial.h @@ -27,11 +27,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_Serial Serial class + * \ingroup drivers-public-api-uart * @{ */ @@ -115,7 +113,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/SerialBase.h b/drivers/SerialBase.h index 3acf9cbf1a..5213f325fd 100644 --- a/drivers/SerialBase.h +++ b/drivers/SerialBase.h @@ -32,12 +32,9 @@ #endif namespace mbed { -/** \defgroup drivers */ -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_SerialBase SerialBase class + * \ingroup drivers-public-api-uart * @{ */ @@ -314,7 +311,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/SerialWireOutput.h b/drivers/SerialWireOutput.h index 52f5416c54..69d607e60d 100644 --- a/drivers/SerialWireOutput.h +++ b/drivers/SerialWireOutput.h @@ -25,11 +25,9 @@ #include "platform/FileHandle.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api Public API */ -/** @{*/ /** * \defgroup drivers_SerialWireOutput SerialWireOutput class + * \ingroup drivers-public-api-uart * @{ */ @@ -71,7 +69,6 @@ public: } }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/Ticker.h b/drivers/Ticker.h index 455283718e..ae7da0cca9 100644 --- a/drivers/Ticker.h +++ b/drivers/Ticker.h @@ -24,11 +24,9 @@ #include "hal/lp_ticker_api.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** - * \defgroup drivers_Ticker Ticker class + * \addtogroup drivers_Ticker Ticker class + * \ingroup drivers-public-api-ticker * @{ */ @@ -154,7 +152,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/Timeout.h b/drivers/Timeout.h index 673554f234..d4b63b37e4 100644 --- a/drivers/Timeout.h +++ b/drivers/Timeout.h @@ -21,11 +21,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** - * \defgroup drivers_Timeout Timeout class + * \addtogroup drivers_Timeout Timeout class + * \ingroup drivers-public-api-ticker * @{ */ @@ -67,7 +65,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/Timer.h b/drivers/Timer.h index 8d4d22a7ca..8ba20d6e47 100644 --- a/drivers/Timer.h +++ b/drivers/Timer.h @@ -22,11 +22,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** - * \defgroup drivers_Timer Timer class + * \addtogroup drivers_Timer Timer class + * \ingroup drivers-public-api-ticker * @{ */ @@ -112,7 +110,6 @@ protected: }; #endif -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/TimerEvent.h b/drivers/TimerEvent.h index 5bd6eab7d2..1c47df0cca 100644 --- a/drivers/TimerEvent.h +++ b/drivers/TimerEvent.h @@ -21,11 +21,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** - * \defgroup drivers_TimerEvent TimerEvent class + * \addtogroup drivers_TimerEvent TimerEvent class + * \ingroup drivers-public-api-ticker * @{ */ @@ -86,7 +84,6 @@ protected: #endif }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/UARTSerial.h b/drivers/UARTSerial.h index 1e3d8dd06c..e23a4a65b0 100644 --- a/drivers/UARTSerial.h +++ b/drivers/UARTSerial.h @@ -38,12 +38,9 @@ #endif namespace mbed { - -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_UARTSerial UARTSerial class + * \ingroup drivers-public-api-uart * @{ */ @@ -317,7 +314,6 @@ private: }; -/** @}*/ /** @}*/ } //namespace mbed diff --git a/drivers/USBAudio.h b/drivers/USBAudio.h index 846e47b241..6072afdf0a 100644 --- a/drivers/USBAudio.h +++ b/drivers/USBAudio.h @@ -28,11 +28,13 @@ #include "ByteBuffer.h" #include "rtos/EventFlags.h" -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ +/** \defgroup drivers-public-api-usb USB + * \ingroup drivers-public-api + */ + /** * \defgroup drivers_USBAudio USBAudio class + * \ingroup drivers-public-api-usb * @{ */ @@ -382,7 +384,6 @@ private: }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/USBCDC.h b/drivers/USBCDC.h index 0c2044ed50..5f173c84a6 100644 --- a/drivers/USBCDC.h +++ b/drivers/USBCDC.h @@ -27,11 +27,9 @@ class AsyncOp; -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_USBCDC USBCDC class + * \ingroup drivers-public-api-usb * @{ */ @@ -232,7 +230,6 @@ protected: uint32_t _rx_size; }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/USBCDC_ECM.h b/drivers/USBCDC_ECM.h index 4502ef5d71..2c56cdd158 100644 --- a/drivers/USBCDC_ECM.h +++ b/drivers/USBCDC_ECM.h @@ -38,11 +38,9 @@ #define PACKET_TYPE_BROADCAST (1<<3) #define PACKET_TYPE_MULTICAST (1<<4) -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_USBCDC_ECM USBCDC_ECM class + * \ingroup drivers-public-api-usb * @{ */ @@ -275,7 +273,6 @@ private: void _notify_connect(); }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/USBHID.h b/drivers/USBHID.h index 8723a64880..70b1b3f537 100644 --- a/drivers/USBHID.h +++ b/drivers/USBHID.h @@ -25,12 +25,9 @@ #include "USBHID_Types.h" #include "OperationList.h" - -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_USBHID USBHID class + * \ingroup drivers-public-api-usb * @{ */ @@ -275,7 +272,6 @@ private: }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/USBKeyboard.h b/drivers/USBKeyboard.h index 70777abe3c..c8ebbdd0ed 100644 --- a/drivers/USBKeyboard.h +++ b/drivers/USBKeyboard.h @@ -74,11 +74,9 @@ enum FUNCTION_KEY { UP_ARROW, /* Up arrow */ }; -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_USBKeyboard USBKeyboard class + * \ingroup drivers-public-api-usb * @{ */ @@ -217,7 +215,6 @@ private: }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/USBMIDI.h b/drivers/USBMIDI.h index e1872bb802..e36b63055e 100644 --- a/drivers/USBMIDI.h +++ b/drivers/USBMIDI.h @@ -30,11 +30,9 @@ #define DEFAULT_CONFIGURATION (1) -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_USBMIDI USBMIDI class + * \ingroup drivers-public-api-usb * @{ */ @@ -190,7 +188,6 @@ private: bool _next_message(); }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/USBMSD.h b/drivers/USBMSD.h index ce5e3b7244..301ce491c5 100644 --- a/drivers/USBMSD.h +++ b/drivers/USBMSD.h @@ -29,11 +29,9 @@ #include "USBDevice.h" -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_USBMSD USBMSD class + * \ingroup drivers-public-api-usb * @{ */ @@ -312,7 +310,6 @@ private: void fail(); }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/USBMouse.h b/drivers/USBMouse.h index b4450025ef..d9cd1a6442 100644 --- a/drivers/USBMouse.h +++ b/drivers/USBMouse.h @@ -49,11 +49,9 @@ enum MOUSE_TYPE { REL_MOUSE, }; -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_USBMouse USBMouse class + * \ingroup drivers-public-api-usb * @{ */ @@ -240,7 +238,6 @@ private: bool mouse_send(int8_t x, int8_t y, uint8_t buttons, int8_t z); }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/USBMouseKeyboard.h b/drivers/USBMouseKeyboard.h index f54238724a..3ad2b98728 100644 --- a/drivers/USBMouseKeyboard.h +++ b/drivers/USBMouseKeyboard.h @@ -28,11 +28,9 @@ #include "USBHID.h" #include "PlatformMutex.h" -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_USBMouseKeyboard USBMouseKeyboard class + * \ingroup drivers-public-api-usb * @{ */ @@ -251,7 +249,6 @@ private: virtual int _getc(); }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/USBSerial.h b/drivers/USBSerial.h index f7e0f38035..ff5f5b392b 100644 --- a/drivers/USBSerial.h +++ b/drivers/USBSerial.h @@ -22,11 +22,9 @@ #include "Stream.h" #include "Callback.h" -/** \ingroup drivers */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_USBSerial USBSerial class + * \ingroup drivers-public-api-usb * @{ */ @@ -224,7 +222,6 @@ private: void (*_settings_changed_callback)(int baud, int bits, int parity, int stop); }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/Watchdog.h b/drivers/Watchdog.h index 3b20d6fc28..97f971830e 100644 --- a/drivers/Watchdog.h +++ b/drivers/Watchdog.h @@ -28,7 +28,7 @@ #include namespace mbed { -/** \ingroup drivers */ +/** \ingroup mbed-os-public */ /** \addtogroup drivers-public-api */ /** @{*/ /** diff --git a/drivers/internal/AsyncOp.h b/drivers/internal/AsyncOp.h index a9a2f1d9be..507c3f8f42 100644 --- a/drivers/internal/AsyncOp.h +++ b/drivers/internal/AsyncOp.h @@ -25,11 +25,15 @@ #include "LinkEntry.h" #include "OperationListBase.h" -/** \ingroup drivers */ -/** \addtogroup drivers-internal-api */ -/** @{*/ +/** \defgroup mbed-os-internal Internal API */ + +/** \addtogroup drivers-internal-api Drivers + * \ingroup mbed-os-internal + */ + /** * \defgroup drivers_AsyncOp AsyncOp class + * \ingroup drivers-internal-api * @{ */ class AsyncOp: public LinkEntry { @@ -116,7 +120,6 @@ private: static void _host_unlock(rtos::Mutex *host_mutex); }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/internal/ByteBuffer.h b/drivers/internal/ByteBuffer.h index e39488767f..6cfd5e994f 100644 --- a/drivers/internal/ByteBuffer.h +++ b/drivers/internal/ByteBuffer.h @@ -20,11 +20,9 @@ #include -/** \ingroup drivers */ -/** \addtogroup drivers-internal-api */ -/** @{*/ /** * \defgroup drivers_ByteBuffer ByteBuffer class + * \ingroup drivers-internal-api * @{ */ class ByteBuffer { @@ -123,7 +121,6 @@ private: uint8_t *_buf; }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/internal/EndpointResolver.h b/drivers/internal/EndpointResolver.h index 212b4f2355..a3c7b7f475 100644 --- a/drivers/internal/EndpointResolver.h +++ b/drivers/internal/EndpointResolver.h @@ -20,6 +20,12 @@ #include "USBPhy.h" +/** + * \defgroup drivers_EndpointResolver EndpointResolver class + * \ingroup drivers-internal-api + * @{ + */ + /** * Utility class for resolving endpoints * @@ -30,14 +36,6 @@ * given configuration. * */ - -/** \ingroup drivers */ -/** \addtogroup drivers-internal-api */ -/** @{*/ -/** - * \defgroup drivers_EndpointResolver EndpointResolver class - * @{ - */ class EndpointResolver { public: EndpointResolver(const usb_ep_table_t *table); @@ -96,7 +94,6 @@ private: bool _valid; }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/internal/LinkEntry.h b/drivers/internal/LinkEntry.h index 6cbd8e1c30..f093607452 100644 --- a/drivers/internal/LinkEntry.h +++ b/drivers/internal/LinkEntry.h @@ -20,11 +20,9 @@ #include -/** \ingroup drivers */ -/** \addtogroup drivers-internal-api */ -/** @{*/ /** * \defgroup drivers_LinkEntry LinkEntry class + * \ingroup drivers-internal-api-list * @{ */ class LinkEntry { @@ -39,7 +37,6 @@ private: LinkEntry *_next; }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/internal/LinkedList.h b/drivers/internal/LinkedList.h index cc1f613133..fe84a28dfc 100644 --- a/drivers/internal/LinkedList.h +++ b/drivers/internal/LinkedList.h @@ -21,11 +21,13 @@ #include "LinkEntry.h" #include "LinkedListBase.h" -/** \ingroup drivers */ -/** \addtogroup drivers-internal-api */ -/** @{*/ +/** \defgroup drivers-internal-api-list List + * \ingroup drivers-internal-api + */ + /** * \defgroup drivers_LinkedList LinkedList class + * \ingroup drivers-internal-api-list * @{ */ template @@ -65,7 +67,6 @@ public: } }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/internal/LinkedListBase.h b/drivers/internal/LinkedListBase.h index ed7df8d1cb..99eebe7730 100644 --- a/drivers/internal/LinkedListBase.h +++ b/drivers/internal/LinkedListBase.h @@ -20,11 +20,9 @@ #include "LinkEntry.h" -/** \ingroup drivers */ -/** \addtogroup drivers-internal-api */ -/** @{*/ /** * \defgroup drivers_LinkedListBase LinkedListBase class + * \ingroup drivers-internal-api-list * @{ */ class LinkedListBase { @@ -65,7 +63,6 @@ private: LinkEntry *_tail; }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/internal/MIDIMessage.h b/drivers/internal/MIDIMessage.h index 5e9c502dde..490a395262 100644 --- a/drivers/internal/MIDIMessage.h +++ b/drivers/internal/MIDIMessage.h @@ -40,11 +40,10 @@ #define CABLE_NUM (0<<4) -/** \ingroup drivers */ -/** \addtogroup drivers-internal-api */ -/** @{*/ + /** * \defgroup drivers_MIDIMessage MIDIMessage class + * \ingroup drivers-internal-api * @{ */ @@ -480,7 +479,6 @@ public: uint16_t length; }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/internal/PolledQueue.h b/drivers/internal/PolledQueue.h index 47d049c638..f7dd1f4069 100644 --- a/drivers/internal/PolledQueue.h +++ b/drivers/internal/PolledQueue.h @@ -22,9 +22,17 @@ #include "platform/Callback.h" #include "LinkedList.h" namespace events { -/** \ingroup events */ -/** \addtogroup events-internal-api */ -/** @{*/ +/** \addtogroup events-internal-api Events + * \ingroup mbed-os-internal + * @{ + */ + + +/** + * \defgroup events_PolledQueue PolledQueue class + * \ingroup events-internal-api + * @{ + */ /** PolledQueue * @@ -67,6 +75,7 @@ protected: }; +/** @}*/ /** @}*/ } diff --git a/drivers/internal/TableCRC.h b/drivers/internal/TableCRC.h index 15e460cb61..4960bb478f 100644 --- a/drivers/internal/TableCRC.h +++ b/drivers/internal/TableCRC.h @@ -21,9 +21,10 @@ #include namespace mbed { -/** \ingroup drivers */ -/** \addtogroup drivers-internal-api Internal API */ -/** @{*/ +/** \addtogroup drivers-internal-api + * \ingroup mbed-os-internal + * @{ + */ #define MBED_CRC_TABLE_SIZE 256 #define MBED_OPTIMIZED_CRC_TABLE_SIZE 16 diff --git a/drivers/internal/Task.h b/drivers/internal/Task.h index e484358253..04b48cb38a 100644 --- a/drivers/internal/Task.h +++ b/drivers/internal/Task.h @@ -24,9 +24,10 @@ #include "platform/Callback.h" namespace events { -/** \ingroup events */ -/** \addtogroup events-internal-api */ -/** @{*/ +/** \addtogroup events-internal-api + * \ingroup mbed-os-internal + * @{ + */ template diff --git a/drivers/internal/TaskBase.h b/drivers/internal/TaskBase.h index 8aceba6b5e..51ae547009 100644 --- a/drivers/internal/TaskBase.h +++ b/drivers/internal/TaskBase.h @@ -27,13 +27,15 @@ class Semaphore; } namespace events { -/** \ingroup events */ -/** \addtogroup events-internal-api */ -/** @{*/ - class TaskQueue; +/** + * \defgroup events_TaskBase TaskBase class + * \ingroup events-internal-api + * @{ + */ + /** TaskBase * * Representation of a caller allocated task diff --git a/drivers/internal/TaskQueue.h b/drivers/internal/TaskQueue.h index cfdf488153..dbacef3b75 100644 --- a/drivers/internal/TaskQueue.h +++ b/drivers/internal/TaskQueue.h @@ -25,11 +25,12 @@ #define MBED_MAX_TASK_SIZE 32 namespace events { -/** \ingroup events */ -/** \addtogroup events-internal-api */ -/** @{*/ - +/** + * \defgroup events_TaskQueue TaskQueue class + * \ingroup events-internal-api + * @{ + */ /** TaskQueue * diff --git a/events/Event.h b/events/Event.h index 58310f029f..73f43286d1 100644 --- a/events/Event.h +++ b/events/Event.h @@ -21,9 +21,11 @@ #include "platform/mbed_assert.h" namespace events { -/** \ingroup events */ -/** \addtogroup events-public-api Public API */ -/** @{*/ +/** + * \addtogroup events-public-api Events + * \ingroup mbed-os-public + * @{ + */ /** Event * diff --git a/events/EventQueue.h b/events/EventQueue.h index 197240473b..ee501255a9 100644 --- a/events/EventQueue.h +++ b/events/EventQueue.h @@ -18,16 +18,17 @@ #ifndef EVENT_QUEUE_H #define EVENT_QUEUE_H -#include "events/internal/equeue.h" +#include "events/equeue.h" #include "platform/Callback.h" #include "platform/NonCopyable.h" #include #include namespace events { -/** \ingroup events */ -/** \addtogroup events-public-api */ -/** @{*/ +/** + * \addtogroup events-public-api + * @{ + */ /** EVENTS_EVENT_SIZE * Minimum size of an event diff --git a/events/README.md b/events/README.md index 169d00065a..9ef90fe3ea 100644 --- a/events/README.md +++ b/events/README.md @@ -150,4 +150,215 @@ b.chain(&a); a.dispatch(); ``` +## Underlying C API ## + +The `mbed-events` C++ library is the recommended library for scheduling events. However, for occasions where C++ cannot be used for a project (e.g bare metal), the underlying C API `equeue` used by `mbed-events` can be accessed directly. + +The `equeue` library is designed as a simple but powerful library for scheduling +events on composable queues. + +``` c +#include "equeue.h" +#include + +int main() { + // creates a queue with space for 32 basic events + equeue_t queue; + equeue_create(&queue, 32*EQUEUE_EVENT_SIZE); + + // events can be simple callbacks + equeue_call(&queue, print, "called immediately"); + equeue_call_in(&queue, 2000, print, "called in 2 seconds"); + equeue_call_every(&queue, 1000, print, "called every 1 seconds"); + + // events are executed in equeue_dispatch + equeue_dispatch(&queue, 3000); + + print("called after 3 seconds"); + + equeue_destroy(&queue); +} +``` + +The equeue library can be used as a normal event loop, or it can be +backgrounded on a single hardware timer or even another event loop. It +is both thread and irq safe, and provides functions for easily composing +multiple queues. + +The equeue library can act as a drop-in scheduler, provide synchronization +between multiple threads, or just act as a mechanism for moving events +out of interrupt contexts. + +## Documentation ## + +The in-depth documentation on specific functions can be found in +[equeue.h](equeue.h). + +The core of the equeue library is the `equeue_t` type which represents a +single event queue, and the `equeue_dispatch` function which runs the equeue, +providing the context for executing events. + +On top of this, `equeue_call`, `equeue_call_in`, and `equeue_call_every` +provide easy methods for posting events to execute in the context of the +`equeue_dispatch` function. + +``` c +#include "equeue.h" +#include "game.h" + +equeue_t queue; +struct game game; + +// button_isr may be in interrupt context +void button_isr(void) { + equeue_call(&queue, game_button_update, &game); +} + +// a simple user-interface framework +int main() { + equeue_create(&queue, 4096); + game_create(&game); + + // call game_screen_udpate at 60 Hz + equeue_call_every(&queue, 1000/60, game_screen_update, &game); + + // dispatch forever + equeue_dispatch(&queue, -1); +} +``` + +In addition to simple callbacks, an event can be manually allocated with +`equeue_alloc` and posted with `equeue_post` to allow passing an arbitrary +amount of context to the execution of the event. This memory is allocated out +of the equeue's buffer, and dynamic memory can be completely avoided. + +The equeue allocator is designed to minimize jitter in interrupt contexts as +well as avoid memory fragmentation on small devices. The allocator achieves +both constant-runtime and zero-fragmentation for fixed-size events, however +grows linearly as the quantity of differently-sized allocations increases. + +``` c +#include "equeue.h" + +equeue_t queue; + +// arbitrary data can be moved to a different context +int enet_consume(void *buffer, int size) { + if (size > 512) { + size = 512; + } + + void *data = equeue_alloc(&queue, 512); + memcpy(data, buffer, size); + equeue_post(&queue, handle_data_elsewhere, data); + + return size; +} +``` + +Additionally, in-flight events can be cancelled with `equeue_cancel`. Events +are given unique ids on post, allowing safe cancellation of expired events. + +``` c +#include "equeue.h" + +equeue_t queue; +int sonar_value; +int sonar_timeout_id; + +void sonar_isr(int value) { + equeue_cancel(&queue, sonar_timeout_id); + sonar_value = value; +} + +void sonar_timeout(void *) { + sonar_value = -1; +} + +void sonar_read(void) { + sonar_timeout_id = equeue_call_in(&queue, 300, sonar_timeout, 0); + sonar_start(); +} +``` + +From an architectural standpoint, event queues easily align with module +boundaries, where internal state can be implicitly synchronized through +event dispatch. + +On platforms where multiple threads are unavailable, multiple modules +can use independent event queues and still be composed through the +`equeue_chain` function. + +``` c +#include "equeue.h" + +// run a simultaneous localization and mapping loop in one queue +struct slam { + equeue_t queue; +}; + +void slam_create(struct slam *s, equeue_t *target) { + equeue_create(&s->queue, 4096); + equeue_chain(&s->queue, target); + equeue_call_every(&s->queue, 100, slam_filter); +} + +// run a sonar with it's own queue +struct sonar { + equeue_t equeue; + struct slam *slam; +}; + +void sonar_create(struct sonar *s, equeue_t *target) { + equeue_create(&s->queue, 64); + equeue_chain(&s->queue, target); + equeue_call_in(&s->queue, 5, sonar_update, s); +} + +// all of the above queues can be combined into a single thread of execution +int main() { + equeue_t queue; + equeue_create(&queue, 1024); + + struct sonar s1, s2, s3; + sonar_create(&s1, &queue); + sonar_create(&s2, &queue); + sonar_create(&s3, &queue); + + struct slam slam; + slam_create(&slam, &queue); + + // dispatches events from all of the modules + equeue_dispatch(&queue, -1); +} +``` + +## Platform ## + +The equeue library has a minimal porting layer that is flexible depending +on the requirements of the underlying platform. Platform specific declarations +and more information can be found in [equeue_platform.h](equeue_platform.h). + +## Tests ## + +The equeue library uses a set of local tests based on the posix implementation. + +Runtime tests are located in [tests.c](tests/tests.c): + +``` bash +make test +``` + +Profiling tests based on rdtsc are located in [prof.c](tests/prof.c): + +``` bash +make prof +``` + +To make profiling results more tangible, the profiler also supports percentage +comparison with previous runs: +``` bash +make prof | tee results.txt +cat results.txt | make prof +``` diff --git a/events/internal/equeue.h b/events/equeue.h similarity index 98% rename from events/internal/equeue.h rename to events/equeue.h index d167fe48c8..ab25e16098 100644 --- a/events/internal/equeue.h +++ b/events/equeue.h @@ -29,9 +29,10 @@ extern "C" { #include #include -/** \ingroup events */ -/** \addtogroup events-internal-api Internal API */ -/** @{*/ +/** + * \addtogroup events-public-api + * @{ + */ // The minimum size of an event // This size is guaranteed to fit events created by event_call diff --git a/events/internal/equeue_platform.h b/events/internal/equeue_platform.h index ceefd942fa..18e986a8ef 100644 --- a/events/internal/equeue_platform.h +++ b/events/internal/equeue_platform.h @@ -25,9 +25,11 @@ extern "C" { #include #include -/** \ingroup events */ -/** \addtogroup events-internal-api */ -/** @{*/ +/** + * \addtogroup events-internal-api Events + * \ingroup mbed-os-internal + * @{ + */ // Currently supported platforms // diff --git a/events/mbed_events.h b/events/mbed_events.h index 39e4695edd..fdcbcae0b0 100644 --- a/events/mbed_events.h +++ b/events/mbed_events.h @@ -1,5 +1,3 @@ -/** \addtogroup events */ -/** @{*/ /* Copyright (c) 2016-2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 * @@ -25,13 +23,14 @@ #include "events/mbed_shared_queues.h" +/** \ingroup mbed-os-internal */ +/** \addtogroup events-internal-api */ +/** @{*/ #ifndef MBED_NO_GLOBAL_USING_DIRECTIVE using namespace events; #endif - -#endif - - -#endif - /** @}*/ + +#endif + +#endif diff --git a/events/mbed_shared_queues.h b/events/mbed_shared_queues.h index 741bddbe5f..acd83a6a29 100644 --- a/events/mbed_shared_queues.h +++ b/events/mbed_shared_queues.h @@ -19,7 +19,7 @@ #include "events/EventQueue.h" namespace mbed { -/** \ingroup events */ +/** \ingroup mbed-os-public */ /** \addtogroup events-public-api */ /** @{*/ diff --git a/events/source/README.md b/events/source/README.md deleted file mode 100644 index 625c355571..0000000000 --- a/events/source/README.md +++ /dev/null @@ -1,209 +0,0 @@ -## The equeue library ## - -The equeue library is designed as a simple but powerful library for scheduling -events on composable queues. - -``` c -#include "equeue.h" -#include - -int main() { - // creates a queue with space for 32 basic events - equeue_t queue; - equeue_create(&queue, 32*EQUEUE_EVENT_SIZE); - - // events can be simple callbacks - equeue_call(&queue, print, "called immediately"); - equeue_call_in(&queue, 2000, print, "called in 2 seconds"); - equeue_call_every(&queue, 1000, print, "called every 1 seconds"); - - // events are executed in equeue_dispatch - equeue_dispatch(&queue, 3000); - - print("called after 3 seconds"); - - equeue_destroy(&queue); -} -``` - -The equeue library can be used as a normal event loop, or it can be -backgrounded on a single hardware timer or even another event loop. It -is both thread and irq safe, and provides functions for easily composing -multiple queues. - -The equeue library can act as a drop-in scheduler, provide synchronization -between multiple threads, or just act as a mechanism for moving events -out of interrupt contexts. - -## Documentation ## - -The in-depth documentation on specific functions can be found in -[equeue.h](equeue.h). - -The core of the equeue library is the `equeue_t` type which represents a -single event queue, and the `equeue_dispatch` function which runs the equeue, -providing the context for executing events. - -On top of this, `equeue_call`, `equeue_call_in`, and `equeue_call_every` -provide easy methods for posting events to execute in the context of the -`equeue_dispatch` function. - -``` c -#include "equeue.h" -#include "game.h" - -equeue_t queue; -struct game game; - -// button_isr may be in interrupt context -void button_isr(void) { - equeue_call(&queue, game_button_update, &game); -} - -// a simple user-interface framework -int main() { - equeue_create(&queue, 4096); - game_create(&game); - - // call game_screen_udpate at 60 Hz - equeue_call_every(&queue, 1000/60, game_screen_update, &game); - - // dispatch forever - equeue_dispatch(&queue, -1); -} -``` - -In addition to simple callbacks, an event can be manually allocated with -`equeue_alloc` and posted with `equeue_post` to allow passing an arbitrary -amount of context to the execution of the event. This memory is allocated out -of the equeue's buffer, and dynamic memory can be completely avoided. - -The equeue allocator is designed to minimize jitter in interrupt contexts as -well as avoid memory fragmentation on small devices. The allocator achieves -both constant-runtime and zero-fragmentation for fixed-size events, however -grows linearly as the quantity of differently-sized allocations increases. - -``` c -#include "equeue.h" - -equeue_t queue; - -// arbitrary data can be moved to a different context -int enet_consume(void *buffer, int size) { - if (size > 512) { - size = 512; - } - - void *data = equeue_alloc(&queue, 512); - memcpy(data, buffer, size); - equeue_post(&queue, handle_data_elsewhere, data); - - return size; -} -``` - -Additionally, in-flight events can be cancelled with `equeue_cancel`. Events -are given unique ids on post, allowing safe cancellation of expired events. - -``` c -#include "equeue.h" - -equeue_t queue; -int sonar_value; -int sonar_timeout_id; - -void sonar_isr(int value) { - equeue_cancel(&queue, sonar_timeout_id); - sonar_value = value; -} - -void sonar_timeout(void *) { - sonar_value = -1; -} - -void sonar_read(void) { - sonar_timeout_id = equeue_call_in(&queue, 300, sonar_timeout, 0); - sonar_start(); -} -``` - -From an architectural standpoint, event queues easily align with module -boundaries, where internal state can be implicitly synchronized through -event dispatch. - -On platforms where multiple threads are unavailable, multiple modules -can use independent event queues and still be composed through the -`equeue_chain` function. - -``` c -#include "equeue.h" - -// run a simultaneous localization and mapping loop in one queue -struct slam { - equeue_t queue; -}; - -void slam_create(struct slam *s, equeue_t *target) { - equeue_create(&s->queue, 4096); - equeue_chain(&s->queue, target); - equeue_call_every(&s->queue, 100, slam_filter); -} - -// run a sonar with it's own queue -struct sonar { - equeue_t equeue; - struct slam *slam; -}; - -void sonar_create(struct sonar *s, equeue_t *target) { - equeue_create(&s->queue, 64); - equeue_chain(&s->queue, target); - equeue_call_in(&s->queue, 5, sonar_update, s); -} - -// all of the above queues can be combined into a single thread of execution -int main() { - equeue_t queue; - equeue_create(&queue, 1024); - - struct sonar s1, s2, s3; - sonar_create(&s1, &queue); - sonar_create(&s2, &queue); - sonar_create(&s3, &queue); - - struct slam slam; - slam_create(&slam, &queue); - - // dispatches events from all of the modules - equeue_dispatch(&queue, -1); -} -``` - -## Platform ## - -The equeue library has a minimal porting layer that is flexible depending -on the requirements of the underlying platform. Platform specific declarations -and more information can be found in [equeue_platform.h](equeue_platform.h). - -## Tests ## - -The equeue library uses a set of local tests based on the posix implementation. - -Runtime tests are located in [tests.c](tests/tests.c): - -``` bash -make test -``` - -Profiling tests based on rdtsc are located in [prof.c](tests/prof.c): - -``` bash -make prof -``` - -To make profiling results more tangible, the profiler also supports percentage -comparison with previous runs: -``` bash -make prof | tee results.txt -cat results.txt | make prof -``` diff --git a/events/source/equeue.c b/events/source/equeue.c index 0a49c46f5c..653e1c8c73 100644 --- a/events/source/equeue.c +++ b/events/source/equeue.c @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "events/internal/equeue.h" +#include "events/equeue.h" #include #include diff --git a/events/source/tests/prof.c b/events/source/tests/prof.c index 6f535aacb7..f7b8f903f7 100644 --- a/events/source/tests/prof.c +++ b/events/source/tests/prof.c @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "events/internal/equeue.h" +#include "events/equeue.h" #include #include #include diff --git a/events/source/tests/tests.c b/events/source/tests/tests.c index 5950cd5e82..941d706f92 100644 --- a/events/source/tests/tests.c +++ b/events/source/tests/tests.c @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "events/internal/equeue.h" +#include "events/equeue.h" #include #include #include diff --git a/platform/ATCmdParser.h b/platform/ATCmdParser.h index f3d9bb195b..f183cb64e1 100644 --- a/platform/ATCmdParser.h +++ b/platform/ATCmdParser.h @@ -28,8 +28,8 @@ namespace mbed { -/** \ingroup platform */ -/** \addtogroup platform-public-api Public API */ +/** \ingroup mbed-os-public */ +/** \addtogroup platform-public-api Platform */ /** @{*/ /** * \defgroup platform_ATCmdParser ATCmdParser class diff --git a/platform/CThunk.h b/platform/CThunk.h index e90aaf0db3..6e350c671d 100644 --- a/platform/CThunk.h +++ b/platform/CThunk.h @@ -1,4 +1,4 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/Callback.h b/platform/Callback.h index 1ad9b1df65..78f299ae59 100644 --- a/platform/Callback.h +++ b/platform/Callback.h @@ -24,7 +24,7 @@ #include "platform/mbed_toolchain.h" namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/CircularBuffer.h b/platform/CircularBuffer.h index 3fc87dd2db..d5d862a3f2 100644 --- a/platform/CircularBuffer.h +++ b/platform/CircularBuffer.h @@ -51,7 +51,7 @@ struct is_unsigned { }; }; -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/CriticalSectionLock.h b/platform/CriticalSectionLock.h index 3f8ed52a85..2d2291d816 100644 --- a/platform/CriticalSectionLock.h +++ b/platform/CriticalSectionLock.h @@ -22,7 +22,7 @@ namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/DeepSleepLock.h b/platform/DeepSleepLock.h index fb6cd418e0..6211f2d74f 100644 --- a/platform/DeepSleepLock.h +++ b/platform/DeepSleepLock.h @@ -22,7 +22,7 @@ namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/DirHandle.h b/platform/DirHandle.h index 7005e10aa7..60b9e08dde 100644 --- a/platform/DirHandle.h +++ b/platform/DirHandle.h @@ -22,7 +22,7 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/FileBase.h b/platform/FileBase.h index d0244a0853..f4aac58a17 100644 --- a/platform/FileBase.h +++ b/platform/FileBase.h @@ -31,13 +31,16 @@ typedef enum { FileSystemPathType } PathType; -/** \ingroup platform */ -/** \addtogroup platform-public-api */ -/** @{*/ +/** \defgroup platform-public-api-file File + * \ingroup platform-public-api + */ + /** * \defgroup platform_FileBase FileBase class + * \ingroup platform-public-api-file * @{ */ + /** Class FileBase * */ @@ -68,8 +71,6 @@ private: /**@}*/ -/**@}*/ - } // namespace mbed #endif diff --git a/platform/FileHandle.h b/platform/FileHandle.h index 69144a8cca..e1523edb54 100644 --- a/platform/FileHandle.h +++ b/platform/FileHandle.h @@ -26,11 +26,10 @@ typedef int FILEHANDLE; #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup platform */ -/** \addtogroup platform-public-api */ -/** @{*/ + /** * \defgroup platform_FileHandle FileHandle functions + * \ingroup platform-public-api-file * @{ */ @@ -320,9 +319,6 @@ public: /**@}*/ -/**@}*/ - - } // namespace mbed #endif diff --git a/platform/FileLike.h b/platform/FileLike.h index 56e34456a2..5f4409a8e0 100644 --- a/platform/FileLike.h +++ b/platform/FileLike.h @@ -22,13 +22,12 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup platform */ -/** \addtogroup platform-public-api */ -/** @{*/ /** * \defgroup platform_FileLike FileLike class + * \ingroup platform-public-api-file * @{ */ + /** Class FileLike * * A file-like object is one that can be opened with fopen by @@ -48,8 +47,6 @@ public: /**@}*/ -/**@}*/ - } // namespace mbed #endif diff --git a/platform/FilePath.h b/platform/FilePath.h index f9a0ab0854..1740a9866a 100644 --- a/platform/FilePath.h +++ b/platform/FilePath.h @@ -23,19 +23,18 @@ #include "platform/FileLike.h" namespace mbed { -/** \ingroup platform */ -/** \addtogroup platform-public-api */ -/** @{*/ + +class FileSystem; + /** * \defgroup platform_FilePath FilePath class + * \ingroup platform-public-api-file * @{ */ -class FileSystem; /** Class FilePath * */ - class FilePath { public: /** Constructor FilePath @@ -60,8 +59,6 @@ private: /**@}*/ -/**@}*/ - } // namespace mbed #endif diff --git a/platform/FileSystemHandle.h b/platform/FileSystemHandle.h index 47b56ccf62..ceedcd91fb 100644 --- a/platform/FileSystemHandle.h +++ b/platform/FileSystemHandle.h @@ -24,11 +24,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup platform */ -/** \addtogroup platform-public-api */ -/** @{*/ /** * \defgroup platform_FileSystemHandle FileSystemHandle functions + * \ingroup platform-public-api-file * @{ */ @@ -106,8 +104,6 @@ public: }; /**@}*/ -/**@}*/ - } // namespace mbed #endif diff --git a/platform/FileSystemLike.h b/platform/FileSystemLike.h index 9f604cf1b4..a8b616b027 100644 --- a/platform/FileSystemLike.h +++ b/platform/FileSystemLike.h @@ -26,11 +26,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup platform */ -/** \addtogroup platform-public-api */ -/** @{*/ /** * \defgroup platform_FileSystemLike FileSystemLike functions + * \ingroup platform-public-api-file * @{ */ @@ -88,8 +86,6 @@ public: /**@}*/ -/**@}*/ - } // namespace mbed #endif diff --git a/platform/FunctionPointer.h b/platform/FunctionPointer.h index 7129b671c9..e3fb94fe4d 100644 --- a/platform/FunctionPointer.h +++ b/platform/FunctionPointer.h @@ -23,7 +23,7 @@ #include namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/LocalFileSystem.h b/platform/LocalFileSystem.h index 5803e3dfe4..0061ef9f2b 100644 --- a/platform/LocalFileSystem.h +++ b/platform/LocalFileSystem.h @@ -26,7 +26,7 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/NonCopyable.h b/platform/NonCopyable.h index 7fe72841ac..4d78e83427 100644 --- a/platform/NonCopyable.h +++ b/platform/NonCopyable.h @@ -24,7 +24,7 @@ namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/PlatformMutex.h b/platform/PlatformMutex.h index 0f2116af0e..7f26c800db 100644 --- a/platform/PlatformMutex.h +++ b/platform/PlatformMutex.h @@ -19,7 +19,7 @@ #include "platform/NonCopyable.h" -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ diff --git a/platform/ScopedLock.h b/platform/ScopedLock.h index 55176576fa..e1ddf3bfc9 100644 --- a/platform/ScopedLock.h +++ b/platform/ScopedLock.h @@ -21,7 +21,7 @@ namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/ScopedRamExecutionLock.h b/platform/ScopedRamExecutionLock.h index 97f6a551b1..72e1874cca 100644 --- a/platform/ScopedRamExecutionLock.h +++ b/platform/ScopedRamExecutionLock.h @@ -21,7 +21,7 @@ namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ diff --git a/platform/ScopedRomWriteLock.h b/platform/ScopedRomWriteLock.h index 08ed049287..4e39382d92 100644 --- a/platform/ScopedRomWriteLock.h +++ b/platform/ScopedRomWriteLock.h @@ -21,7 +21,7 @@ namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ diff --git a/platform/SingletonPtr.h b/platform/SingletonPtr.h index 524dbb6919..a71e0873ce 100644 --- a/platform/SingletonPtr.h +++ b/platform/SingletonPtr.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/Span.h b/platform/Span.h index 0f46eb6b04..889cddc333 100644 --- a/platform/Span.h +++ b/platform/Span.h @@ -26,7 +26,7 @@ namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/Stream.h b/platform/Stream.h index 2db7f5aafe..ef03d71a8e 100644 --- a/platform/Stream.h +++ b/platform/Stream.h @@ -25,7 +25,7 @@ #include namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/Transaction.h b/platform/Transaction.h index 7da3635d6f..8b30ef494c 100644 --- a/platform/Transaction.h +++ b/platform/Transaction.h @@ -20,7 +20,7 @@ #include "platform/platform.h" namespace mbed { -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/internal/CThunkBase.h b/platform/internal/CThunkBase.h index c338a3ba4d..918924d905 100644 --- a/platform/internal/CThunkBase.h +++ b/platform/internal/CThunkBase.h @@ -21,7 +21,7 @@ /* IRQ/Exception compatible thunk entry function */ typedef void (*CThunkEntry)(void); -/** \ingroup platform */ +/** \ingroup mbed-os-internal */ /** \addtogroup platform-internal-api */ /** @{*/ /** diff --git a/platform/internal/CallChain.h b/platform/internal/CallChain.h index d51f9b25b5..e1bfce06b7 100644 --- a/platform/internal/CallChain.h +++ b/platform/internal/CallChain.h @@ -28,8 +28,8 @@ namespace mbed { typedef Callback *pFunctionPointer_t; class CallChainLink; -/** \ingroup platform */ -/** \addtogroup platform-internal-api Internal API */ +/** \ingroup mbed-os-internal */ +/** \addtogroup platform-internal-api Platform */ /** @{*/ /** * \defgroup platform_CallChain CallChain class diff --git a/platform/mbed_assert.h b/platform/mbed_assert.h index 3f9708ddef..f43aa8b4bf 100644 --- a/platform/mbed_assert.h +++ b/platform/mbed_assert.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_atomic.h b/platform/mbed_atomic.h index 3ad2c87827..ca9f8df799 100644 --- a/platform/mbed_atomic.h +++ b/platform/mbed_atomic.h @@ -26,7 +26,7 @@ #include #include "platform/mbed_toolchain.h" -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ diff --git a/platform/mbed_critical.h b/platform/mbed_critical.h index af7eda387b..f1a152ef77 100644 --- a/platform/mbed_critical.h +++ b/platform/mbed_critical.h @@ -25,7 +25,7 @@ extern "C" { #endif -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_debug.h b/platform/mbed_debug.h index f19fc33b14..cfa52bfebb 100644 --- a/platform/mbed_debug.h +++ b/platform/mbed_debug.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_error.h b/platform/mbed_error.h index 8724c3fde0..7a1f701288 100644 --- a/platform/mbed_error.h +++ b/platform/mbed_error.h @@ -1,4 +1,4 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_interface.h b/platform/mbed_interface.h index 4eb0ab3f62..44c1f262ea 100644 --- a/platform/mbed_interface.h +++ b/platform/mbed_interface.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_mem_trace.h b/platform/mbed_mem_trace.h index e1156be0a9..12e2c104df 100644 --- a/platform/mbed_mem_trace.h +++ b/platform/mbed_mem_trace.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ diff --git a/platform/mbed_mktime.h b/platform/mbed_mktime.h index a1dc7e6aed..21448eaaad 100644 --- a/platform/mbed_mktime.h +++ b/platform/mbed_mktime.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /* mbed Microcontroller Library diff --git a/platform/mbed_mpu_mgmt.h b/platform/mbed_mpu_mgmt.h index b96adc303e..c3a1cc96c2 100644 --- a/platform/mbed_mpu_mgmt.h +++ b/platform/mbed_mpu_mgmt.h @@ -1,4 +1,4 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_poll.h b/platform/mbed_poll.h index 6061943a2c..e293f77edb 100644 --- a/platform/mbed_poll.h +++ b/platform/mbed_poll.h @@ -27,7 +27,7 @@ namespace mbed { class FileHandle; -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_power_mgmt.h b/platform/mbed_power_mgmt.h index 75764b9581..dc476ffaf7 100644 --- a/platform/mbed_power_mgmt.h +++ b/platform/mbed_power_mgmt.h @@ -1,4 +1,4 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_preprocessor.h b/platform/mbed_preprocessor.h index e01afb9fab..1b5607ef58 100644 --- a/platform/mbed_preprocessor.h +++ b/platform/mbed_preprocessor.h @@ -1,4 +1,4 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_retarget.h b/platform/mbed_retarget.h index 18fac7bcbe..f8aac6e9c4 100644 --- a/platform/mbed_retarget.h +++ b/platform/mbed_retarget.h @@ -79,7 +79,7 @@ typedef unsigned int gid_t; ///< Group ID #include -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_rtc_time.h b/platform/mbed_rtc_time.h index 09e42c0a7e..935ff8d3e2 100644 --- a/platform/mbed_rtc_time.h +++ b/platform/mbed_rtc_time.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_stats.h b/platform/mbed_stats.h index 46ca8f5822..8bb8056830 100644 --- a/platform/mbed_stats.h +++ b/platform/mbed_stats.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_toolchain.h b/platform/mbed_toolchain.h index 3d8292d1cf..04752ba4f1 100644 --- a/platform/mbed_toolchain.h +++ b/platform/mbed_toolchain.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_version.h b/platform/mbed_version.h index 61aedbd4d6..007c57a46e 100644 --- a/platform/mbed_version.h +++ b/platform/mbed_version.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/mbed_wait_api.h b/platform/mbed_wait_api.h index bf1e752760..edf5075f83 100644 --- a/platform/mbed_wait_api.h +++ b/platform/mbed_wait_api.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /** diff --git a/platform/platform.h b/platform/platform.h index 33a48c9499..da2431ab7d 100644 --- a/platform/platform.h +++ b/platform/platform.h @@ -1,6 +1,4 @@ -/** \addtogroup platform */ -/** @{*/ /* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * SPDX-License-Identifier: Apache-2.0 @@ -32,5 +30,3 @@ #include "PeripheralNames.h" #endif - -/** @}*/ diff --git a/platform/source/mbed_crash_data_offsets.h b/platform/source/mbed_crash_data_offsets.h index 56a466866e..c29f5cd3d8 100644 --- a/platform/source/mbed_crash_data_offsets.h +++ b/platform/source/mbed_crash_data_offsets.h @@ -21,7 +21,7 @@ extern "C" { #endif #if MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED -/** \ingroup platform */ +/** \ingroup mbed-os-internal */ /** \addtogroup platform-internal-api */ /** @{*/ #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) diff --git a/platform/source/mbed_error_hist.h b/platform/source/mbed_error_hist.h index 96378c7921..0bec541ca3 100644 --- a/platform/source/mbed_error_hist.h +++ b/platform/source/mbed_error_hist.h @@ -29,7 +29,7 @@ extern "C" { #endif -/** \ingroup platform */ +/** \ingroup mbed-os-internal */ /** \addtogroup platform-internal-api */ /** @{*/ diff --git a/platform/toolchain.h b/platform/toolchain.h index 6d23b3661d..c69c981178 100644 --- a/platform/toolchain.h +++ b/platform/toolchain.h @@ -1,5 +1,5 @@ -/** \ingroup platform */ +/** \ingroup mbed-os-public */ /** \addtogroup platform-public-api */ /** @{*/ /* mbed Microcontroller Library diff --git a/rtos/ConditionVariable.h b/rtos/ConditionVariable.h index 2d2ffd7e6b..7bd46049ee 100644 --- a/rtos/ConditionVariable.h +++ b/rtos/ConditionVariable.h @@ -32,8 +32,8 @@ #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \ingroup rtos */ -/** \addtogroup rtos-public-api Public API */ +/** \ingroup mbed-os-public */ +/** \addtogroup rtos-public-api RTOS */ /** @{*/ struct Waiter; diff --git a/rtos/EventFlags.h b/rtos/EventFlags.h index 7c808766c5..e4db8efa8c 100644 --- a/rtos/EventFlags.h +++ b/rtos/EventFlags.h @@ -30,7 +30,7 @@ #include "platform/NonCopyable.h" namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ /** diff --git a/rtos/Kernel.h b/rtos/Kernel.h index 43ca0a6fc8..b5a4ad4086 100644 --- a/rtos/Kernel.h +++ b/rtos/Kernel.h @@ -26,7 +26,7 @@ #include "rtos/mbed_rtos_types.h" namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ diff --git a/rtos/Mail.h b/rtos/Mail.h index a7bbda6da4..a747a9e664 100644 --- a/rtos/Mail.h +++ b/rtos/Mail.h @@ -41,7 +41,7 @@ using namespace rtos; #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ /** diff --git a/rtos/MemoryPool.h b/rtos/MemoryPool.h index 0bce9373df..595734b952 100644 --- a/rtos/MemoryPool.h +++ b/rtos/MemoryPool.h @@ -35,7 +35,7 @@ #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ /** diff --git a/rtos/Mutex.h b/rtos/Mutex.h index 457d4a1d5f..34d5f58a41 100644 --- a/rtos/Mutex.h +++ b/rtos/Mutex.h @@ -32,7 +32,7 @@ #include "platform/mbed_toolchain.h" namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ diff --git a/rtos/Queue.h b/rtos/Queue.h index ac1b98c344..42fb49219a 100644 --- a/rtos/Queue.h +++ b/rtos/Queue.h @@ -31,7 +31,7 @@ #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ /** diff --git a/rtos/RtosTimer.h b/rtos/RtosTimer.h index a6ec7e97ec..3628722ef5 100644 --- a/rtos/RtosTimer.h +++ b/rtos/RtosTimer.h @@ -33,7 +33,7 @@ #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ /** diff --git a/rtos/Semaphore.h b/rtos/Semaphore.h index 32639155b4..f3dba32ec7 100644 --- a/rtos/Semaphore.h +++ b/rtos/Semaphore.h @@ -30,7 +30,7 @@ #include "platform/NonCopyable.h" namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ /** diff --git a/rtos/TARGET_CORTEX/mbed_boot.h b/rtos/TARGET_CORTEX/mbed_boot.h index 98229b3929..1be08b59a1 100644 --- a/rtos/TARGET_CORTEX/mbed_boot.h +++ b/rtos/TARGET_CORTEX/mbed_boot.h @@ -25,8 +25,8 @@ extern "C" { #include "mbed_rtx.h" -/** \ingroup rtos */ -/** \addtogroup mbed-os-internal */ +/** \ingroup mbed-os-internal */ +/** \addtogroup rtos-internal-api */ /** @{*/ /** diff --git a/rtos/TARGET_CORTEX/mbed_rtx_storage.h b/rtos/TARGET_CORTEX/mbed_rtx_storage.h index bcc5ea0c3a..3fd01bcc50 100644 --- a/rtos/TARGET_CORTEX/mbed_rtx_storage.h +++ b/rtos/TARGET_CORTEX/mbed_rtx_storage.h @@ -29,8 +29,8 @@ extern "C" { #include "rtx_os.h" #include "mbed_rtx_conf.h" -/** \ingroup rtos */ -/** \addtogroup mbed-os-internal */ +/** \ingroup mbed-os-internal */ +/** \addtogroup rtos-internal-api */ /** @{*/ /** \defgroup rtos_storage RTOS primitives storage types for RTX diff --git a/rtos/ThisThread.h b/rtos/ThisThread.h index 88097d07b7..f4dbc4ace0 100644 --- a/rtos/ThisThread.h +++ b/rtos/ThisThread.h @@ -26,7 +26,7 @@ #include "rtos/mbed_rtos_types.h" namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ /** diff --git a/rtos/Thread.h b/rtos/Thread.h index ecf4954649..3d90b76e23 100644 --- a/rtos/Thread.h +++ b/rtos/Thread.h @@ -35,7 +35,7 @@ #if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY) || defined(UNITTEST) namespace rtos { -/** \ingroup rtos */ +/** \ingroup mbed-os-public */ /** \addtogroup rtos-public-api */ /** @{*/ /** diff --git a/rtos/rtos.h b/rtos/rtos.h index ce44c0fd47..22bc2318a9 100644 --- a/rtos/rtos.h +++ b/rtos/rtos.h @@ -1,6 +1,4 @@ -/** \addtogroup rtos */ -/** @{*/ /* mbed Microcontroller Library * Copyright (c) 2006-2012 ARM Limited * @@ -38,10 +36,12 @@ #include "rtos/EventFlags.h" #include "rtos/ConditionVariable.h" +/** \ingroup mbed-os-public */ +/** \addtogroup rtos-public-api */ +/** @{*/ #ifndef MBED_NO_GLOBAL_USING_DIRECTIVE using namespace rtos; #endif +/** @}*/ #endif - -/** @}*/ diff --git a/rtos/source/rtos_handlers.h b/rtos/source/rtos_handlers.h index 1e2b25bb85..62b7d545bf 100644 --- a/rtos/source/rtos_handlers.h +++ b/rtos/source/rtos_handlers.h @@ -28,8 +28,8 @@ extern "C" { #endif -/** \ingroup rtos */ -/** \addtogroup rtos-internal-api Internal API */ +/** \ingroup mbed-os-internal */ +/** \addtogroup rtos-internal-api RTOS */ /** @{*/ /** diff --git a/rtos/source/rtos_idle.h b/rtos/source/rtos_idle.h index b6b2850078..447f68a9d3 100644 --- a/rtos/source/rtos_idle.h +++ b/rtos/source/rtos_idle.h @@ -29,8 +29,8 @@ extern "C" { #endif -/** \ingroup rtos */ -/** \addtogroup rtos-internal-api Internal API */ +/** \ingroup mbed-os-internal */ +/** \addtogroup rtos-internal-api */ /** @{*/ /** From 3b23edb78cecd4b8be6d151b9b5c5de96a9dfc78 Mon Sep 17 00:00:00 2001 From: George Psimenos Date: Fri, 26 Jul 2019 13:01:43 +0100 Subject: [PATCH 07/10] Fix CI for branch feature-public-headers (#11093) * Fix rtos include path in NRFCordioHCIDriver * Flatten USB driver directory structure * Add missing include for us_ticker * Add more missing includes for us_ticker * Fix mbed_hal_fpga_ci_test_shield/uart test * Fix bare-metal build * Fix Watchdog UNITTEST * Fix Mbed OS 2 build for Public/Internal headers relocating --- TESTS/mbed_hal/qspi/main.cpp | 1 + TESTS/mbed_hal/qspi/qspi_test_utils.cpp | 1 + TESTS/mbed_hal/sleep/main.cpp | 1 + TESTS/mbed_hal/sleep_manager/main.cpp | 1 + .../uart/main.cpp | 2 ++ UNITTESTS/drivers/Watchdog/unittest.cmake | 2 +- .../usb/{device/utilities => }/AsyncOp.cpp | 0 .../usb/{device/utilities => }/ByteBuffer.cpp | 0 .../usb/{device => }/EndpointResolver.cpp | 0 .../{device/utilities => }/LinkedListBase.cpp | 0 .../utilities => }/OperationListBase.cpp | 0 .../utilities/events => }/PolledQueue.cpp | 0 .../utilities/events => }/TaskBase.cpp | 0 drivers/source/usb/{device => }/USBAudio.cpp | 0 drivers/source/usb/{device => }/USBCDC.cpp | 0 .../source/usb/{device => }/USBCDC_ECM.cpp | 0 drivers/source/usb/{device => }/USBDevice.cpp | 0 drivers/source/usb/{device => }/USBHID.cpp | 0 .../source/usb/{device => }/USBKeyboard.cpp | 0 drivers/source/usb/{device => }/USBMIDI.cpp | 0 drivers/source/usb/{device => }/USBMSD.cpp | 0 drivers/source/usb/{device => }/USBMouse.cpp | 0 .../usb/{device => }/USBMouseKeyboard.cpp | 0 drivers/source/usb/{device => }/USBSerial.cpp | 0 drivers/source/usb/mbed_lib.json | 3 +++ .../TARGET_NRF5x/NRFCordioHCIDriver.cpp | 4 ++-- tools/build_api.py | 8 ++++++- tools/toolchains/mbed_toolchain.py | 21 +++++++++++++++---- 28 files changed, 36 insertions(+), 8 deletions(-) rename drivers/source/usb/{device/utilities => }/AsyncOp.cpp (100%) rename drivers/source/usb/{device/utilities => }/ByteBuffer.cpp (100%) rename drivers/source/usb/{device => }/EndpointResolver.cpp (100%) rename drivers/source/usb/{device/utilities => }/LinkedListBase.cpp (100%) rename drivers/source/usb/{device/utilities => }/OperationListBase.cpp (100%) rename drivers/source/usb/{device/utilities/events => }/PolledQueue.cpp (100%) rename drivers/source/usb/{device/utilities/events => }/TaskBase.cpp (100%) rename drivers/source/usb/{device => }/USBAudio.cpp (100%) rename drivers/source/usb/{device => }/USBCDC.cpp (100%) rename drivers/source/usb/{device => }/USBCDC_ECM.cpp (100%) rename drivers/source/usb/{device => }/USBDevice.cpp (100%) rename drivers/source/usb/{device => }/USBHID.cpp (100%) rename drivers/source/usb/{device => }/USBKeyboard.cpp (100%) rename drivers/source/usb/{device => }/USBMIDI.cpp (100%) rename drivers/source/usb/{device => }/USBMSD.cpp (100%) rename drivers/source/usb/{device => }/USBMouse.cpp (100%) rename drivers/source/usb/{device => }/USBMouseKeyboard.cpp (100%) rename drivers/source/usb/{device => }/USBSerial.cpp (100%) create mode 100644 drivers/source/usb/mbed_lib.json diff --git a/TESTS/mbed_hal/qspi/main.cpp b/TESTS/mbed_hal/qspi/main.cpp index 0c772327f0..883cf48b46 100644 --- a/TESTS/mbed_hal/qspi/main.cpp +++ b/TESTS/mbed_hal/qspi/main.cpp @@ -26,6 +26,7 @@ #include "mbed.h" #include "qspi_api.h" +#include "hal/us_ticker_api.h" #if !defined(QSPI_FLASH_CHIP_STRING) diff --git a/TESTS/mbed_hal/qspi/qspi_test_utils.cpp b/TESTS/mbed_hal/qspi/qspi_test_utils.cpp index 306123ad3b..7c42384724 100644 --- a/TESTS/mbed_hal/qspi/qspi_test_utils.cpp +++ b/TESTS/mbed_hal/qspi/qspi_test_utils.cpp @@ -17,6 +17,7 @@ #include "utest/utest.h" #include "hal/qspi_api.h" +#include "hal/us_ticker_api.h" #include "qspi_test_utils.h" #include "unity/unity.h" diff --git a/TESTS/mbed_hal/sleep/main.cpp b/TESTS/mbed_hal/sleep/main.cpp index c0730c5eb9..4767e59435 100644 --- a/TESTS/mbed_hal/sleep/main.cpp +++ b/TESTS/mbed_hal/sleep/main.cpp @@ -24,6 +24,7 @@ #include "unity/unity.h" #include "greentea-client/test_env.h" #include "mbed_lp_ticker_wrapper.h" +#include "hal/us_ticker_api.h" #include "sleep_test_utils.h" #include "sleep_api_tests.h" diff --git a/TESTS/mbed_hal/sleep_manager/main.cpp b/TESTS/mbed_hal/sleep_manager/main.cpp index 14a2e6e900..97ecaff290 100644 --- a/TESTS/mbed_hal/sleep_manager/main.cpp +++ b/TESTS/mbed_hal/sleep_manager/main.cpp @@ -19,6 +19,7 @@ #include #include "mbed.h" #include "mbed_lp_ticker_wrapper.h" +#include "hal/us_ticker_api.h" #include "../sleep/sleep_test_utils.h" #include "sleep_manager_api_tests.h" diff --git a/TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp b/TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp index c83ebb48d7..1ff3a37740 100644 --- a/TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp +++ b/TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp @@ -27,6 +27,8 @@ #include "unity/unity.h" #include "greentea-client/test_env.h" +#include "platform/mbed_critical.h" + using namespace utest::v1; #include diff --git a/UNITTESTS/drivers/Watchdog/unittest.cmake b/UNITTESTS/drivers/Watchdog/unittest.cmake index d7bbfff54b..1b907a9f54 100644 --- a/UNITTESTS/drivers/Watchdog/unittest.cmake +++ b/UNITTESTS/drivers/Watchdog/unittest.cmake @@ -12,7 +12,7 @@ set(unittest-includes ${unittest-includes} # Source files set(unittest-sources - ../drivers/Watchdog.cpp + ../drivers/source/Watchdog.cpp ) # Test files diff --git a/drivers/source/usb/device/utilities/AsyncOp.cpp b/drivers/source/usb/AsyncOp.cpp similarity index 100% rename from drivers/source/usb/device/utilities/AsyncOp.cpp rename to drivers/source/usb/AsyncOp.cpp diff --git a/drivers/source/usb/device/utilities/ByteBuffer.cpp b/drivers/source/usb/ByteBuffer.cpp similarity index 100% rename from drivers/source/usb/device/utilities/ByteBuffer.cpp rename to drivers/source/usb/ByteBuffer.cpp diff --git a/drivers/source/usb/device/EndpointResolver.cpp b/drivers/source/usb/EndpointResolver.cpp similarity index 100% rename from drivers/source/usb/device/EndpointResolver.cpp rename to drivers/source/usb/EndpointResolver.cpp diff --git a/drivers/source/usb/device/utilities/LinkedListBase.cpp b/drivers/source/usb/LinkedListBase.cpp similarity index 100% rename from drivers/source/usb/device/utilities/LinkedListBase.cpp rename to drivers/source/usb/LinkedListBase.cpp diff --git a/drivers/source/usb/device/utilities/OperationListBase.cpp b/drivers/source/usb/OperationListBase.cpp similarity index 100% rename from drivers/source/usb/device/utilities/OperationListBase.cpp rename to drivers/source/usb/OperationListBase.cpp diff --git a/drivers/source/usb/device/utilities/events/PolledQueue.cpp b/drivers/source/usb/PolledQueue.cpp similarity index 100% rename from drivers/source/usb/device/utilities/events/PolledQueue.cpp rename to drivers/source/usb/PolledQueue.cpp diff --git a/drivers/source/usb/device/utilities/events/TaskBase.cpp b/drivers/source/usb/TaskBase.cpp similarity index 100% rename from drivers/source/usb/device/utilities/events/TaskBase.cpp rename to drivers/source/usb/TaskBase.cpp diff --git a/drivers/source/usb/device/USBAudio.cpp b/drivers/source/usb/USBAudio.cpp similarity index 100% rename from drivers/source/usb/device/USBAudio.cpp rename to drivers/source/usb/USBAudio.cpp diff --git a/drivers/source/usb/device/USBCDC.cpp b/drivers/source/usb/USBCDC.cpp similarity index 100% rename from drivers/source/usb/device/USBCDC.cpp rename to drivers/source/usb/USBCDC.cpp diff --git a/drivers/source/usb/device/USBCDC_ECM.cpp b/drivers/source/usb/USBCDC_ECM.cpp similarity index 100% rename from drivers/source/usb/device/USBCDC_ECM.cpp rename to drivers/source/usb/USBCDC_ECM.cpp diff --git a/drivers/source/usb/device/USBDevice.cpp b/drivers/source/usb/USBDevice.cpp similarity index 100% rename from drivers/source/usb/device/USBDevice.cpp rename to drivers/source/usb/USBDevice.cpp diff --git a/drivers/source/usb/device/USBHID.cpp b/drivers/source/usb/USBHID.cpp similarity index 100% rename from drivers/source/usb/device/USBHID.cpp rename to drivers/source/usb/USBHID.cpp diff --git a/drivers/source/usb/device/USBKeyboard.cpp b/drivers/source/usb/USBKeyboard.cpp similarity index 100% rename from drivers/source/usb/device/USBKeyboard.cpp rename to drivers/source/usb/USBKeyboard.cpp diff --git a/drivers/source/usb/device/USBMIDI.cpp b/drivers/source/usb/USBMIDI.cpp similarity index 100% rename from drivers/source/usb/device/USBMIDI.cpp rename to drivers/source/usb/USBMIDI.cpp diff --git a/drivers/source/usb/device/USBMSD.cpp b/drivers/source/usb/USBMSD.cpp similarity index 100% rename from drivers/source/usb/device/USBMSD.cpp rename to drivers/source/usb/USBMSD.cpp diff --git a/drivers/source/usb/device/USBMouse.cpp b/drivers/source/usb/USBMouse.cpp similarity index 100% rename from drivers/source/usb/device/USBMouse.cpp rename to drivers/source/usb/USBMouse.cpp diff --git a/drivers/source/usb/device/USBMouseKeyboard.cpp b/drivers/source/usb/USBMouseKeyboard.cpp similarity index 100% rename from drivers/source/usb/device/USBMouseKeyboard.cpp rename to drivers/source/usb/USBMouseKeyboard.cpp diff --git a/drivers/source/usb/device/USBSerial.cpp b/drivers/source/usb/USBSerial.cpp similarity index 100% rename from drivers/source/usb/device/USBSerial.cpp rename to drivers/source/usb/USBSerial.cpp diff --git a/drivers/source/usb/mbed_lib.json b/drivers/source/usb/mbed_lib.json new file mode 100644 index 0000000000..dc0cd0d8b6 --- /dev/null +++ b/drivers/source/usb/mbed_lib.json @@ -0,0 +1,3 @@ +{ + "name": "usb" +} diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp index e639f7794d..ccccdf6588 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp @@ -21,7 +21,7 @@ // mbed Includes #include "mbed_assert.h" -#include "rtos/rtos_idle.h" +#include "rtos/source/rtos_idle.h" #include "platform/mbed_power_mgmt.h" #include "mbed_critical.h" @@ -368,7 +368,7 @@ bool NRFCordioHCIDriver::get_random_static_address(ble::address_t& address) return true; } -ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() { +ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() { static NRFCordioHCITransportDriver transport_driver; static NRFCordioHCIDriver hci_driver( diff --git a/tools/build_api.py b/tools/build_api.py index d4b94e24ed..ac85cdfaf5 100755 --- a/tools/build_api.py +++ b/tools/build_api.py @@ -1068,10 +1068,16 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None, incdirs = cmsis_res.inc_dirs + hal_res.inc_dirs + library_incdirs + # Exclude USB related source files from Mbed OS 2 build as they contain + # references to RTOS API which is also not included. + exclude_paths = [join(MBED_DRIVERS, "source", "usb")] + # Build Things notify.info("Building library %s (%s, %s)" % ('MBED', target.name, toolchain_name)) - objects = toolchain.compile_sources(mbed_resources, incdirs) + objects = toolchain.compile_sources( + mbed_resources, incdirs, exclude_paths + ) separate_objects = [] for obj in objects: diff --git a/tools/toolchains/mbed_toolchain.py b/tools/toolchains/mbed_toolchain.py index 9110472267..24a645a22d 100755 --- a/tools/toolchains/mbed_toolchain.py +++ b/tools/toolchains/mbed_toolchain.py @@ -397,14 +397,27 @@ class mbedToolchain: # THIS METHOD IS BEING CALLED BY THE MBED ONLINE BUILD SYSTEM # ANY CHANGE OF PARAMETERS OR RETURN VALUES WILL BREAK COMPATIBILITY - def compile_sources(self, resources, inc_dirs=None): + def compile_sources(self, resources, inc_dirs=None, exclude_paths=None): # Web IDE progress bar for project build files_to_compile = ( resources.get_file_refs(FileType.ASM_SRC) + resources.get_file_refs(FileType.C_SRC) + resources.get_file_refs(FileType.CPP_SRC) ) - self.to_be_compiled = len(files_to_compile) + # Remove files from paths to be excluded from the build and create + # a compilation queue. + compile_queue = ( + files_to_compile + if not exclude_paths + else [ + file_to_compile + for exclude_path in exclude_paths + for file_to_compile in files_to_compile + if exclude_path not in file_to_compile.path + ] + ) + + self.to_be_compiled = len(compile_queue) self.compiled = 0 self.notify.cc_verbose("Macros: " + ' '.join([ @@ -434,8 +447,8 @@ class mbedToolchain: self.dump_build_profile() # Sort compile queue for consistency - files_to_compile.sort() - for source in files_to_compile: + compile_queue.sort() + for source in compile_queue: object = self.relative_object_path(self.build_dir, source) # Queue mode (multiprocessing) From 2a9207bbe492e9109b0d8e4616f523ea2de6f0e6 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Tue, 30 Jul 2019 10:59:01 +0100 Subject: [PATCH 08/10] Address comments on workaround for Mbed OS 2 CI build after Public (#11114) * Modify compilation API to provide a list of paths to exclude from the build. * `_exclude_files_from_build` becomes a static method * Replace ternary expression with simple `if/else` statement * Make unit test case for dirs exclusion independent of system files --- tools/build_api.py | 2 +- tools/test/build_api/build_api_test.py | 51 ++++++++++++++++++++++++- tools/toolchains/mbed_toolchain.py | 52 ++++++++++++++++++-------- 3 files changed, 86 insertions(+), 19 deletions(-) diff --git a/tools/build_api.py b/tools/build_api.py index ac85cdfaf5..8aeb3537c6 100755 --- a/tools/build_api.py +++ b/tools/build_api.py @@ -1075,7 +1075,7 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None, # Build Things notify.info("Building library %s (%s, %s)" % ('MBED', target.name, toolchain_name)) - objects = toolchain.compile_sources( + objects = toolchain.compile_legacy_sources( mbed_resources, incdirs, exclude_paths ) separate_objects = [] diff --git a/tools/test/build_api/build_api_test.py b/tools/test/build_api/build_api_test.py index 8b36d01ade..b67ffae927 100755 --- a/tools/test/build_api/build_api_test.py +++ b/tools/test/build_api/build_api_test.py @@ -20,8 +20,8 @@ from collections import namedtuple from mock import patch, MagicMock from tools.build_api import prepare_toolchain, build_project, build_library from tools.regions import merge_region_list -from tools.resources import Resources -from tools.toolchains import TOOLCHAINS +from tools.resources import Resources, FileRef +from tools.toolchains import TOOLCHAINS, mbedToolchain from tools.notifier.mock import MockNotifier from tools.config import Region, Config, ConfigException from tools.utils import ToolException @@ -84,6 +84,53 @@ class BuildApiTests(unittest.TestCase): assert any('percent' in msg and msg['percent'] == 100.0 for msg in notify.messages if msg) + @patch('tools.toolchains.arm.ARM_STD.parse_dependencies', + return_value=["foo"]) + @patch('tools.toolchains.mbedToolchain.need_update', + side_effect=[i % 2 for i in range(3000)]) + @patch('os.mkdir') + @patch('tools.toolchains.mbedToolchain.dump_build_profile') + @patch('tools.utils.run_cmd', return_value=(b'', b'', 0)) + def test_compile_legacy_sources_always_complete_build(self, *_): + """Test that compile_legacy_sources() completes.""" + notify = MockNotifier() + toolchain = prepare_toolchain(self.src_paths, self.build_path, self.target, + self.toolchain_name, notify=notify) + + res = Resources(MockNotifier()).scan_with_toolchain( + self.src_paths, toolchain) + + toolchain.RESPONSE_FILES=False + toolchain.config_processed = True + toolchain.config_file = "junk" + toolchain.compile_legacy_sources(res) + + assert any('percent' in msg and msg['percent'] == 100.0 + for msg in notify.messages if msg) + + def test_dirs_exclusion_from_file_to_compile(self): + """Test that dirs can be excluded from the build.""" + files_to_compile = [ + FileRef( + name="platform/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.S", + path="./platform/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.S", + ), + FileRef( + name="rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/targets_irq_cm4f.S", + path="./rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/targets_irq_cm4f.S", + ), + ] + exclude_dirs = ["platform/", "drivers/", "targets/"] + expected_compilation_queue = [ + FileRef( + name="rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/targets_irq_cm4f.S", + path="./rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/targets_irq_cm4f.S", + ) + ] + compilation_queue = mbedToolchain._exclude_files_from_build( + files_to_compile, exclude_dirs + ) + self.assertEqual(compilation_queue, expected_compilation_queue) @patch('tools.build_api.Config') def test_prepare_toolchain_app_config(self, mock_config_init): diff --git a/tools/toolchains/mbed_toolchain.py b/tools/toolchains/mbed_toolchain.py index 24a645a22d..7352338831 100755 --- a/tools/toolchains/mbed_toolchain.py +++ b/tools/toolchains/mbed_toolchain.py @@ -395,29 +395,49 @@ class mbedToolchain: cmd_list = (c.replace("\\", "/") for c in objects if c) return self.make_option_file(list(cmd_list), ".archive_files.txt") + def compile_legacy_sources( + self, resources, inc_dirs=None, exclude_dirs=None + ): + """Compile source files with option to exclude some directories. + + This method only exists to not break API compatibility and provide a + way to exclude directories for Mbed OS 2 builds. + """ + return self._compile_sources( + resources, inc_dirs=inc_dirs, exclude_dirs=exclude_dirs + ) + # THIS METHOD IS BEING CALLED BY THE MBED ONLINE BUILD SYSTEM # ANY CHANGE OF PARAMETERS OR RETURN VALUES WILL BREAK COMPATIBILITY - def compile_sources(self, resources, inc_dirs=None, exclude_paths=None): + def compile_sources(self, resources, inc_dirs=None): + """Compile source files.""" + return self._compile_sources(resources, inc_dirs=inc_dirs) + + @staticmethod + def _exclude_files_from_build(files_to_compile, exclude_dirs): + """Remove files from dirs to be excluded for the build.""" + return [ + file_to_compile + for file_to_compile in files_to_compile + if all( + exclude_dir not in file_to_compile.path + for exclude_dir in exclude_dirs + ) + ] + + def _compile_sources(self, resources, inc_dirs=None, exclude_dirs=None): # Web IDE progress bar for project build files_to_compile = ( resources.get_file_refs(FileType.ASM_SRC) + resources.get_file_refs(FileType.C_SRC) + resources.get_file_refs(FileType.CPP_SRC) ) - # Remove files from paths to be excluded from the build and create - # a compilation queue. - compile_queue = ( - files_to_compile - if not exclude_paths - else [ - file_to_compile - for exclude_path in exclude_paths - for file_to_compile in files_to_compile - if exclude_path not in file_to_compile.path - ] - ) + if exclude_dirs: + compilation_queue = self._exclude_files_from_build(files_to_compile, exclude_dirs) + else: + compilation_queue = files_to_compile - self.to_be_compiled = len(compile_queue) + self.to_be_compiled = len(compilation_queue) self.compiled = 0 self.notify.cc_verbose("Macros: " + ' '.join([ @@ -447,8 +467,8 @@ class mbedToolchain: self.dump_build_profile() # Sort compile queue for consistency - compile_queue.sort() - for source in compile_queue: + compilation_queue.sort() + for source in compilation_queue: object = self.relative_object_path(self.build_dir, source) # Queue mode (multiprocessing) From f0f408b2d8d6f0648edc79a0e57185fc2f1512fd Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Thu, 1 Aug 2019 11:09:13 +0100 Subject: [PATCH 09/10] Upstream PR #11073 review request changes (#11135) * Modify Doxygen grouping of `drivers` Public/Internal APIs * Correct classification of `mbed_events.h` * Amend name of Doxygen group containing Device Key API * Classify `CallChain.h` as public API and relocate file * Remove Doxygen group from `equeue_platform.h` as it has no Doxygen compliant documentation * Move USB target specific code back to `usb/device/targets` --- drivers/BusIn.h | 6 +----- drivers/BusInOut.h | 2 +- drivers/BusOut.h | 2 +- drivers/Ethernet.h | 14 ++++++++++++++ drivers/InterruptIn.h | 6 +----- drivers/InterruptManager.h | 4 ++-- drivers/SerialWireOutput.h | 2 +- drivers/Watchdog.h | 5 +---- drivers/internal/AsyncOp.h | 6 +++++- drivers/internal/ByteBuffer.h | 2 +- drivers/internal/EndpointResolver.h | 2 +- drivers/internal/LinkEntry.h | 2 +- drivers/internal/LinkedList.h | 6 +----- drivers/internal/LinkedListBase.h | 2 +- drivers/internal/MIDIMessage.h | 2 +- drivers/internal/OperationList.h | 7 +++++++ drivers/internal/OperationListBase.h | 7 +++++++ drivers/internal/PolledQueue.h | 11 ++--------- drivers/internal/Task.h | 3 +-- drivers/internal/TaskBase.h | 4 ++-- drivers/internal/TaskQueue.h | 4 ++-- drivers/internal/USBDevice.h | 5 +---- drivers/source/usb/mbed_lib.json | 2 +- events/internal/equeue_platform.h | 8 -------- events/mbed_events.h | 3 +-- features/device_key/source/DeviceKey.h | 14 ++++++++++++-- platform/{internal => }/CallChain.h | 6 +----- platform/internal/CThunkBase.h | 10 +++++----- platform/source/CallChain.cpp | 2 +- .../TARGET_Freescale/USBEndpoints_Kinetis.h | 0 .../device/targets}/TARGET_Freescale/USBPhyHw.h | 0 .../targets}/TARGET_Freescale/USBPhy_Kinetis.cpp | 0 .../TARGET_NORDIC}/TARGET_MCU_NRF52840/USBPhyHw.h | 0 .../TARGET_MCU_NRF52840/USBPhy_Nordic.cpp | 0 .../targets}/TARGET_NXP/USBEndpoints_LPC17_LPC23.h | 0 .../device/targets}/TARGET_NXP/USBHAL_LPC17.cpp | 0 .../device/targets}/TARGET_NXP/USBPhyHw.h | 0 .../TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h | 0 .../TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h | 0 .../TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp | 0 .../TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h | 0 .../targets}/TARGET_STM/USBEndpoints_STM32.h | 0 .../device/targets}/TARGET_STM/USBPhyHw.h | 0 .../device/targets}/TARGET_STM/USBPhy_STM32.cpp | 0 .../device/targets}/TARGET_Template/USBPhyHw.h | 0 .../targets}/TARGET_Template/USBPhy_template.cpp | 0 usb/device/targets/mbed_lib.json | 3 +++ 47 files changed, 79 insertions(+), 73 deletions(-) rename platform/{internal => }/CallChain.h (98%) rename {targets => usb/device/targets}/TARGET_Freescale/USBEndpoints_Kinetis.h (100%) rename {targets => usb/device/targets}/TARGET_Freescale/USBPhyHw.h (100%) rename {targets => usb/device/targets}/TARGET_Freescale/USBPhy_Kinetis.cpp (100%) rename {targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52 => usb/device/targets/TARGET_NORDIC}/TARGET_MCU_NRF52840/USBPhyHw.h (100%) rename {targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52 => usb/device/targets/TARGET_NORDIC}/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp (100%) rename {targets => usb/device/targets}/TARGET_NXP/USBEndpoints_LPC17_LPC23.h (100%) rename {targets => usb/device/targets}/TARGET_NXP/USBHAL_LPC17.cpp (100%) rename {targets => usb/device/targets}/TARGET_NXP/USBPhyHw.h (100%) rename {targets => usb/device/targets}/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h (100%) rename {targets => usb/device/targets}/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h (100%) rename {targets => usb/device/targets}/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp (100%) rename {targets => usb/device/targets}/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h (100%) rename {targets => usb/device/targets}/TARGET_STM/USBEndpoints_STM32.h (100%) rename {targets => usb/device/targets}/TARGET_STM/USBPhyHw.h (100%) rename {targets => usb/device/targets}/TARGET_STM/USBPhy_STM32.cpp (100%) rename {targets => usb/device/targets}/TARGET_Template/USBPhyHw.h (100%) rename {targets => usb/device/targets}/TARGET_Template/USBPhy_template.cpp (100%) create mode 100644 usb/device/targets/mbed_lib.json diff --git a/drivers/BusIn.h b/drivers/BusIn.h index 0e7d7f4875..575203343c 100644 --- a/drivers/BusIn.h +++ b/drivers/BusIn.h @@ -23,13 +23,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \defgroup drivers-public-api-bus Bus - * \ingroup drivers-public-api - */ - /** * \defgroup drivers_BusIn BusIn class - * \ingroup drivers-public-api-bus + * \ingroup drivers-public-api-gpio * @{ */ diff --git a/drivers/BusInOut.h b/drivers/BusInOut.h index e42a9a52ad..59bcbce9dc 100644 --- a/drivers/BusInOut.h +++ b/drivers/BusInOut.h @@ -24,7 +24,7 @@ namespace mbed { /** * \defgroup drivers_BusInOut BusInOut class - * \ingroup drivers-public-api-bus + * \ingroup drivers-public-api-gpio * @{ */ diff --git a/drivers/BusOut.h b/drivers/BusOut.h index 459a6d7813..f9c2fdcee6 100644 --- a/drivers/BusOut.h +++ b/drivers/BusOut.h @@ -24,7 +24,7 @@ namespace mbed { /** * \defgroup drivers_BusOut BusOut class - * \ingroup drivers-public-api-bus + * \ingroup drivers-public-api-gpio * @{ */ diff --git a/drivers/Ethernet.h b/drivers/Ethernet.h index ff8cbd2cc2..5a14517261 100644 --- a/drivers/Ethernet.h +++ b/drivers/Ethernet.h @@ -32,6 +32,11 @@ namespace mbed { */ /** An ethernet interface, to use with the ethernet pins. + * + * @deprecated + * EthInterface is now the preferred way to get an Ethernet object. + * Alternatively, use NetworkInterface to get an instance of an appropriate network + * interface (WiFi or Ethernet). * * @note Synchronization level: Not protected * @@ -72,10 +77,12 @@ public: /** Initialize the ethernet interface. */ + MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") Ethernet(); /** Powers the hardware down. */ + MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") virtual ~Ethernet(); enum Mode { @@ -96,6 +103,7 @@ public: * @returns * The number of written bytes. */ + MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int write(const char *data, int size); /** Send an outgoing ethernet packet. @@ -107,6 +115,7 @@ public: * 0 if the sending was failed, * or the size of the packet successfully sent. */ + MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int send(); /** Receives an arrived ethernet packet. @@ -119,6 +128,7 @@ public: * 0 if no ethernet packet is arrived, * or the size of the arrived packet. */ + MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int receive(); /** Read from an received ethernet packet. @@ -134,12 +144,14 @@ public: * Each time read will start reading after the last read byte before. * */ + MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int read(char *data, int size); /** Gives the ethernet address of the mbed. * * @param mac Must be a pointer to a 6 byte char array to copy the ethernet address in. */ + MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") void address(char *mac); /** Returns if an ethernet link is present or not. It takes a while after Ethernet initialization to show up. @@ -165,6 +177,7 @@ public: * } * @endcode */ + MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int link(); /** Sets the speed and duplex parameters of an ethernet link @@ -177,6 +190,7 @@ public: * * @param mode the speed and duplex mode to set the link to: */ + MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") void set_link(Mode mode); }; diff --git a/drivers/InterruptIn.h b/drivers/InterruptIn.h index 7537ce96e8..cb1849a420 100644 --- a/drivers/InterruptIn.h +++ b/drivers/InterruptIn.h @@ -29,13 +29,9 @@ #include "platform/NonCopyable.h" namespace mbed { -/** \defgroup drivers-public-api-interrupt Interrupt - * \ingroup drivers-public-api - */ - /** * \defgroup drivers_InterruptIn InterruptIn class - * \ingroup drivers-public-api-interrupt + * \ingroup drivers-public-api-gpio * @{ */ diff --git a/drivers/InterruptManager.h b/drivers/InterruptManager.h index 08487875a5..d6ff5c9dd7 100644 --- a/drivers/InterruptManager.h +++ b/drivers/InterruptManager.h @@ -18,7 +18,7 @@ #define MBED_INTERRUPTMANAGER_H #include "cmsis.h" -#include "platform/internal/CallChain.h" +#include "platform/CallChain.h" #include "platform/PlatformMutex.h" #include "platform/NonCopyable.h" #include @@ -26,7 +26,7 @@ namespace mbed { /** * \defgroup drivers_InterruptManager InterruptManager class - * \ingroup drivers-public-api-interrupt + * \ingroup drivers-public-api-gpio * @{ */ diff --git a/drivers/SerialWireOutput.h b/drivers/SerialWireOutput.h index 69d607e60d..6b43094daa 100644 --- a/drivers/SerialWireOutput.h +++ b/drivers/SerialWireOutput.h @@ -27,7 +27,7 @@ namespace mbed { /** * \defgroup drivers_SerialWireOutput SerialWireOutput class - * \ingroup drivers-public-api-uart + * \ingroup drivers-public-api * @{ */ diff --git a/drivers/Watchdog.h b/drivers/Watchdog.h index 97f971830e..699f19864c 100644 --- a/drivers/Watchdog.h +++ b/drivers/Watchdog.h @@ -28,11 +28,9 @@ #include namespace mbed { -/** \ingroup mbed-os-public */ -/** \addtogroup drivers-public-api */ -/** @{*/ /** * \defgroup drivers_Watchdog Watchdog class + * \ingroup drivers-public-api * @{ */ @@ -154,7 +152,6 @@ private: bool _running; }; -/** @}*/ /** @}*/ } // namespace mbed diff --git a/drivers/internal/AsyncOp.h b/drivers/internal/AsyncOp.h index 507c3f8f42..9e858a102c 100644 --- a/drivers/internal/AsyncOp.h +++ b/drivers/internal/AsyncOp.h @@ -31,9 +31,13 @@ * \ingroup mbed-os-internal */ +/** \defgroup drivers-internal-api-usb USB + * \ingroup drivers-internal-api + */ + /** * \defgroup drivers_AsyncOp AsyncOp class - * \ingroup drivers-internal-api + * \ingroup drivers-internal-api-usb * @{ */ class AsyncOp: public LinkEntry { diff --git a/drivers/internal/ByteBuffer.h b/drivers/internal/ByteBuffer.h index 6cfd5e994f..45f2cb19b7 100644 --- a/drivers/internal/ByteBuffer.h +++ b/drivers/internal/ByteBuffer.h @@ -22,7 +22,7 @@ /** * \defgroup drivers_ByteBuffer ByteBuffer class - * \ingroup drivers-internal-api + * \ingroup drivers-internal-api-usb * @{ */ class ByteBuffer { diff --git a/drivers/internal/EndpointResolver.h b/drivers/internal/EndpointResolver.h index a3c7b7f475..7ea13f4287 100644 --- a/drivers/internal/EndpointResolver.h +++ b/drivers/internal/EndpointResolver.h @@ -22,7 +22,7 @@ /** * \defgroup drivers_EndpointResolver EndpointResolver class - * \ingroup drivers-internal-api + * \ingroup drivers-internal-api-usb * @{ */ diff --git a/drivers/internal/LinkEntry.h b/drivers/internal/LinkEntry.h index f093607452..f3fc947571 100644 --- a/drivers/internal/LinkEntry.h +++ b/drivers/internal/LinkEntry.h @@ -22,7 +22,7 @@ /** * \defgroup drivers_LinkEntry LinkEntry class - * \ingroup drivers-internal-api-list + * \ingroup drivers-internal-api-usb * @{ */ class LinkEntry { diff --git a/drivers/internal/LinkedList.h b/drivers/internal/LinkedList.h index fe84a28dfc..2347861910 100644 --- a/drivers/internal/LinkedList.h +++ b/drivers/internal/LinkedList.h @@ -21,13 +21,9 @@ #include "LinkEntry.h" #include "LinkedListBase.h" -/** \defgroup drivers-internal-api-list List - * \ingroup drivers-internal-api - */ - /** * \defgroup drivers_LinkedList LinkedList class - * \ingroup drivers-internal-api-list + * \ingroup drivers-internal-api-usb * @{ */ template diff --git a/drivers/internal/LinkedListBase.h b/drivers/internal/LinkedListBase.h index 99eebe7730..27d86103d9 100644 --- a/drivers/internal/LinkedListBase.h +++ b/drivers/internal/LinkedListBase.h @@ -22,7 +22,7 @@ /** * \defgroup drivers_LinkedListBase LinkedListBase class - * \ingroup drivers-internal-api-list + * \ingroup drivers-internal-api-usb * @{ */ class LinkedListBase { diff --git a/drivers/internal/MIDIMessage.h b/drivers/internal/MIDIMessage.h index 490a395262..14b08a1e2b 100644 --- a/drivers/internal/MIDIMessage.h +++ b/drivers/internal/MIDIMessage.h @@ -43,7 +43,7 @@ /** * \defgroup drivers_MIDIMessage MIDIMessage class - * \ingroup drivers-internal-api + * \ingroup drivers-internal-usb * @{ */ diff --git a/drivers/internal/OperationList.h b/drivers/internal/OperationList.h index bbb543a9f2..9f5e7563cb 100644 --- a/drivers/internal/OperationList.h +++ b/drivers/internal/OperationList.h @@ -21,6 +21,11 @@ #include "OperationListBase.h" #include "AsyncOp.h" +/** + * \defgroup drivers_OperationList OperationList class + * \ingroup drivers-internal-api-usb + * @{ + */ template class OperationList: public OperationListBase { public: @@ -84,4 +89,6 @@ public: }; +/** @}*/ + #endif diff --git a/drivers/internal/OperationListBase.h b/drivers/internal/OperationListBase.h index 0e973aa28a..e964cc961e 100644 --- a/drivers/internal/OperationListBase.h +++ b/drivers/internal/OperationListBase.h @@ -22,6 +22,11 @@ class AsyncOp; +/** + * \defgroup drivers_OperationListBase OperationListBase class + * \ingroup drivers-internal-api-usb + * @{ + */ class OperationListBase { public: @@ -93,4 +98,6 @@ private: LinkedListBase _list; }; +/** @}*/ + #endif diff --git a/drivers/internal/PolledQueue.h b/drivers/internal/PolledQueue.h index f7dd1f4069..d8964218b0 100644 --- a/drivers/internal/PolledQueue.h +++ b/drivers/internal/PolledQueue.h @@ -22,15 +22,9 @@ #include "platform/Callback.h" #include "LinkedList.h" namespace events { -/** \addtogroup events-internal-api Events - * \ingroup mbed-os-internal - * @{ - */ - - /** - * \defgroup events_PolledQueue PolledQueue class - * \ingroup events-internal-api + * \defgroup drivers_PolledQueue PolledQueue class + * \ingroup drivers-internal-api-usb * @{ */ @@ -75,7 +69,6 @@ protected: }; -/** @}*/ /** @}*/ } diff --git a/drivers/internal/Task.h b/drivers/internal/Task.h index 04b48cb38a..be2c932563 100644 --- a/drivers/internal/Task.h +++ b/drivers/internal/Task.h @@ -24,8 +24,7 @@ #include "platform/Callback.h" namespace events { -/** \addtogroup events-internal-api - * \ingroup mbed-os-internal +/** \addtogroup drivers-internal-api-usb * @{ */ diff --git a/drivers/internal/TaskBase.h b/drivers/internal/TaskBase.h index 51ae547009..e8a38b4adf 100644 --- a/drivers/internal/TaskBase.h +++ b/drivers/internal/TaskBase.h @@ -31,8 +31,8 @@ namespace events { class TaskQueue; /** - * \defgroup events_TaskBase TaskBase class - * \ingroup events-internal-api + * \defgroup drivers_TaskBase TaskBase class + * \ingroup drivers-internal-api-usb * @{ */ diff --git a/drivers/internal/TaskQueue.h b/drivers/internal/TaskQueue.h index dbacef3b75..530a920440 100644 --- a/drivers/internal/TaskQueue.h +++ b/drivers/internal/TaskQueue.h @@ -27,8 +27,8 @@ namespace events { /** - * \defgroup events_TaskQueue TaskQueue class - * \ingroup events-internal-api + * \defgroup drivers_TaskQueue TaskQueue class + * \ingroup drivers-internal-api-usb * @{ */ diff --git a/drivers/internal/USBDevice.h b/drivers/internal/USBDevice.h index d0de70cdc8..91a603e661 100644 --- a/drivers/internal/USBDevice.h +++ b/drivers/internal/USBDevice.h @@ -23,11 +23,9 @@ #include "USBPhy.h" #include "mbed_critical.h" -/** \ingroup drivers */ -/** \addtogroup drivers-internal-api */ -/** @{*/ /** * \defgroup drivers_USBDevice USBDevice class + * \ingroup drivers-internal-api-usb * @{ */ @@ -612,7 +610,6 @@ private: uint32_t _locked; }; -/** @}*/ /** @}*/ #endif diff --git a/drivers/source/usb/mbed_lib.json b/drivers/source/usb/mbed_lib.json index dc0cd0d8b6..32a28d417d 100644 --- a/drivers/source/usb/mbed_lib.json +++ b/drivers/source/usb/mbed_lib.json @@ -1,3 +1,3 @@ { - "name": "usb" + "name": "drivers-usb" } diff --git a/events/internal/equeue_platform.h b/events/internal/equeue_platform.h index 18e986a8ef..aebd70a364 100644 --- a/events/internal/equeue_platform.h +++ b/events/internal/equeue_platform.h @@ -25,12 +25,6 @@ extern "C" { #include #include -/** - * \addtogroup events-internal-api Events - * \ingroup mbed-os-internal - * @{ - */ - // Currently supported platforms // // Uncomment to select a supported platform or reimplement this file @@ -153,8 +147,6 @@ void equeue_sema_destroy(equeue_sema_t *sema); void equeue_sema_signal(equeue_sema_t *sema); bool equeue_sema_wait(equeue_sema_t *sema, int ms); -/** @}*/ - #ifdef __cplusplus } #endif diff --git a/events/mbed_events.h b/events/mbed_events.h index fdcbcae0b0..6243c7ab21 100644 --- a/events/mbed_events.h +++ b/events/mbed_events.h @@ -23,8 +23,7 @@ #include "events/mbed_shared_queues.h" -/** \ingroup mbed-os-internal */ -/** \addtogroup events-internal-api */ +/** \addtogroup events-public-api */ /** @{*/ #ifndef MBED_NO_GLOBAL_USING_DIRECTIVE using namespace events; diff --git a/features/device_key/source/DeviceKey.h b/features/device_key/source/DeviceKey.h index 861d1592a0..9d17aaf151 100644 --- a/features/device_key/source/DeviceKey.h +++ b/features/device_key/source/DeviceKey.h @@ -32,7 +32,11 @@ #if (DEVICEKEY_ENABLED) || defined(DOXYGEN_ONLY) namespace mbed { -/** \addtogroup device-key Device Key */ +/** \addtogroup device-security Device Key + * \ingroup mbed-os-public + * @{ + */ + #define DEVICE_KEY_16BYTE 16 #define DEVICE_KEY_32BYTE 32 @@ -58,7 +62,11 @@ enum DeviceKeyStatus { * @note Synchronization level: Thread safe * @ingroup device-key */ - +/** + * \defgroup device-security_DeviceKey DeviceKey class + * \addtogroup device-security + * @{ + */ class DeviceKey : private mbed::NonCopyable { public: @@ -143,6 +151,8 @@ private: int generate_key_by_random(uint32_t *output, size_t size); }; + +/** @}*/ /** @}*/ } diff --git a/platform/internal/CallChain.h b/platform/CallChain.h similarity index 98% rename from platform/internal/CallChain.h rename to platform/CallChain.h index e1bfce06b7..cd9e67af86 100644 --- a/platform/internal/CallChain.h +++ b/platform/CallChain.h @@ -28,11 +28,9 @@ namespace mbed { typedef Callback *pFunctionPointer_t; class CallChainLink; -/** \ingroup mbed-os-internal */ -/** \addtogroup platform-internal-api Platform */ -/** @{*/ /** * \defgroup platform_CallChain CallChain class + * \ingroup platform-public-api * @{ */ @@ -260,8 +258,6 @@ private: /**@}*/ -/**@}*/ - } // namespace mbed #endif diff --git a/platform/internal/CThunkBase.h b/platform/internal/CThunkBase.h index 918924d905..ef0f326646 100644 --- a/platform/internal/CThunkBase.h +++ b/platform/internal/CThunkBase.h @@ -18,14 +18,16 @@ #ifndef __CTHUNK_BASE_H__ #define __CTHUNK_BASE_H__ +/** \addtogroup platform-internal-api Platform + * \ingroup mbed-os-internal + */ + /* IRQ/Exception compatible thunk entry function */ typedef void (*CThunkEntry)(void); -/** \ingroup mbed-os-internal */ -/** \addtogroup platform-internal-api */ -/** @{*/ /** * \defgroup platform_CThunkBase CThunkBase class + * \ingroup platform-internal-api * @{ */ class CThunkBase { @@ -83,6 +85,4 @@ private: /**@}*/ -/**@}*/ - #endif/*__CTHUNK_BASE_H__*/ diff --git a/platform/source/CallChain.cpp b/platform/source/CallChain.cpp index 5c892d7820..90d00acd02 100644 --- a/platform/source/CallChain.cpp +++ b/platform/source/CallChain.cpp @@ -21,7 +21,7 @@ #undef MBED_DEPRECATED_SINCE #define MBED_DEPRECATED_SINCE(...) -#include "platform/internal/CallChain.h" +#include "platform/CallChain.h" #include "cmsis.h" #include "platform/mbed_critical.h" diff --git a/targets/TARGET_Freescale/USBEndpoints_Kinetis.h b/usb/device/targets/TARGET_Freescale/USBEndpoints_Kinetis.h similarity index 100% rename from targets/TARGET_Freescale/USBEndpoints_Kinetis.h rename to usb/device/targets/TARGET_Freescale/USBEndpoints_Kinetis.h diff --git a/targets/TARGET_Freescale/USBPhyHw.h b/usb/device/targets/TARGET_Freescale/USBPhyHw.h similarity index 100% rename from targets/TARGET_Freescale/USBPhyHw.h rename to usb/device/targets/TARGET_Freescale/USBPhyHw.h diff --git a/targets/TARGET_Freescale/USBPhy_Kinetis.cpp b/usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp similarity index 100% rename from targets/TARGET_Freescale/USBPhy_Kinetis.cpp rename to usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/USBPhyHw.h b/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhyHw.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/USBPhyHw.h rename to usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhyHw.h diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp b/usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp rename to usb/device/targets/TARGET_NORDIC/TARGET_MCU_NRF52840/USBPhy_Nordic.cpp diff --git a/targets/TARGET_NXP/USBEndpoints_LPC17_LPC23.h b/usb/device/targets/TARGET_NXP/USBEndpoints_LPC17_LPC23.h similarity index 100% rename from targets/TARGET_NXP/USBEndpoints_LPC17_LPC23.h rename to usb/device/targets/TARGET_NXP/USBEndpoints_LPC17_LPC23.h diff --git a/targets/TARGET_NXP/USBHAL_LPC17.cpp b/usb/device/targets/TARGET_NXP/USBHAL_LPC17.cpp similarity index 100% rename from targets/TARGET_NXP/USBHAL_LPC17.cpp rename to usb/device/targets/TARGET_NXP/USBHAL_LPC17.cpp diff --git a/targets/TARGET_NXP/USBPhyHw.h b/usb/device/targets/TARGET_NXP/USBPhyHw.h similarity index 100% rename from targets/TARGET_NXP/USBPhyHw.h rename to usb/device/targets/TARGET_NXP/USBPhyHw.h diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h b/usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h similarity index 100% rename from targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h rename to usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBEndpoints_RZ_A1.h diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h b/usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h similarity index 100% rename from targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h rename to usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhyHw.h diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp b/usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp similarity index 100% rename from targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp rename to usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1.cpp diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h b/usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h similarity index 100% rename from targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h rename to usb/device/targets/TARGET_RENESAS/TARGET_RZ_A1XX/USBPhy_RZ_A1_Def.h diff --git a/targets/TARGET_STM/USBEndpoints_STM32.h b/usb/device/targets/TARGET_STM/USBEndpoints_STM32.h similarity index 100% rename from targets/TARGET_STM/USBEndpoints_STM32.h rename to usb/device/targets/TARGET_STM/USBEndpoints_STM32.h diff --git a/targets/TARGET_STM/USBPhyHw.h b/usb/device/targets/TARGET_STM/USBPhyHw.h similarity index 100% rename from targets/TARGET_STM/USBPhyHw.h rename to usb/device/targets/TARGET_STM/USBPhyHw.h diff --git a/targets/TARGET_STM/USBPhy_STM32.cpp b/usb/device/targets/TARGET_STM/USBPhy_STM32.cpp similarity index 100% rename from targets/TARGET_STM/USBPhy_STM32.cpp rename to usb/device/targets/TARGET_STM/USBPhy_STM32.cpp diff --git a/targets/TARGET_Template/USBPhyHw.h b/usb/device/targets/TARGET_Template/USBPhyHw.h similarity index 100% rename from targets/TARGET_Template/USBPhyHw.h rename to usb/device/targets/TARGET_Template/USBPhyHw.h diff --git a/targets/TARGET_Template/USBPhy_template.cpp b/usb/device/targets/TARGET_Template/USBPhy_template.cpp similarity index 100% rename from targets/TARGET_Template/USBPhy_template.cpp rename to usb/device/targets/TARGET_Template/USBPhy_template.cpp diff --git a/usb/device/targets/mbed_lib.json b/usb/device/targets/mbed_lib.json new file mode 100644 index 0000000000..7e1564fde3 --- /dev/null +++ b/usb/device/targets/mbed_lib.json @@ -0,0 +1,3 @@ +{ + "name": "usb-device-targets" +} From df85e8e233a8513f3333b05a65018ec40fd8568a Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Thu, 1 Aug 2019 11:39:36 +0100 Subject: [PATCH 10/10] Mark Ethernet.h methods as Deprecated in Doxygen documentation (#11146) --- drivers/Ethernet.h | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/drivers/Ethernet.h b/drivers/Ethernet.h index 5a14517261..e14be3a179 100644 --- a/drivers/Ethernet.h +++ b/drivers/Ethernet.h @@ -75,12 +75,16 @@ class public: - /** Initialize the ethernet interface. + /** + * @deprecated + * Initialize the ethernet interface. */ MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") Ethernet(); - /** Powers the hardware down. + /** + * @deprecated + * Powers the hardware down. */ MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") virtual ~Ethernet(); @@ -93,7 +97,9 @@ public: FullDuplex100 }; - /** Writes into an outgoing ethernet packet. + /** + * @deprecated + * Writes into an outgoing ethernet packet. * * It will append size bytes of data to the previously written bytes. * @@ -106,7 +112,9 @@ public: MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int write(const char *data, int size); - /** Send an outgoing ethernet packet. + /** + * @deprecated + * Send an outgoing ethernet packet. * * After filling in the data in an ethernet packet it must be send. * Send will provide a new packet to write to. @@ -118,7 +126,9 @@ public: MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int send(); - /** Receives an arrived ethernet packet. + /** + * @deprecated + * Receives an arrived ethernet packet. * * Receiving an ethernet packet will drop the last received ethernet packet * and make a new ethernet packet ready to read. @@ -131,7 +141,9 @@ public: MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int receive(); - /** Read from an received ethernet packet. + /** + * @deprecated + * Read from an received ethernet packet. * * After receive returned a number bigger than 0 it is * possible to read bytes from this packet. @@ -147,14 +159,18 @@ public: MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int read(char *data, int size); - /** Gives the ethernet address of the mbed. + /** + * @deprecated + * Gives the ethernet address of the mbed. * * @param mac Must be a pointer to a 6 byte char array to copy the ethernet address in. */ MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") void address(char *mac); - /** Returns if an ethernet link is present or not. It takes a while after Ethernet initialization to show up. + /** + * @deprecated + * Returns if an ethernet link is present or not. It takes a while after Ethernet initialization to show up. * * @returns * 0 if no ethernet link is present, @@ -180,7 +196,9 @@ public: MBED_DEPRECATED("The class has been deprecated and will be removed in the future.") int link(); - /** Sets the speed and duplex parameters of an ethernet link + /** + * @deprecated + * Sets the speed and duplex parameters of an ethernet link * * - AutoNegotiate Auto negotiate speed and duplex * - HalfDuplex10 10 Mbit, half duplex