Skip to content

Commit c462509

Browse files
committed
Add sync level documentation to classes
Document public classes to indicate level of protection provided.
1 parent 8226b8e commit c462509

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+91
-2
lines changed

hal/api/AnalogIn.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
namespace mbed {
2626

2727
/** An analog input, used for reading the voltage on a pin
28+
*
29+
* @Note Synchronization level: Thread safe
2830
*
2931
* Example:
3032
* @code

hal/api/AnalogOut.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
namespace mbed {
2626

2727
/** An analog output, used for setting the voltage on a pin
28+
*
29+
* @Note Synchronization level: Thread safe
2830
*
2931
* Example:
3032
* @code

hal/api/BusIn.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
namespace mbed {
2323

2424
/** A digital input bus, used for reading the state of a collection of pins
25+
*
26+
* @Note Synchronization level: Thread safe
2527
*/
2628
class BusIn {
2729

hal/api/BusInOut.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
namespace mbed {
2222

2323
/** A digital input output bus, used for setting the state of a collection of pins
24+
*
25+
* @Note Synchronization level: Thread safe
2426
*/
2527
class BusInOut {
2628

hal/api/BusOut.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class BusOut {
3030
*
3131
* @param p<n> DigitalOut pin to connect to bus bit <n> (p5-p30, NC)
3232
*
33+
* @Note Synchronization level: Thread safe
34+
*
3335
* @note
3436
* It is only required to specify as many pin variables as is required
3537
* for the bus; the rest will default to NC (not connected)

hal/api/CAN.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
namespace mbed {
2828

2929
/** CANMessage class
30+
*
31+
* @Note Synchronization level: Thread safe
3032
*/
3133
class CANMessage : public CAN_Message {
3234

hal/api/CThunk.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@
7171
/* IRQ/Exception compatible thunk entry function */
7272
typedef void (*CThunkEntry)(void);
7373

74+
/**
75+
* Class for created a pointer with data bound to it
76+
*
77+
* @Note Synchronization level: Not protected
78+
*/
7479
template<class T>
7580
class CThunk
7681
{

hal/api/CallChain.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace mbed {
2525
* sequence using CallChain::call(). Used mostly by the interrupt chaining code,
2626
* but can be used for other purposes.
2727
*
28+
* @Note Synchronization level: Not protected
29+
*
2830
* Example:
2931
* @code
3032
* #include "mbed.h"

hal/api/Callback.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace mbed {
2323

2424

2525
/** Callback class based on template specialization
26+
*
27+
* @Note Synchronization level: Not protected
2628
*/
2729
template <typename F>
2830
class Callback;

hal/api/CircularBuffer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
namespace mbed {
2222

2323
/** Templated Circular buffer class
24+
*
25+
* @Note Synchronization level: Interrupt safe
2426
*/
2527
template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
2628
class CircularBuffer {

hal/api/DigitalIn.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
namespace mbed {
2525

2626
/** A digital input, used for reading the state of a pin
27+
*
28+
* @Note Synchronization level: Interrupt safe
2729
*
2830
* Example:
2931
* @code

hal/api/DigitalInOut.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
namespace mbed {
2525

2626
/** A digital input/output, used for setting or reading a bi-directional pin
27+
*
28+
* @Note Synchronization level: Interrupt safe
2729
*/
2830
class DigitalInOut {
2931

hal/api/DigitalOut.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
namespace mbed {
2424

2525
/** A digital output, used for setting the state of a pin
26+
*
27+
* @Note Synchronization level: Interrupt safe
2628
*
2729
* Example:
2830
* @code

hal/api/DirHandle.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ namespace mbed {
4444
* The root directory is considered to contain all FileLike and
4545
* FileSystemLike objects, so the DIR* returned by opendir("/") will
4646
* reflect this.
47+
*
48+
* @Note Synchronization level: Set by subclass
4749
*/
4850
class DirHandle {
4951

hal/api/Ethernet.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
namespace mbed {
2424

2525
/** An ethernet interface, to use with the ethernet pins.
26+
*
27+
* @Note Synchronization level: Not protected
2628
*
2729
* Example:
2830
* @code

hal/api/FileHandle.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ namespace mbed {
3838
*
3939
* No one ever directly tals to/instanciates a FileHandle - it gets
4040
* created by FileSystem, and wrapped up by stdio.
41+
*
42+
* @Note Synchronization level: Set by subclass
4143
*/
4244
class FileHandle {
4345

hal/api/FileLike.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace mbed {
2525
* A file-like object is one that can be opened with fopen by
2626
* fopen("/name", mode). It is intersection of the classes Base and
2727
* FileHandle.
28+
*
29+
* @Note Synchronization level: Set by subclass
2830
*/
2931
class FileLike : public FileHandle, public FileBase {
3032

hal/api/FileSystemLike.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ namespace mbed {
2929
*
3030
* Implementations must define at least open (the default definitions
3131
* of the rest of the functions just return error values).
32+
*
33+
* @Note Synchronization level: Set by subclass
3234
*/
3335
class FileSystemLike : public FileBase {
3436

hal/api/I2C.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
namespace mbed {
3232

3333
/** An I2C Master, used for communicating with I2C slave devices
34+
*
35+
* @Note Synchronization level: Thread safe
3436
*
3537
* Example:
3638
* @code

hal/api/I2CSlave.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
namespace mbed {
2626

2727
/** An I2C Slave, used for communicating with an I2C Master device
28+
*
29+
* @Note Synchronization level: Not protected
2830
*
2931
* Example:
3032
* @code

hal/api/InterruptIn.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
namespace mbed {
2929

3030
/** A digital interrupt input, used to call a function on a rising or falling edge
31+
*
32+
* @Note Synchronization level: Interrupt safe
3133
*
3234
* Example:
3335
* @code

hal/api/InterruptManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
namespace mbed {
1111

1212
/** Use this singleton if you need to chain interrupt handlers.
13+
*
14+
* @Note Synchronization level: Thread safe
1315
*
1416
* Example (for LPC1768):
1517
* @code

hal/api/LocalFileSystem.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class LocalFileHandle : public FileHandle {
5959
* mbed Microcontroller. Once created, the standard C file access functions are used to open,
6060
* read and write files.
6161
*
62+
* @Note Synchronization level: Thread safe
63+
*
6264
* Example:
6365
* @code
6466
* #include "mbed.h"

hal/api/LowPowerTicker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
namespace mbed {
2727

2828
/** Low Power Ticker
29+
*
30+
* @Note Synchronization level: Interrupt safe
2931
*/
3032
class LowPowerTicker : public Ticker {
3133

hal/api/LowPowerTimeout.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
namespace mbed {
2727

2828
/** Low Power Timout
29+
*
30+
* @Note Synchronization level: Interrupt safe
2931
*/
3032
class LowPowerTimeout : public LowPowerTicker {
3133

hal/api/LowPowerTimer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
namespace mbed {
2727

2828
/** Low power timer
29+
*
30+
* @Note Synchronization level: Interrupt safe
2931
*/
3032
class LowPowerTimer : public Timer {
3133

hal/api/PortIn.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
namespace mbed {
2727

2828
/** A multiple pin digital input
29+
*
30+
* @Note Synchronization level: Interrupt safe
2931
*
3032
* Example:
3133
* @code

hal/api/PortInOut.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
namespace mbed {
2727

2828
/** A multiple pin digital in/out used to set/read multiple bi-directional pins
29+
*
30+
* @Note Synchronization level: Interrupt safe
2931
*/
3032
class PortInOut {
3133
public:

hal/api/PortOut.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
namespace mbed {
2727
/** A multiple pin digital out
28+
*
29+
* @Note Synchronization level: Interrupt safe
2830
*
2931
* Example:
3032
* @code

hal/api/PwmOut.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
namespace mbed {
2626

2727
/** A pulse-width modulation digital output
28+
*
29+
* @Note Synchronization level: Interrupt safe
2830
*
2931
* Example
3032
* @code

hal/api/RawSerial.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ namespace mbed {
3232
* Can be used for Full Duplex communication, or Simplex by specifying
3333
* one pin as NC (Not Connected)
3434
*
35+
* @Note Synchronization level: Not protected
36+
*
3537
* Example:
3638
* @code
3739
* // Send a char to the PC

hal/api/SPI.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ namespace mbed {
3939
* Most SPI devices will also require Chip Select and Reset signals. These
4040
* can be controlled using <DigitalOut> pins
4141
*
42+
* @Note Synchronization level: Thread safe
43+
*
4244
* Example:
4345
* @code
4446
* // Send a byte to a SPI slave, and record the response

hal/api/SPISlave.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ namespace mbed {
2828
*
2929
* The default format is set to 8-bits, mode 0, and a clock frequency of 1MHz
3030
*
31+
* @Note Synchronization level: Not protected
32+
*
3133
* Example:
3234
* @code
3335
* // Reply to a SPI master as slave

hal/api/Serial.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ namespace mbed {
3131
* Can be used for Full Duplex communication, or Simplex by specifying
3232
* one pin as NC (Not Connected)
3333
*
34+
* @Note Synchronization level: Thread safe
35+
*
3436
* Example:
3537
* @code
3638
* // Print "Hello World" to the PC

hal/api/SerialBase.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ namespace mbed {
3333

3434
/** A base class for serial port implementations
3535
* Can't be instantiated directly (use Serial or RawSerial)
36+
*
37+
* @Note Synchronization level: Set by subclass
3638
*/
3739
class SerialBase {
3840

hal/api/Stream.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ extern void mbed_set_unbuffered_stream(FILE *_file);
2626
extern int mbed_getc(FILE *_file);
2727
extern char* mbed_gets(char *s, int size, FILE *_file);
2828

29+
/** File stream
30+
*
31+
* @Note Synchronization level: Set by subclass
32+
*/
2933
class Stream : public FileLike {
3034

3135
public:

hal/api/Ticker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace mbed {
2525
*
2626
* You can use as many seperate Ticker objects as you require.
2727
*
28+
* @Note Synchronization level: Interrupt safe
29+
*
2830
* Example:
2931
* @code
3032
* // Toggle the blinking led after 5 seconds

hal/api/Timeout.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ namespace mbed {
2424
*
2525
* You can use as many seperate Timeout objects as you require.
2626
*
27+
* @Note Synchronization level: Interrupt safe
28+
*
2729
* Example:
2830
* @code
2931
* // Blink until timeout.

hal/api/Timer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
namespace mbed {
2323

2424
/** A general purpose timer
25+
*
26+
* @Note Synchronization level: Interrupt safe
2527
*
2628
* Example:
2729
* @code

hal/api/TimerEvent.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
namespace mbed {
2323

2424
/** Base abstraction for timer interrupts
25-
*/
25+
*
26+
* @Note Synchronization level: Interrupt safe
27+
*/
2628
class TimerEvent {
2729
public:
2830
TimerEvent();

hal/api/Transaction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ typedef struct {
3434
} transaction_t;
3535

3636
/** Transaction class defines a transaction.
37+
*
38+
* @Note Synchronization level: Not protected
3739
*/
3840
template<typename Class>
3941
class Transaction {

hal/api/rtc_time.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ extern "C" {
5858
*
5959
* @param t Number of seconds since January 1, 1970 (the UNIX timestamp)
6060
*
61+
* @Note Synchronization level: Thread safe
62+
*
6163
* Example:
6264
* @code
6365
* #include "mbed.h"
@@ -71,7 +73,7 @@ void set_time(time_t t);
7173

7274
/** Attach an external RTC to be used for the C time functions
7375
*
74-
* Do not call this function from an interrupt while an RTC read/write operation may be occurring
76+
* @Note Synchronization level: Thread safe
7577
*
7678
* @param read_rtc pointer to function which returns current UNIX timestamp
7779
* @param write_rtc pointer to function which sets current UNIX timestamp, can be NULL

0 commit comments

Comments
 (0)