Skip to content

Commit

Permalink
Separate drivers internal APIs from public APIs (#5)
Browse files Browse the repository at this point in the history
* Move source files and internal headers to `internal` dir
* Amend test files and other modules include paths for internal headers
* Add Doxygen comments for documenting internal and public drivers APIs
* Remove incorrectly grouped Devicekey from the drivers Doxygen
  group and add to the newly created `Device Key` group.
  • Loading branch information
hugueskamba committed Jul 3, 2019
1 parent 936caa1 commit b15930c
Show file tree
Hide file tree
Showing 74 changed files with 379 additions and 96 deletions.
2 changes: 1 addition & 1 deletion TESTS/mbed_drivers/timerevent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "drivers/TimerEvent.h"
#include "drivers/internal/TimerEvent.h"
#include "hal/ticker_api.h"
#include "rtos.h"

Expand Down
2 changes: 1 addition & 1 deletion UNITTESTS/stubs/SerialBase_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

#include "SerialBase.h"
#include "drivers/internal/SerialBase.h"

namespace mbed {

Expand Down
13 changes: 11 additions & 2 deletions drivers/AnalogIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -48,7 +54,6 @@ namespace mbed {
* }
* }
* @endcode
* @ingroup drivers
*/
class AnalogIn {

Expand Down Expand Up @@ -111,8 +116,12 @@ class AnalogIn {
analogin_t _adc;
static SingletonPtr<PlatformMutex> _mutex;
#endif //!defined(DOXYGEN_ONLY)

};

/** @}*/
/** @}*/

} // namespace mbed

#endif
Expand Down
12 changes: 10 additions & 2 deletions drivers/AnalogOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -48,7 +54,6 @@ namespace mbed {
* }
* }
* @endcode
* @ingroup drivers
*/
class AnalogOut {

Expand Down Expand Up @@ -131,6 +136,9 @@ class AnalogOut {
#endif //!defined(DOXYGEN_ONLY)
};

/** @}*/
/** @}*/

} // namespace mbed

#endif
Expand Down
12 changes: 10 additions & 2 deletions drivers/BusIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<BusIn> {

Expand Down Expand Up @@ -125,6 +130,9 @@ class BusIn : private NonCopyable<BusIn> {
#endif
};

/** @}*/
/** @}*/

} // namespace mbed

#endif
Expand Down
12 changes: 10 additions & 2 deletions drivers/BusInOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@
#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
* pins without restriction other than being capable of digital input or output
* capabilities
*
* @note Synchronization level: Thread safe
* @ingroup drivers
*/
class BusInOut : private NonCopyable<BusInOut> {

Expand Down Expand Up @@ -147,6 +152,9 @@ class BusInOut : private NonCopyable<BusInOut> {
#endif //!defined(DOXYGEN_ONLY)
};

/** @}*/
/** @}*/

} // namespace mbed

#endif
12 changes: 10 additions & 2 deletions drivers/BusOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<BusOut> {

Expand Down Expand Up @@ -125,6 +130,9 @@ class BusOut : private NonCopyable<BusOut> {
#endif
};

/** @}*/
/** @}*/

} // namespace mbed

#endif
20 changes: 17 additions & 3 deletions drivers/CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -70,8 +75,14 @@ class CANMessage : public CAN_Message {
CANMessage(unsigned int _id, CANFormat _format = CANStandard);
};

/** @}*/

/**
* \defgroup drivers_CAN CAN class
* @{
*/

/** A can bus client, used for communicating with can devices
* @ingroup drivers
*/
class CAN : private NonCopyable<CAN> {

Expand Down Expand Up @@ -300,6 +311,9 @@ class CAN : private NonCopyable<CAN> {
#endif
};

/** @}*/
/** @}*/

} // namespace mbed

#endif
Expand Down
12 changes: 10 additions & 2 deletions drivers/DigitalIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
#include "hal/gpio_api.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
*
Expand All @@ -46,7 +52,6 @@ namespace mbed {
* }
* }
* @endcode
* @ingroup drivers
*/
class DigitalIn {

Expand Down Expand Up @@ -122,6 +127,9 @@ class DigitalIn {
#endif //!defined(DOXYGEN_ONLY)
};

/** @}*/
/** @}*/

} // namespace mbed

#endif
12 changes: 10 additions & 2 deletions drivers/DigitalInOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@
#include "hal/gpio_api.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 {

Expand Down Expand Up @@ -144,6 +149,9 @@ class DigitalInOut {
#endif //!defined(DOXYGEN_ONLY)
};

/** @}*/
/** @}*/

} // namespace mbed

#endif
12 changes: 10 additions & 2 deletions drivers/DigitalOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
#include "hal/gpio_api.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
*
Expand All @@ -41,7 +47,6 @@ namespace mbed {
* }
* }
* @endcode
* @ingroup drivers
*/
class DigitalOut {

Expand Down Expand Up @@ -138,6 +143,9 @@ class DigitalOut {
#endif //!defined(DOXYGEN_ONLY)
};

/** @}*/
/** @}*/

} // namespace mbed

#endif
12 changes: 10 additions & 2 deletions drivers/Ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -54,7 +60,6 @@ namespace mbed {
* }
* }
* @endcode
* @ingroup drivers
*/
MBED_DEPRECATED(
"EthInterface is now the preferred way to get an Ethernet object.",
Expand Down Expand Up @@ -175,6 +180,9 @@ class Ethernet : private NonCopyable<Ethernet> {
void set_link(Mode mode);
};

/** @}*/
/** @}*/

} // namespace mbed

#endif
Expand Down
12 changes: 10 additions & 2 deletions drivers/FlashIAP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<FlashIAP> {
public:
Expand Down Expand Up @@ -181,6 +186,9 @@ class FlashIAP : private NonCopyable<FlashIAP> {
#endif
};

/** @}*/
/** @}*/

} /* namespace mbed */

#endif /* DEVICE_FLASH */
Expand Down
Loading

0 comments on commit b15930c

Please sign in to comment.