My Project
 All Classes Functions Variables Pages
Public Member Functions | List of all members
FreeRTOS::Semaphore Class Reference

Public Member Functions

 Semaphore (std::string owner="<Unknown>")
 
void give ()
 Give a semaphore. The Semaphore is given.
 
void give (uint32_t value)
 Give a semaphore. The Semaphore is given with an associated value. More...
 
void giveFromISR ()
 Give a semaphore from an ISR.
 
void setName (std::string name)
 Set the name of the semaphore. More...
 
bool take (std::string owner="<Unknown>")
 Take a semaphore. Take a semaphore and wait indefinitely. More...
 
bool take (uint32_t timeoutMs, std::string owner="<Unknown>")
 Take a semaphore. Take a semaphore but return if we haven't obtained it in the given period of milliseconds. More...
 
std::string toString ()
 Create a string representation of the semaphore. More...
 
uint32_t wait (std::string owner="<Unknown>")
 Wait for a semaphore to be released by trying to take it and then releasing it again. More...
 

Member Function Documentation

void FreeRTOS::Semaphore::give ( uint32_t  value)

Give a semaphore. The Semaphore is given with an associated value.

Parameters
[in]valueThe value to associate with the semaphore.
void FreeRTOS::Semaphore::setName ( std::string  name)

Set the name of the semaphore.

Parameters
[in]nameThe name of the semaphore.
bool FreeRTOS::Semaphore::take ( std::string  owner = "<Unknown>")

Take a semaphore. Take a semaphore and wait indefinitely.

Parameters
[in]ownerThe new owner (for debugging)
Returns
True if we took the semaphore.
bool FreeRTOS::Semaphore::take ( uint32_t  timeoutMs,
std::string  owner = "<Unknown>" 
)

Take a semaphore. Take a semaphore but return if we haven't obtained it in the given period of milliseconds.

Parameters
[in]timeoutMsTimeout in milliseconds.
[in]ownerThe new owner (for debugging)
Returns
True if we took the semaphore.
std::string FreeRTOS::Semaphore::toString ( )

Create a string representation of the semaphore.

Returns
A string representation of the semaphore.
uint32_t FreeRTOS::Semaphore::wait ( std::string  owner = "<Unknown>")

Wait for a semaphore to be released by trying to take it and then releasing it again.

Parameters
[in]ownerA debug tag.
Returns
The value associated with the semaphore.

The documentation for this class was generated from the following files: