diff --git a/.travis.yml b/.travis.yml index 19d3a75a4d4..31b754d8cbe 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 95806c5b7c5..b3897f40fe7 100644 --- a/UNITTESTS/CMakeLists.txt +++ b/UNITTESTS/CMakeLists.txt @@ -101,7 +101,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 e156d8f4802..c0a19d3f54c 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 ff6bc0cc108..9dfdf579ed0 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 18801a8ba25..2f70302ce70 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 1d88ba052ce..f1e1a4a635e 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 8f247e5975b..172a2e5cfdd 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 @@ class AnalogIn { * * @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 @@ class AnalogIn { analogin_t _adc; static SingletonPtr _mutex; #endif //!defined(DOXYGEN_ONLY) + }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/AnalogOut.h b/drivers/AnalogOut.h index d12cbafcc4d..7b0e5d70f7e 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 @@ class AnalogOut { * 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 @@ class AnalogOut { * @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 @@ class AnalogOut { #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/BusIn.h b/drivers/BusIn.h index 61bf7b536e3..85d9c9256da 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 @@ class BusIn : private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/BusInOut.h b/drivers/BusInOut.h index 618f9b8cf3b..d2470874e29 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 @@ class BusInOut : private NonCopyable { #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/BusOut.h b/drivers/BusOut.h index ca83d00a17a..cbd58ed1983 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 @@ class BusOut : private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/CAN.h b/drivers/CAN.h index 665677efc0f..2de35c8ffde 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 @@ class CANMessage : public CAN_Message { } }; +/** @}*/ + +/** + * \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 @@ class CAN : private NonCopyable { 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 348a87bf33a..ae2bf52df46 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 @@ class DigitalIn { // 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 @@ class DigitalIn { * * @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 @@ class DigitalIn { #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/DigitalInOut.h b/drivers/DigitalInOut.h index 9ceb025aee8..ccae13e997c 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 @@ class DigitalInOut { /** 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 @@ class DigitalInOut { * 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 @@ class DigitalInOut { #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/DigitalOut.h b/drivers/DigitalOut.h index b9fe1f2d3ec..87387d98d89 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 @@ class DigitalOut { * 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 @@ class DigitalOut { #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/Ethernet.h b/drivers/Ethernet.h index 30618806e52..f070bd524a3 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 @@ class Ethernet : private NonCopyable { void set_link(Mode mode); }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/FlashIAP.h b/drivers/FlashIAP.h index 0c3c8e10495..f0397eb68c3 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 @@ class FlashIAP : private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } /* namespace mbed */ #endif /* DEVICE_FLASH */ diff --git a/drivers/I2C.h b/drivers/I2C.h index 9a19bd12474..ffcbe1ae273 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 @@ class I2C : private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/I2CSlave.h b/drivers/I2CSlave.h index 78715ba9345..f2075d1d600 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 @@ class I2CSlave { #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/InterruptIn.h b/drivers/InterruptIn.h index 32cc6619eec..3c6cf092d23 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 @@ class InterruptIn : private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/InterruptManager.h b/drivers/InterruptManager.h index 8b207f0c5ea..f53d206a63c 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 @@ class InterruptManager : private NonCopyable { #if !defined(DOXYGEN_ONLY) private: InterruptManager(); + ~InterruptManager(); void lock(); @@ -203,6 +209,9 @@ class InterruptManager : private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/LowPowerTicker.h b/drivers/LowPowerTicker.h index a6f9fa94011..1c616a457b3 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 @@ class LowPowerTicker : public Ticker, private NonCopyable { } }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/LowPowerTimeout.h b/drivers/LowPowerTimeout.h index 7198d7dc64c..e678809c0f4 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 @@ class LowPowerTimeout : public LowPowerTicker, private NonCopyable { @@ -42,6 +47,9 @@ class LowPowerTimer : public Timer, private NonCopyable { }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/MbedCRC.h b/drivers/MbedCRC.h index c0726a92b9f..1d666da445d 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 @@ class MbedCRC { #endif /** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/PortIn.h b/drivers/PortIn.h index f3ae250e98d..bf77d70e3f5 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 @@ class PortIn { * @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 @@ class PortIn { * * @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 @@ class PortIn { port_t _port; }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/PortInOut.h b/drivers/PortInOut.h index 2036eba2520..839d26651b1 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 @@ class PortInOut { * @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 @@ class PortInOut { /** 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 @@ class PortInOut { port_t _port; }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/PortOut.h b/drivers/PortOut.h index 18a0bcd3c5d..3b3c3ec6a04 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 @@ class PortOut { * @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 @@ class PortOut { port_t _port; }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/PwmOut.h b/drivers/PwmOut.h index ed8765594a9..d1516297744 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 @@ class PwmOut { * * @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 @@ class PwmOut { * 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 @@ class PwmOut { * @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 @@ class PwmOut { * 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 @@ class PwmOut { #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 e247e8f6515..1084e0eec9c 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 @@ class QSPI : private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/RawSerial.h b/drivers/RawSerial.h index 0e6c9c7c8ff..061d93fa063 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 @@ class RawSerial: public SerialBase, private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/SPI.h b/drivers/SPI.h index 6b647a3adca..d9117ac84d3 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 { @@ -419,6 +424,9 @@ class SPI : private NonCopyable { #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif // DEVICE_SPI || DOXYGEN_ONLY diff --git a/drivers/SPISlave.h b/drivers/SPISlave.h index 878bc8d6721..13d4f0f68bf 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 @@ class SPISlave : private NonCopyable { #endif //!defined(DOXYGEN_ONLY) }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/Serial.h b/drivers/Serial.h index d19010808d5..7dad33a6131 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 @@ class Serial : public SerialBase, public Stream, private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/SerialBase.h b/drivers/SerialBase.h index 99da7a9b45d..3acf9cbf1a2 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 @@ class SerialBase : private NonCopyable { virtual ~SerialBase(); int _base_getc(); + int _base_putc(int c); #if DEVICE_SERIAL_ASYNCH @@ -307,6 +314,9 @@ class SerialBase : private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/SerialWireOutput.h b/drivers/SerialWireOutput.h index 0379687c9ba..52f5416c54b 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(); - } - - virtual ssize_t write(const void *buffer, size_t size) - { - mbed_itm_send_block(ITM_PORT_SWO, buffer, size); + SerialWireOutput(void); - 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 @@ class SerialWireOutput : public FileHandle { } }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif // DEVICE_ITM diff --git a/drivers/Ticker.h b/drivers/Ticker.h index 8a68b4a00f6..455283718e1 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 @@ class Ticker : public TimerEvent, private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/Timeout.h b/drivers/Timeout.h index c155c9bcecf..673554f2341 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 @@ class Timeout : public Ticker, private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/Timer.h b/drivers/Timer.h index 010f6019b5f..8d4d22a7ca6 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 @@ class Timer : private NonCopyable { }; #endif +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/TimerEvent.h b/drivers/TimerEvent.h index 88f4c3b750d..5bd6eab7d2e 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 @@ class TimerEvent : private NonCopyable { #endif }; +/** @}*/ +/** @}*/ + } // namespace mbed #endif diff --git a/drivers/UARTSerial.h b/drivers/UARTSerial.h index 2959ce77e2c..04660d81656 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 { @@ -314,6 +318,10 @@ class UARTSerial : private SerialBase, public FileHandle, private NonCopyable namespace mbed { - -/** \addtogroup drivers */ +/** \ingroup drivers */ +/** \addtogroup drivers-public-api */ +/** @{*/ /** 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. @@ -58,6 +59,10 @@ namespace mbed { * @note Synchronization level: Interrupt safe * @ingroup drivers */ +/** + * \defgroup drivers_Watchdog Watchdog class + * @{ + */ class Watchdog : private NonCopyable { public: @@ -149,6 +154,9 @@ class Watchdog : private NonCopyable { 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 1ab5bf83656..15e460cb616 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 00000000000..97b1b8e1386 --- /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 00000000000..aaba38088e4 --- /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 a3699e3919d..19e5f94b639 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 dd9d22f306f..064503eee49 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 00000000000..418491e1650 --- /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 00000000000..1d1855a9efc --- /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 ff015092593..71565b80b0f 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 3e06825c17d..7857d22c6d3 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 f0697460be6..489926c1463 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 6353e052c3f..b6bfda976e2 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 00000000000..fc8577b8486 --- /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 00000000000..bb496720317 --- /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 00000000000..12a23d00ecc --- /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 00000000000..67e5f36b341 --- /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 1424c6c9afb..8fab077f9a7 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/SPI.cpp b/drivers/source/SPI.cpp similarity index 99% rename from drivers/SPI.cpp rename to drivers/source/SPI.cpp index ffe696bd6db..61d337dbf07 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 d0f87263b67..03ee49697ad 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 00000000000..92d6bd3c016 --- /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 b0d316e4719..6cea67d94a3 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 b9540ec0fdd..fada56cf646 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 072581087ae..d4f2276a416 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 9c77eb86f58..be3037e62f2 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 e9213555d76..5d65a8bee64 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 a8a2ff62348..0f8300c3c3c 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 { @@ -483,10 +488,16 @@ class Event { } }; +/** @}*/ + +/** + * \defgroup events_EventA0 Event class + * @{ + */ + /** Event * * Representation of an event for fine-grain dispatch control - * @ingroup events */ template class Event { @@ -939,10 +950,16 @@ class Event { } }; +/** @}*/ + +/** + * \defgroup events_EventA0A1 Event class + * @{ + */ + /** Event * * Representation of an event for fine-grain dispatch control - * @ingroup events */ template class Event { @@ -1395,10 +1412,16 @@ class Event { } }; +/** @}*/ + +/** + * \defgroup events_EventA0A1A2 Event class + * @{ + */ + /** Event * * Representation of an event for fine-grain dispatch control - * @ingroup events */ template class Event { @@ -1851,10 +1874,16 @@ class Event { } }; +/** @}*/ + +/** + * \defgroup events_EventA0A1A2A3 Event class + * @{ + */ + /** Event * * Representation of an event for fine-grain dispatch control - * @ingroup events */ template class Event { @@ -2306,12 +2335,20 @@ class Event { { new (this) Event(q, mbed::callback(obj, method), b0, b1, b2, b3, b4); } +#endif // DOXYGEN_ONLY }; +/** @}*/ + + +/** + * \defgroup events_EventA0A1A2A3A4 Event class + * @{ + */ + /** Event * * Representation of an event for fine-grain dispatch control - * @ingroup events */ template class Event { @@ -2764,12 +2801,11 @@ class Event { } }; - -/** \addtogroup events */ -/** @{ */ +/** @}*/ // Convenience functions declared here to avoid cyclic // dependency between Event and EventQueue +#if !defined(DOXYGEN_ONLY) template Event EventQueue::event(R(*func)()) { @@ -4065,9 +4101,9 @@ Event EventQueue::event(mbed::Callback(this, cb, c0, c1, c2, c3, c4); } -#endif +#endif // DOXYGEN_ONLY + +/** @}*/ } #endif - -/** @}*/ diff --git a/events/EventQueue.h b/events/EventQueue.h index 2b6b200a779..a3e879620a1 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: @@ -3402,7 +3407,9 @@ class EventQueue : private mbed::NonCopyable { #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 a2c56e3fc82..d167fe48c84 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 97% rename from events/equeue/equeue_platform.h rename to events/internal/equeue_platform.h index a63243ed9fc..e3a5c0d635f 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. @@ -27,6 +24,10 @@ extern "C" { #include +/** \ingroup events */ +/** \addtogroup events-internal-api */ +/** @{*/ + // Currently supported platforms // // Uncomment to select a supported platform or reimplement this file @@ -142,11 +143,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 466b82bb17b..39e4695edd0 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 eb8d91e7910..741bddbe5f4 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 +} -/** @}*/ +#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 1323c96bf00..6e636bc87b1 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 10f500c56f8..625c355571d 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 3d55f3a0509..4cab29b1a32 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 ca337df21f4..62bd101098c 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,13 +16,14 @@ * 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) #include #include #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 02ebad794b8..9663865a97b 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 82b5c93e0c1..6f535aacb76 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 96f18429623..5950cd5e829 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 6ca024127e6..861d1592a0c 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 5ce81c59e32..7a59261726d 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 1a14fda06e7..442f1ea47eb 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 543efc7eb34..3c2de71d861 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 @@ -30,10 +30,15 @@ #include "platform/NonCopyable.h" 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. @@ -325,7 +330,7 @@ class ConditionVariable : private mbed::NonCopyable { #endif // !defined(DOXYGEN_ONLY) }; -} -#endif - /** @}*/ +/** @}*/ +} // namespace rtos +#endif diff --git a/rtos/EventFlags.h b/rtos/EventFlags.h index bac58ea5889..f115f813299 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 @@ -123,4 +124,3 @@ class EventFlags : private mbed::NonCopyable { } #endif - diff --git a/rtos/Kernel.h b/rtos/Kernel.h index 851dfb688ed..e643ba61761 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 "cmsis_os2.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 dd105096816..2a208e5bda9 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 @@ -28,7 +28,6 @@ #include "Queue.h" #include "MemoryPool.h" #include "cmsis_os2.h" -#include "mbed_rtos_storage.h" #include "mbed_rtos1_types.h" #include "platform/mbed_toolchain.h" @@ -39,7 +38,8 @@ using namespace rtos; #endif namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_Mail Mail class @@ -237,6 +237,3 @@ class Mail : private mbed::NonCopyable > { } #endif - - - diff --git a/rtos/MemoryPool.h b/rtos/MemoryPool.h index 431b5d6894c..c6fe947f106 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,9 +29,13 @@ #include "mbed_rtos1_types.h" #include "mbed_rtos_storage.h" #include "platform/NonCopyable.h" +#include "platform/mbed_assert.h" +#include "Kernel.h" + 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 a4955a54c66..9bcc63ed852 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; @@ -177,5 +178,3 @@ class Mutex : private mbed::NonCopyable { /** @}*/ } #endif - - diff --git a/rtos/Queue.h b/rtos/Queue.h index e31fb619d66..0cdc5a49133 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 @@ -25,11 +25,12 @@ #include "cmsis_os2.h" #include "mbed_rtos1_types.h" #include "mbed_rtos_storage.h" -#include "platform/mbed_error.h" +#include "platform/mbed_assert.h" #include "platform/NonCopyable.h" 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 eb976cd0bd4..2c3ed4d828d 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 @@ -31,7 +31,8 @@ #include "mbed_rtos1_types.h" namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_RtosTimer RtosTimer class @@ -187,5 +188,3 @@ class RtosTimer : private mbed::NonCopyable { } #endif - - diff --git a/rtos/Semaphore.h b/rtos/Semaphore.h index 9eaa116d054..afafafbb535 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 @@ -150,5 +151,3 @@ class Semaphore : private mbed::NonCopyable { /** @}*/ } #endif - - diff --git a/rtos/TARGET_CORTEX/SysTimer.h b/rtos/TARGET_CORTEX/SysTimer.h index 653ffbe895a..ff52348cded 100644 --- a/rtos/TARGET_CORTEX/SysTimer.h +++ b/rtos/TARGET_CORTEX/SysTimer.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,12 +30,11 @@ namespace rtos { namespace internal { +/** \ingroup rtos */ +/** \addtogroup mbed-os-internal */ +/** @{*/ + /** - * @cond RTOS_INTERNAL - * - * @addtogroup rtos - * @{ - * * @defgroup rtos_SysTimer SysTimer class * @{ */ @@ -126,7 +125,6 @@ class SysTimer: private mbed::TimerEvent, private mbed::NonCopyable { /** * @} * @} - * @endcond */ } diff --git a/rtos/TARGET_CORTEX/mbed_boot.h b/rtos/TARGET_CORTEX/mbed_boot.h index 65f7af6fcbe..98229b39295 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_rtos_storage.h b/rtos/TARGET_CORTEX/mbed_rtos_storage.h index 2a0338baedf..bc0344585a6 100644 --- a/rtos/TARGET_CORTEX/mbed_rtos_storage.h +++ b/rtos/TARGET_CORTEX/mbed_rtos_storage.h @@ -26,31 +26,48 @@ extern "C" { #endif -/** \addtogroup rtos */ -/** @{*/ +#include "rtx_os.h" +#include "mbed_rtx_conf.h" -/** @brief RTOS primitives storage types for RTX +/** \ingroup rtos */ +/** \addtogroup mbed-os-internal */ +/** @{*/ +/** \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/TARGET_CORTEX/mbed_rtx_handlers.c b/rtos/TARGET_CORTEX/mbed_rtx_handlers.c index 31ce7f81d70..b5e46f812e8 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 7504ac71b95..bd74ddc9069 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,9 +20,9 @@ * SOFTWARE. */ -#include "rtos/rtos_idle.h" +#include "rtos/source/rtos_idle.h" #include "platform/mbed_power_mgmt.h" -#include "TimerEvent.h" +#include "drivers/TimerEvent.h" #include "lp_ticker_api.h" #include "us_ticker_api.h" #include "mbed_critical.h" diff --git a/rtos/ThisThread.h b/rtos/ThisThread.h index d566fb5397d..3124f318b73 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 @@ -24,16 +24,11 @@ #include #include "cmsis_os2.h" -#include "mbed_rtos1_types.h" -#include "mbed_rtos_storage.h" -#include "platform/Callback.h" -#include "platform/mbed_toolchain.h" -#include "platform/NonCopyable.h" -#include "rtos/Semaphore.h" -#include "rtos/Mutex.h" + namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_ThisThread ThisThread namespace @@ -190,5 +185,3 @@ const char *get_name(); /** @}*/ } #endif - - diff --git a/rtos/Thread.h b/rtos/Thread.h index 34da08aa244..00e189b160b 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 @@ -33,7 +33,8 @@ #include "rtos/Mutex.h" namespace rtos { -/** \addtogroup rtos */ +/** \ingroup rtos */ +/** \addtogroup rtos-public-api */ /** @{*/ /** * \defgroup rtos_Thread Thread class @@ -544,5 +545,3 @@ class Thread : private mbed::NonCopyable { /** @}*/ } #endif - - diff --git a/rtos/rtos.h b/rtos/rtos.h index c2d4ad5a98b..42e4d8c1d45 100644 --- a/rtos/rtos.h +++ b/rtos/rtos.h @@ -2,7 +2,7 @@ /** \addtogroup rtos */ /** @{*/ /* 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 @@ -25,7 +25,6 @@ #ifndef RTOS_H #define RTOS_H -#include "mbed_rtos_storage.h" #include "rtos/Kernel.h" #include "rtos/Thread.h" #include "rtos/ThisThread.h" @@ -42,8 +41,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 cb3bf805a06..dfcf1ce561a 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" namespace rtos { diff --git a/rtos/EventFlags.cpp b/rtos/source/EventFlags.cpp similarity index 97% rename from rtos/EventFlags.cpp rename to rtos/source/EventFlags.cpp index 1167d764ac5..128cb6d2ff7 100644 --- a/rtos/EventFlags.cpp +++ b/rtos/source/EventFlags.cpp @@ -21,8 +21,8 @@ */ #include "rtos/EventFlags.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 a620c0cf1fc..21de1b30b33 100644 --- a/rtos/Kernel.cpp +++ b/rtos/source/Kernel.cpp @@ -22,8 +22,8 @@ #include "cmsis_os2.h" #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" namespace rtos { 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 24f3085cb9b..83edcb9d3eb 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" namespace rtos { 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 0e3b89d4310..23675c5ce23 100644 --- a/rtos/ThisThread.cpp +++ b/rtos/source/ThisThread.cpp @@ -24,7 +24,7 @@ #include "rtos/ThisThread.h" #include "rtos/Kernel.h" -#include "rtos/rtos_idle.h" +#include "rtos_idle.h" #include "platform/mbed_assert.h" namespace rtos { 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 40154afe00e..678375a7687 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 e3d474300f3..d5e256cae25 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 f1f5d6fc3dc..b6b28500780 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 e56c33e646b..9574e69eb6a 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 61492b727d7..a2bfc0ac78c 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 @@ class PolledQueue: public TaskQueue { }; +/** @}*/ + } #endif - diff --git a/usb/device/utilities/events/Task.h b/usb/device/utilities/events/Task.h index 966db971527..b1e2a517fa1 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 @@ class Task: public TaskBase { /** Task * * Representation of a postable task - * @ingroup events */ template class Task: public TaskBase { @@ -647,8 +648,8 @@ class Task: public TaskBase { All _args; }; -} - /** @}*/ +} + #endif diff --git a/usb/device/utilities/events/TaskBase.h b/usb/device/utilities/events/TaskBase.h index b88e4d43366..8aceba6b5ee 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 @@ class TaskBase : public LinkEntry { void _wake_check(); }; +/** @}*/ + } #endif - -/** @}*/ diff --git a/usb/device/utilities/events/TaskQueue.h b/usb/device/utilities/events/TaskQueue.h index 5623fd65e0f..8fae4e676bf 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 @@ class TaskQueue { } }; +/** @}*/ + } #endif -