ChibiOS/RT
6.0.3
|
Macros | |
#define | _BSEMAPHORE_DATA(name, taken) {_SEMAPHORE_DATA(name.sem, ((taken) ? 0 : 1))} |
Data part of a static semaphore initializer. More... | |
#define | BSEMAPHORE_DECL(name, taken) binary_semaphore_t name = _BSEMAPHORE_DATA(name, taken) |
Static semaphore initializer. More... | |
Typedefs | |
typedef struct ch_binary_semaphore | binary_semaphore_t |
Binary semaphore type. More... | |
Data Structures | |
struct | ch_binary_semaphore |
Binary semaphore type. More... | |
Functions | |
static void | chBSemObjectInit (binary_semaphore_t *bsp, bool taken) |
Initializes a binary semaphore. More... | |
static msg_t | chBSemWait (binary_semaphore_t *bsp) |
Wait operation on the binary semaphore. More... | |
static msg_t | chBSemWaitS (binary_semaphore_t *bsp) |
Wait operation on the binary semaphore. More... | |
static msg_t | chBSemWaitTimeoutS (binary_semaphore_t *bsp, sysinterval_t timeout) |
Wait operation on the binary semaphore. More... | |
static msg_t | chBSemWaitTimeout (binary_semaphore_t *bsp, sysinterval_t timeout) |
Wait operation on the binary semaphore. More... | |
static void | chBSemResetI (binary_semaphore_t *bsp, bool taken) |
Reset operation on the binary semaphore. More... | |
static void | chBSemReset (binary_semaphore_t *bsp, bool taken) |
Reset operation on the binary semaphore. More... | |
static void | chBSemSignalI (binary_semaphore_t *bsp) |
Performs a signal operation on a binary semaphore. More... | |
static void | chBSemSignal (binary_semaphore_t *bsp) |
Performs a signal operation on a binary semaphore. More... | |
static bool | chBSemGetStateI (const binary_semaphore_t *bsp) |
Returns the binary semaphore current state. More... | |
#define _BSEMAPHORE_DATA | ( | name, | |
taken | |||
) | {_SEMAPHORE_DATA(name.sem, ((taken) ? 0 : 1))} |
#define BSEMAPHORE_DECL | ( | name, | |
taken | |||
) | binary_semaphore_t name = _BSEMAPHORE_DATA(name, taken) |
typedef struct ch_binary_semaphore binary_semaphore_t |
Binary semaphore type.
|
inlinestatic |
Initializes a binary semaphore.
[out] | bsp | pointer to a binary_semaphore_t structure |
[in] | taken | initial state of the binary semaphore:
|
Definition at line 124 of file chbsem.h.
References chSemObjectInit().
|
inlinestatic |
Wait operation on the binary semaphore.
[in] | bsp | pointer to a binary_semaphore_t structure |
MSG_OK | if the binary semaphore has been successfully taken. |
MSG_RESET | if the binary semaphore has been reset using bsemReset() . |
Definition at line 141 of file chbsem.h.
References chSemWait().
|
inlinestatic |
Wait operation on the binary semaphore.
[in] | bsp | pointer to a binary_semaphore_t structure |
MSG_OK | if the binary semaphore has been successfully taken. |
MSG_RESET | if the binary semaphore has been reset using bsemReset() . |
Definition at line 158 of file chbsem.h.
References chDbgCheckClassS(), and chSemWaitS().
|
inlinestatic |
Wait operation on the binary semaphore.
[in] | bsp | pointer to a binary_semaphore_t structure |
[in] | timeout | the number of ticks before the operation timeouts, the following special values are allowed:
|
MSG_OK | if the binary semaphore has been successfully taken. |
MSG_RESET | if the binary semaphore has been reset using bsemReset() . |
MSG_TIMEOUT | if the binary semaphore has not been signaled or reset within the specified timeout. |
Definition at line 184 of file chbsem.h.
References chDbgCheckClassS(), and chSemWaitTimeoutS().
|
inlinestatic |
Wait operation on the binary semaphore.
[in] | bsp | pointer to a binary_semaphore_t structure |
[in] | timeout | the number of ticks before the operation timeouts, the following special values are allowed:
|
MSG_OK | if the binary semaphore has been successfully taken. |
MSG_RESET | if the binary semaphore has been reset using bsemReset() . |
MSG_TIMEOUT | if the binary semaphore has not been signaled or reset within the specified timeout. |
Definition at line 211 of file chbsem.h.
References chSemWaitTimeout().
|
inlinestatic |
Reset operation on the binary semaphore.
bsemWait()
will return MSG_RESET
instead of MSG_OK
. [in] | bsp | pointer to a binary_semaphore_t structure |
[in] | taken | new state of the binary semaphore
|
Definition at line 232 of file chbsem.h.
References chDbgCheckClassI(), and chSemResetI().
|
inlinestatic |
Reset operation on the binary semaphore.
bsemWait()
will return MSG_RESET
instead of MSG_OK
.[in] | bsp | pointer to a binary_semaphore_t structure |
[in] | taken | new state of the binary semaphore
|
Definition at line 253 of file chbsem.h.
References chSemReset().
|
inlinestatic |
Performs a signal operation on a binary semaphore.
[in] | bsp | pointer to a binary_semaphore_t structure |
Definition at line 266 of file chbsem.h.
References chDbgCheckClassI(), chSemSignalI(), and ch_semaphore::cnt.
Referenced by chBSemSignal().
|
inlinestatic |
Performs a signal operation on a binary semaphore.
[in] | bsp | pointer to a binary_semaphore_t structure |
Definition at line 282 of file chbsem.h.
References chBSemSignalI(), chSchRescheduleS(), chSysLock(), and chSysUnlock().
|
inlinestatic |
Returns the binary semaphore current state.
[in] | bsp | pointer to a binary_semaphore_t structure |
false | if the binary semaphore is not taken. |
true | if the binary semaphore is taken. |
Definition at line 300 of file chbsem.h.
References chDbgCheckClassI(), and ch_semaphore::cnt.