STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
cmsis_os2.h File Reference
#include <stdint.h>
#include <stddef.h>
Include dependency graph for cmsis_os2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  osVersion_t
 Version information. More...
struct  osThreadAttr_t
 Attributes structure for thread. More...
struct  osTimerAttr_t
 Attributes structure for timer. More...
struct  osEventFlagsAttr_t
 Attributes structure for event flags. More...
struct  osMutexAttr_t
 Attributes structure for mutex. More...
struct  osSemaphoreAttr_t
 Attributes structure for semaphore. More...
struct  osMemoryPoolAttr_t
 Attributes structure for memory pool. More...
struct  osMessageQueueAttr_t
 Attributes structure for message queue. More...

Macros

#define __NO_RETURN
#define osWaitForever   0xFFFFFFFFU
 Wait forever timeout value.
#define osFlagsWaitAny   0x00000000U
 Wait for any flag (default).
#define osFlagsWaitAll   0x00000001U
 Wait for all flags.
#define osFlagsNoClear   0x00000002U
 Do not clear flags which have been specified to wait for.
#define osFlagsError   0x80000000U
 Error indicator.
#define osFlagsErrorUnknown   0xFFFFFFFFU
 osError (-1).
#define osFlagsErrorTimeout   0xFFFFFFFEU
 osErrorTimeout (-2).
#define osFlagsErrorResource   0xFFFFFFFDU
 osErrorResource (-3).
#define osFlagsErrorParameter   0xFFFFFFFCU
 osErrorParameter (-4).
#define osFlagsErrorISR   0xFFFFFFFAU
 osErrorISR (-6).
#define osThreadDetached   0x00000000U
 Thread created in detached mode (default).
#define osThreadJoinable   0x00000001U
 Thread created in joinable mode.
#define osMutexRecursive   0x00000001U
 Recursive mutex.
#define osMutexPrioInherit   0x00000002U
 Priority inherit protocol.
#define osMutexRobust   0x00000008U
 Robust mutex.
#define TZ_MODULEID_T

Typedefs

typedef void(* osThreadFunc_t) (void *argument)
 Entry point of a thread.
typedef void(* osTimerFunc_t) (void *argument)
 Timer callback function.
typedef void * osThreadId_t
typedef void * osTimerId_t
typedef void * osEventFlagsId_t
typedef void * osMutexId_t
typedef void * osSemaphoreId_t
typedef void * osMemoryPoolId_t
typedef void * osMessageQueueId_t

Enumerations

enum  osKernelState_t {
  osKernelInactive = 0 , osKernelReady = 1 , osKernelRunning = 2 , osKernelLocked = 3 ,
  osKernelSuspended = 4 , osKernelError = -1 , osKernelReserved = 0x7FFFFFFF
}
 Kernel state. More...
enum  osThreadState_t {
  osThreadInactive = 0 , osThreadReady = 1 , osThreadRunning = 2 , osThreadBlocked = 3 ,
  osThreadTerminated = 4 , osThreadError = -1 , osThreadReserved = 0x7FFFFFFF
}
 Thread state. More...
enum  osPriority_t {
  osPriorityNone = 0 , osPriorityIdle = 1 , osPriorityLow = 8 , osPriorityLow1 = 8+1 ,
  osPriorityLow2 = 8+2 , osPriorityLow3 = 8+3 , osPriorityLow4 = 8+4 , osPriorityLow5 = 8+5 ,
  osPriorityLow6 = 8+6 , osPriorityLow7 = 8+7 , osPriorityBelowNormal = 16 , osPriorityBelowNormal1 = 16+1 ,
  osPriorityBelowNormal2 = 16+2 , osPriorityBelowNormal3 = 16+3 , osPriorityBelowNormal4 = 16+4 , osPriorityBelowNormal5 = 16+5 ,
  osPriorityBelowNormal6 = 16+6 , osPriorityBelowNormal7 = 16+7 , osPriorityNormal = 24 , osPriorityNormal1 = 24+1 ,
  osPriorityNormal2 = 24+2 , osPriorityNormal3 = 24+3 , osPriorityNormal4 = 24+4 , osPriorityNormal5 = 24+5 ,
  osPriorityNormal6 = 24+6 , osPriorityNormal7 = 24+7 , osPriorityAboveNormal = 32 , osPriorityAboveNormal1 = 32+1 ,
  osPriorityAboveNormal2 = 32+2 , osPriorityAboveNormal3 = 32+3 , osPriorityAboveNormal4 = 32+4 , osPriorityAboveNormal5 = 32+5 ,
  osPriorityAboveNormal6 = 32+6 , osPriorityAboveNormal7 = 32+7 , osPriorityHigh = 40 , osPriorityHigh1 = 40+1 ,
  osPriorityHigh2 = 40+2 , osPriorityHigh3 = 40+3 , osPriorityHigh4 = 40+4 , osPriorityHigh5 = 40+5 ,
  osPriorityHigh6 = 40+6 , osPriorityHigh7 = 40+7 , osPriorityRealtime = 48 , osPriorityRealtime1 = 48+1 ,
  osPriorityRealtime2 = 48+2 , osPriorityRealtime3 = 48+3 , osPriorityRealtime4 = 48+4 , osPriorityRealtime5 = 48+5 ,
  osPriorityRealtime6 = 48+6 , osPriorityRealtime7 = 48+7 , osPriorityISR = 56 , osPriorityError = -1 ,
  osPriorityReserved = 0x7FFFFFFF
}
 Priority values. More...
enum  osTimerType_t { osTimerOnce = 0 , osTimerPeriodic = 1 }
 Timer type. More...
enum  osStatus_t {
  osOK = 0 , osError = -1 , osErrorTimeout = -2 , osErrorResource = -3 ,
  osErrorParameter = -4 , osErrorNoMemory = -5 , osErrorISR = -6 , osStatusReserved = 0x7FFFFFFF
}
 Status code values returned by CMSIS-RTOS functions. More...

Functions

osStatus_t osKernelInitialize (void)
 Initialize the RTOS Kernel.
osStatus_t osKernelGetInfo (osVersion_t *version, char *id_buf, uint32_t id_size)
 Get RTOS Kernel Information.
osKernelState_t osKernelGetState (void)
 Get the current RTOS Kernel state.
osStatus_t osKernelStart (void)
 Start the RTOS Kernel scheduler.
int32_t osKernelLock (void)
 Lock the RTOS Kernel scheduler.
int32_t osKernelUnlock (void)
 Unlock the RTOS Kernel scheduler.
int32_t osKernelRestoreLock (int32_t lock)
 Restore the RTOS Kernel scheduler lock state.
uint32_t osKernelSuspend (void)
 Suspend the RTOS Kernel scheduler.
void osKernelResume (uint32_t sleep_ticks)
 Resume the RTOS Kernel scheduler.
uint32_t osKernelGetTickCount (void)
 Get the RTOS kernel tick count.
uint32_t osKernelGetTickFreq (void)
 Get the RTOS kernel tick frequency.
uint32_t osKernelGetSysTimerCount (void)
 Get the RTOS kernel system timer count.
uint32_t osKernelGetSysTimerFreq (void)
 Get the RTOS kernel system timer frequency.
osThreadId_t osThreadNew (osThreadFunc_t func, void *argument, const osThreadAttr_t *attr)
 Create a thread and add it to Active Threads.
const char * osThreadGetName (osThreadId_t thread_id)
 Get name of a thread.
osThreadId_t osThreadGetId (void)
 Return the thread ID of the current running thread.
osThreadState_t osThreadGetState (osThreadId_t thread_id)
 Get current thread state of a thread.
uint32_t osThreadGetStackSize (osThreadId_t thread_id)
 Get stack size of a thread.
uint32_t osThreadGetStackSpace (osThreadId_t thread_id)
 Get available stack space of a thread based on stack watermark recording during execution.
osStatus_t osThreadSetPriority (osThreadId_t thread_id, osPriority_t priority)
 Change priority of a thread.
osPriority_t osThreadGetPriority (osThreadId_t thread_id)
 Get current priority of a thread.
osStatus_t osThreadYield (void)
 Pass control to next thread that is in state READY.
osStatus_t osThreadSuspend (osThreadId_t thread_id)
 Suspend execution of a thread.
osStatus_t osThreadResume (osThreadId_t thread_id)
 Resume execution of a thread.
osStatus_t osThreadDetach (osThreadId_t thread_id)
 Detach a thread (thread storage can be reclaimed when thread terminates).
osStatus_t osThreadJoin (osThreadId_t thread_id)
 Wait for specified thread to terminate.
__NO_RETURN void osThreadExit (void)
 Terminate execution of current running thread.
osStatus_t osThreadTerminate (osThreadId_t thread_id)
 Terminate execution of a thread.
uint32_t osThreadGetCount (void)
 Get number of active threads.
uint32_t osThreadEnumerate (osThreadId_t *thread_array, uint32_t array_items)
 Enumerate active threads.
uint32_t osThreadFlagsSet (osThreadId_t thread_id, uint32_t flags)
 Set the specified Thread Flags of a thread.
uint32_t osThreadFlagsClear (uint32_t flags)
 Clear the specified Thread Flags of current running thread.
uint32_t osThreadFlagsGet (void)
 Get the current Thread Flags of current running thread.
uint32_t osThreadFlagsWait (uint32_t flags, uint32_t options, uint32_t timeout)
 Wait for one or more Thread Flags of the current running thread to become signaled.
osStatus_t osDelay (uint32_t ticks)
 Wait for Timeout (Time Delay).
osStatus_t osDelayUntil (uint32_t ticks)
 Wait until specified time.
osTimerId_t osTimerNew (osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr)
 Create and Initialize a timer.
const char * osTimerGetName (osTimerId_t timer_id)
 Get name of a timer.
osStatus_t osTimerStart (osTimerId_t timer_id, uint32_t ticks)
 Start or restart a timer.
osStatus_t osTimerStop (osTimerId_t timer_id)
 Stop a timer.
uint32_t osTimerIsRunning (osTimerId_t timer_id)
 Check if a timer is running.
osStatus_t osTimerDelete (osTimerId_t timer_id)
 Delete a timer.
osEventFlagsId_t osEventFlagsNew (const osEventFlagsAttr_t *attr)
 Create and Initialize an Event Flags object.
const char * osEventFlagsGetName (osEventFlagsId_t ef_id)
 Get name of an Event Flags object.
uint32_t osEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags)
 Set the specified Event Flags.
uint32_t osEventFlagsClear (osEventFlagsId_t ef_id, uint32_t flags)
 Clear the specified Event Flags.
uint32_t osEventFlagsGet (osEventFlagsId_t ef_id)
 Get the current Event Flags.
uint32_t osEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout)
 Wait for one or more Event Flags to become signaled.
osStatus_t osEventFlagsDelete (osEventFlagsId_t ef_id)
 Delete an Event Flags object.
osMutexId_t osMutexNew (const osMutexAttr_t *attr)
 Create and Initialize a Mutex object.
const char * osMutexGetName (osMutexId_t mutex_id)
 Get name of a Mutex object.
osStatus_t osMutexAcquire (osMutexId_t mutex_id, uint32_t timeout)
 Acquire a Mutex or timeout if it is locked.
osStatus_t osMutexRelease (osMutexId_t mutex_id)
 Release a Mutex that was acquired by osMutexAcquire.
osThreadId_t osMutexGetOwner (osMutexId_t mutex_id)
 Get Thread which owns a Mutex object.
osStatus_t osMutexDelete (osMutexId_t mutex_id)
 Delete a Mutex object.
osSemaphoreId_t osSemaphoreNew (uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t *attr)
 Create and Initialize a Semaphore object.
const char * osSemaphoreGetName (osSemaphoreId_t semaphore_id)
 Get name of a Semaphore object.
osStatus_t osSemaphoreAcquire (osSemaphoreId_t semaphore_id, uint32_t timeout)
 Acquire a Semaphore token or timeout if no tokens are available.
osStatus_t osSemaphoreRelease (osSemaphoreId_t semaphore_id)
 Release a Semaphore token up to the initial maximum count.
uint32_t osSemaphoreGetCount (osSemaphoreId_t semaphore_id)
 Get current Semaphore token count.
osStatus_t osSemaphoreDelete (osSemaphoreId_t semaphore_id)
 Delete a Semaphore object.
osMemoryPoolId_t osMemoryPoolNew (uint32_t block_count, uint32_t block_size, const osMemoryPoolAttr_t *attr)
 Create and Initialize a Memory Pool object.
const char * osMemoryPoolGetName (osMemoryPoolId_t mp_id)
 Get name of a Memory Pool object.
void * osMemoryPoolAlloc (osMemoryPoolId_t mp_id, uint32_t timeout)
 Allocate a memory block from a Memory Pool.
osStatus_t osMemoryPoolFree (osMemoryPoolId_t mp_id, void *block)
 Return an allocated memory block back to a Memory Pool.
uint32_t osMemoryPoolGetCapacity (osMemoryPoolId_t mp_id)
 Get maximum number of memory blocks in a Memory Pool.
uint32_t osMemoryPoolGetBlockSize (osMemoryPoolId_t mp_id)
 Get memory block size in a Memory Pool.
uint32_t osMemoryPoolGetCount (osMemoryPoolId_t mp_id)
 Get number of memory blocks used in a Memory Pool.
uint32_t osMemoryPoolGetSpace (osMemoryPoolId_t mp_id)
 Get number of memory blocks available in a Memory Pool.
osStatus_t osMemoryPoolDelete (osMemoryPoolId_t mp_id)
 Delete a Memory Pool object.
osMessageQueueId_t osMessageQueueNew (uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t *attr)
 Create and Initialize a Message Queue object.
const char * osMessageQueueGetName (osMessageQueueId_t mq_id)
 Get name of a Message Queue object.
osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout)
 Put a Message into a Queue or timeout if Queue is full.
osStatus_t osMessageQueueGet (osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout)
 Get a Message from a Queue or timeout if Queue is empty.
uint32_t osMessageQueueGetCapacity (osMessageQueueId_t mq_id)
 Get maximum number of messages in a Message Queue.
uint32_t osMessageQueueGetMsgSize (osMessageQueueId_t mq_id)
 Get maximum message size in a Message Queue.
uint32_t osMessageQueueGetCount (osMessageQueueId_t mq_id)
 Get number of queued messages in a Message Queue.
uint32_t osMessageQueueGetSpace (osMessageQueueId_t mq_id)
 Get number of available slots for messages in a Message Queue.
osStatus_t osMessageQueueReset (osMessageQueueId_t mq_id)
 Reset a Message Queue to initial empty state.
osStatus_t osMessageQueueDelete (osMessageQueueId_t mq_id)
 Delete a Message Queue object.

Macro Definition Documentation

◆ __NO_RETURN

#define __NO_RETURN

Definition at line 60 of file cmsis_os2.h.

◆ osFlagsError

#define osFlagsError   0x80000000U

Error indicator.

Definition at line 181 of file cmsis_os2.h.

Referenced by sensors_task().

◆ osFlagsErrorISR

#define osFlagsErrorISR   0xFFFFFFFAU

osErrorISR (-6).

Definition at line 186 of file cmsis_os2.h.

◆ osFlagsErrorParameter

#define osFlagsErrorParameter   0xFFFFFFFCU

osErrorParameter (-4).

Definition at line 185 of file cmsis_os2.h.

Referenced by osEventFlagsWait().

◆ osFlagsErrorResource

#define osFlagsErrorResource   0xFFFFFFFDU

osErrorResource (-3).

Definition at line 184 of file cmsis_os2.h.

◆ osFlagsErrorTimeout

#define osFlagsErrorTimeout   0xFFFFFFFEU

osErrorTimeout (-2).

Definition at line 183 of file cmsis_os2.h.

◆ osFlagsErrorUnknown

#define osFlagsErrorUnknown   0xFFFFFFFFU

osError (-1).

Definition at line 182 of file cmsis_os2.h.

◆ osFlagsNoClear

#define osFlagsNoClear   0x00000002U

Do not clear flags which have been specified to wait for.

Definition at line 178 of file cmsis_os2.h.

Referenced by osEventFlagsWait().

◆ osFlagsWaitAll

#define osFlagsWaitAll   0x00000001U

Wait for all flags.

Definition at line 177 of file cmsis_os2.h.

Referenced by osEventFlagsWait().

◆ osFlagsWaitAny

#define osFlagsWaitAny   0x00000000U

Wait for any flag (default).

Definition at line 176 of file cmsis_os2.h.

Referenced by gnss_task(), idle_task(), anonymous_namespace{radio_task.cpp}::radio_task(), and sensors_task().

◆ osMutexPrioInherit

#define osMutexPrioInherit   0x00000002U

Priority inherit protocol.

Definition at line 194 of file cmsis_os2.h.

Referenced by board_spi_init(), radio_task_start(), sensors_task_start(), and take().

◆ osMutexRecursive

#define osMutexRecursive   0x00000001U

Recursive mutex.

Definition at line 193 of file cmsis_os2.h.

◆ osMutexRobust

#define osMutexRobust   0x00000008U

Robust mutex.

Definition at line 195 of file cmsis_os2.h.

◆ osThreadDetached

#define osThreadDetached   0x00000000U

Thread created in detached mode (default).

Definition at line 189 of file cmsis_os2.h.

◆ osThreadJoinable

#define osThreadJoinable   0x00000001U

Thread created in joinable mode.

Definition at line 190 of file cmsis_os2.h.

Referenced by osThreadNew().

◆ osWaitForever

#define osWaitForever   0xFFFFFFFFU

Wait forever timeout value.

Definition at line 173 of file cmsis_os2.h.

Referenced by gnss_task(), idle_task(), port_lock(), sensors_task(), sensors_task_snapshot(), anonymous_namespace{radio_task.cpp}::take(), and take().

◆ TZ_MODULEID_T

#define TZ_MODULEID_T

Definition at line 233 of file cmsis_os2.h.

Typedef Documentation

◆ osEventFlagsId_t

typedef void* osEventFlagsId_t

Event Flags ID identifies the event flags.

Definition at line 217 of file cmsis_os2.h.

◆ osMemoryPoolId_t

typedef void* osMemoryPoolId_t

Memory Pool ID identifies the memory pool.

Definition at line 226 of file cmsis_os2.h.

◆ osMessageQueueId_t

typedef void* osMessageQueueId_t

Message Queue ID identifies the message queue.

Definition at line 229 of file cmsis_os2.h.

◆ osMutexId_t

typedef void* osMutexId_t

Mutex ID identifies the mutex.

Definition at line 220 of file cmsis_os2.h.

◆ osSemaphoreId_t

typedef void* osSemaphoreId_t

Semaphore ID identifies the semaphore.

Definition at line 223 of file cmsis_os2.h.

◆ osThreadFunc_t

typedef void(* osThreadFunc_t) (void *argument)

Entry point of a thread.

Definition at line 161 of file cmsis_os2.h.

◆ osThreadId_t

typedef void* osThreadId_t

Thread ID identifies the thread.

Definition at line 211 of file cmsis_os2.h.

◆ osTimerFunc_t

typedef void(* osTimerFunc_t) (void *argument)

Timer callback function.

Definition at line 164 of file cmsis_os2.h.

◆ osTimerId_t

typedef void* osTimerId_t

Timer ID identifies the timer.

Definition at line 214 of file cmsis_os2.h.

Enumeration Type Documentation

◆ osKernelState_t

Kernel state.

Enumerator
osKernelInactive 

Inactive.

osKernelReady 

Ready.

osKernelRunning 

Running.

osKernelLocked 

Locked.

osKernelSuspended 

Suspended.

osKernelError 

Error.

osKernelReserved 

Prevents enum down-size compiler optimization.

Definition at line 82 of file cmsis_os2.h.

◆ osPriority_t

Priority values.

Enumerator
osPriorityNone 

No priority (not initialized).

osPriorityIdle 

Reserved for Idle thread.

osPriorityLow 

Priority: low.

osPriorityLow1 

Priority: low + 1.

osPriorityLow2 

Priority: low + 2.

osPriorityLow3 

Priority: low + 3.

osPriorityLow4 

Priority: low + 4.

osPriorityLow5 

Priority: low + 5.

osPriorityLow6 

Priority: low + 6.

osPriorityLow7 

Priority: low + 7.

osPriorityBelowNormal 

Priority: below normal.

osPriorityBelowNormal1 

Priority: below normal + 1.

osPriorityBelowNormal2 

Priority: below normal + 2.

osPriorityBelowNormal3 

Priority: below normal + 3.

osPriorityBelowNormal4 

Priority: below normal + 4.

osPriorityBelowNormal5 

Priority: below normal + 5.

osPriorityBelowNormal6 

Priority: below normal + 6.

osPriorityBelowNormal7 

Priority: below normal + 7.

osPriorityNormal 

Priority: normal.

osPriorityNormal1 

Priority: normal + 1.

osPriorityNormal2 

Priority: normal + 2.

osPriorityNormal3 

Priority: normal + 3.

osPriorityNormal4 

Priority: normal + 4.

osPriorityNormal5 

Priority: normal + 5.

osPriorityNormal6 

Priority: normal + 6.

osPriorityNormal7 

Priority: normal + 7.

osPriorityAboveNormal 

Priority: above normal.

osPriorityAboveNormal1 

Priority: above normal + 1.

osPriorityAboveNormal2 

Priority: above normal + 2.

osPriorityAboveNormal3 

Priority: above normal + 3.

osPriorityAboveNormal4 

Priority: above normal + 4.

osPriorityAboveNormal5 

Priority: above normal + 5.

osPriorityAboveNormal6 

Priority: above normal + 6.

osPriorityAboveNormal7 

Priority: above normal + 7.

osPriorityHigh 

Priority: high.

osPriorityHigh1 

Priority: high + 1.

osPriorityHigh2 

Priority: high + 2.

osPriorityHigh3 

Priority: high + 3.

osPriorityHigh4 

Priority: high + 4.

osPriorityHigh5 

Priority: high + 5.

osPriorityHigh6 

Priority: high + 6.

osPriorityHigh7 

Priority: high + 7.

osPriorityRealtime 

Priority: realtime.

osPriorityRealtime1 

Priority: realtime + 1.

osPriorityRealtime2 

Priority: realtime + 2.

osPriorityRealtime3 

Priority: realtime + 3.

osPriorityRealtime4 

Priority: realtime + 4.

osPriorityRealtime5 

Priority: realtime + 5.

osPriorityRealtime6 

Priority: realtime + 6.

osPriorityRealtime7 

Priority: realtime + 7.

osPriorityISR 

Reserved for ISR deferred thread.

osPriorityError 

System cannot determine priority or illegal priority.

osPriorityReserved 

Prevents enum down-size compiler optimization.

Definition at line 104 of file cmsis_os2.h.

◆ osStatus_t

enum osStatus_t

Status code values returned by CMSIS-RTOS functions.

Enumerator
osOK 

Operation completed successfully.

osError 

Unspecified RTOS error: run-time error but no other error message fits.

osErrorTimeout 

Operation not completed within the timeout period.

osErrorResource 

Resource not available.

osErrorParameter 

Parameter error.

osErrorNoMemory 

System is out of memory: it was impossible to allocate or reserve memory for the operation.

osErrorISR 

Not allowed in ISR context: the function cannot be called from interrupt service routines.

osStatusReserved 

Prevents enum down-size compiler optimization.

Definition at line 198 of file cmsis_os2.h.

◆ osThreadState_t

Thread state.

Enumerator
osThreadInactive 

Inactive.

osThreadReady 

Ready.

osThreadRunning 

Running.

osThreadBlocked 

Blocked.

osThreadTerminated 

Terminated.

osThreadError 

Error.

osThreadReserved 

Prevents enum down-size compiler optimization.

Definition at line 93 of file cmsis_os2.h.

◆ osTimerType_t

Timer type.

Enumerator
osTimerOnce 

One-shot timer.

osTimerPeriodic 

Repeating timer.

Definition at line 167 of file cmsis_os2.h.

Function Documentation

◆ osDelay()

osStatus_t osDelay ( uint32_t ticks)

Wait for Timeout (Time Delay).

Parameters
[in]tickstime ticks value
Returns
status code that indicates the execution status of the function.

Definition at line 1094 of file cmsis_os2.c.

References IRQ_Context(), osErrorISR, osOK, and vTaskDelay().

Referenced by board_bringup_power_up(), bringup_task(), anonymous_namespace{radio_task.cpp}::BoardControl::delay_ms(), delay_ms(), emmc_stm32_writer_task(), gps_power(), ms5611_reset(), port_start(), sd_nand_probe(), StartDefaultTask(), wait_since_boot(), and wait_transfer_state().

◆ osDelayUntil()

osStatus_t osDelayUntil ( uint32_t ticks)

Wait until specified time.

Parameters
[in]ticksabsolute time in ticks
Returns
status code that indicates the execution status of the function.

Definition at line 1115 of file cmsis_os2.c.

References delay(), IRQ_Context(), osError, osErrorISR, osErrorParameter, osOK, pdFALSE, xTaskDelayUntil(), and xTaskGetTickCount().

◆ osEventFlagsClear()

uint32_t osEventFlagsClear ( osEventFlagsId_t ef_id,
uint32_t flags )

Clear the specified Event Flags.

Parameters
[in]ef_idevent flags ID obtained by osEventFlagsNew.
[in]flagsspecifies the flags that shall be cleared.
Returns
event flags before clearing or error code if highest bit set.

Definition at line 1505 of file cmsis_os2.c.

References EVENT_FLAGS_INVALID_BITS, IRQ_Context(), NULL, osErrorParameter, osErrorResource, pdFAIL, pdTRUE, portYIELD_FROM_ISR, xEventGroupClearBits(), xEventGroupClearBitsFromISR, and xEventGroupGetBitsFromISR().

◆ osEventFlagsDelete()

osStatus_t osEventFlagsDelete ( osEventFlagsId_t ef_id)

Delete an Event Flags object.

Parameters
[in]ef_idevent flags ID obtained by osEventFlagsNew.
Returns
status code that indicates the execution status of the function.

Definition at line 1629 of file cmsis_os2.c.

References IRQ_Context(), NULL, osError, osErrorISR, osErrorParameter, osOK, and vEventGroupDelete().

◆ osEventFlagsGet()

uint32_t osEventFlagsGet ( osEventFlagsId_t ef_id)

Get the current Event Flags.

Parameters
[in]ef_idevent flags ID obtained by osEventFlagsNew.
Returns
current event flags.

Definition at line 1544 of file cmsis_os2.c.

References IRQ_Context(), NULL, xEventGroupGetBits, and xEventGroupGetBitsFromISR().

◆ osEventFlagsGetName()

const char * osEventFlagsGetName ( osEventFlagsId_t ef_id)

Get name of an Event Flags object.

Parameters
[in]ef_idevent flags ID obtained by osEventFlagsNew.
Returns
name as null-terminated string.

◆ osEventFlagsNew()

osEventFlagsId_t osEventFlagsNew ( const osEventFlagsAttr_t * attr)

Create and Initialize an Event Flags object.

Parameters
[in]attrevent flags attributes; NULL: default values.
Returns
event flags ID for reference by other functions or NULL in case of error.

Definition at line 1416 of file cmsis_os2.c.

References osEventFlagsAttr_t::cb_mem, osEventFlagsAttr_t::cb_size, IRQ_Context(), and NULL.

◆ osEventFlagsSet()

uint32_t osEventFlagsSet ( osEventFlagsId_t ef_id,
uint32_t flags )

Set the specified Event Flags.

Parameters
[in]ef_idevent flags ID obtained by osEventFlagsNew.
[in]flagsspecifies the flags that shall be set.
Returns
event flags after setting or error code if highest bit set.

Definition at line 1465 of file cmsis_os2.c.

References EVENT_FLAGS_INVALID_BITS, IRQ_Context(), NULL, osErrorParameter, osErrorResource, pdFAIL, pdFALSE, portYIELD_FROM_ISR, xEventGroupGetBitsFromISR(), xEventGroupSetBits(), and xEventGroupSetBitsFromISR.

◆ osEventFlagsWait()

uint32_t osEventFlagsWait ( osEventFlagsId_t ef_id,
uint32_t flags,
uint32_t options,
uint32_t timeout )

Wait for one or more Event Flags to become signaled.

Parameters
[in]ef_idevent flags ID obtained by osEventFlagsNew.
[in]flagsspecifies the flags to wait for.
[in]optionsspecifies flags options (osFlagsXxxx).
[in]timeoutCMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
Returns
event flags before clearing or error code if highest bit set.

Definition at line 1569 of file cmsis_os2.c.

References EVENT_FLAGS_INVALID_BITS, IRQ_Context(), NULL, osErrorISR, osErrorParameter, osErrorResource, osErrorTimeout, osFlagsErrorParameter, osFlagsNoClear, osFlagsWaitAll, pdFAIL, pdTRUE, and xEventGroupWaitBits().

◆ osKernelGetInfo()

osStatus_t osKernelGetInfo ( osVersion_t * version,
char * id_buf,
uint32_t id_size )

Get RTOS Kernel Information.

Parameters
[out]versionpointer to buffer for retrieving version information.
[out]id_bufpointer to buffer for retrieving kernel identification string.
[in]id_sizesize of buffer for kernel identification string.
Returns
status code that indicates the execution status of the function.

Definition at line 298 of file cmsis_os2.c.

References osVersion_t::api, osVersion_t::kernel, KERNEL_ID, KERNEL_VERSION, NULL, and osOK.

◆ osKernelGetState()

osKernelState_t osKernelGetState ( void )

Get the current RTOS Kernel state.

Returns
current RTOS Kernel state.

Definition at line 322 of file cmsis_os2.c.

References KernelState, osKernelInactive, osKernelLocked, osKernelReady, osKernelRunning, state, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, and xTaskGetSchedulerState().

◆ osKernelGetSysTimerCount()

uint32_t osKernelGetSysTimerCount ( void )

Get the RTOS kernel system timer count.

Returns
RTOS kernel current system timer count as 32-bit value.

Definition at line 515 of file cmsis_os2.c.

References __disable_irq, __enable_irq, IS_IRQ_MASKED, OS_Tick_GetCount(), OS_Tick_GetInterval(), OS_Tick_GetOverflow(), and xTaskGetTickCount().

◆ osKernelGetSysTimerFreq()

uint32_t osKernelGetSysTimerFreq ( void )

Get the RTOS kernel system timer frequency.

Returns
frequency of the system timer in hertz, i.e. timer ticks per second.

Definition at line 561 of file cmsis_os2.c.

References configCPU_CLOCK_HZ.

◆ osKernelGetTickCount()

uint32_t osKernelGetTickCount ( void )

Get the RTOS kernel tick count.

Returns
RTOS kernel current tick count.

Definition at line 491 of file cmsis_os2.c.

References IRQ_Context(), xTaskGetTickCount(), and xTaskGetTickCountFromISR().

Referenced by app_set_state(), emmc_stm32_writer_task(), finish(), idle_task(), to_emmc(), to_emmc(), and wait_transfer_state().

◆ osKernelGetTickFreq()

uint32_t osKernelGetTickFreq ( void )

Get the RTOS kernel tick frequency.

Returns
frequency of the kernel tick in hertz, i.e. kernel ticks per second.

Definition at line 507 of file cmsis_os2.c.

References configTICK_RATE_HZ.

◆ osKernelInitialize()

osStatus_t osKernelInitialize ( void )

Initialize the RTOS Kernel.

Returns
status code that indicates the execution status of the function.

Definition at line 264 of file cmsis_os2.c.

References IRQ_Context(), KernelState, osError, osErrorISR, osKernelInactive, osKernelReady, osOK, state, taskSCHEDULER_NOT_STARTED, vPortDefineHeapRegions(), and xTaskGetSchedulerState().

Referenced by main().

◆ osKernelLock()

int32_t osKernelLock ( void )

Lock the RTOS Kernel scheduler.

Returns
previous lock state (1 - locked, 0 - not locked, error code if negative).

Definition at line 384 of file cmsis_os2.c.

References IRQ_Context(), lock, osError, osErrorISR, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, vTaskSuspendAll(), and xTaskGetSchedulerState().

◆ osKernelRestoreLock()

int32_t osKernelRestoreLock ( int32_t lock)

Restore the RTOS Kernel scheduler lock state.

Parameters
[in]locklock state obtained by osKernelLock or osKernelUnlock.
Returns
new lock state (1 - locked, 0 - not locked, error code if negative).

Definition at line 451 of file cmsis_os2.c.

References IRQ_Context(), lock, osError, osErrorISR, pdTRUE, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, vTaskSuspendAll(), xTaskGetSchedulerState(), and xTaskResumeAll().

◆ osKernelResume()

void osKernelResume ( uint32_t sleep_ticks)

Resume the RTOS Kernel scheduler.

Parameters
[in]sleep_tickstime in ticks for how long the system was in sleep or power-down mode.

◆ osKernelStart()

osStatus_t osKernelStart ( void )

Start the RTOS Kernel scheduler.

Returns
status code that indicates the execution status of the function.

Definition at line 353 of file cmsis_os2.c.

References IRQ_Context(), KernelState, osError, osErrorISR, osKernelReady, osKernelRunning, osOK, state, SVC_Setup(), taskSCHEDULER_NOT_STARTED, vTaskStartScheduler(), and xTaskGetSchedulerState().

Referenced by main().

◆ osKernelSuspend()

uint32_t osKernelSuspend ( void )

Suspend the RTOS Kernel scheduler.

Returns
time in ticks, for how long the system can sleep or power-down.

◆ osKernelUnlock()

int32_t osKernelUnlock ( void )

Unlock the RTOS Kernel scheduler.

Returns
previous lock state (1 - locked, 0 - not locked, error code if negative).

Definition at line 415 of file cmsis_os2.c.

References IRQ_Context(), lock, osError, osErrorISR, pdTRUE, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, xTaskGetSchedulerState(), and xTaskResumeAll().

◆ osMemoryPoolAlloc()

void * osMemoryPoolAlloc ( osMemoryPoolId_t mp_id,
uint32_t timeout )

Allocate a memory block from a Memory Pool.

Parameters
[in]mp_idmemory pool ID obtained by osMemoryPoolNew.
[in]timeoutCMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
Returns
address of the allocated memory block or NULL in case of no memory is available.

◆ osMemoryPoolDelete()

osStatus_t osMemoryPoolDelete ( osMemoryPoolId_t mp_id)

Delete a Memory Pool object.

Parameters
[in]mp_idmemory pool ID obtained by osMemoryPoolNew.
Returns
status code that indicates the execution status of the function.

◆ osMemoryPoolFree()

osStatus_t osMemoryPoolFree ( osMemoryPoolId_t mp_id,
void * block )

Return an allocated memory block back to a Memory Pool.

Parameters
[in]mp_idmemory pool ID obtained by osMemoryPoolNew.
[in]blockaddress of the allocated memory block to be returned to the memory pool.
Returns
status code that indicates the execution status of the function.

◆ osMemoryPoolGetBlockSize()

uint32_t osMemoryPoolGetBlockSize ( osMemoryPoolId_t mp_id)

Get memory block size in a Memory Pool.

Parameters
[in]mp_idmemory pool ID obtained by osMemoryPoolNew.
Returns
memory block size in bytes.

◆ osMemoryPoolGetCapacity()

uint32_t osMemoryPoolGetCapacity ( osMemoryPoolId_t mp_id)

Get maximum number of memory blocks in a Memory Pool.

Parameters
[in]mp_idmemory pool ID obtained by osMemoryPoolNew.
Returns
maximum number of memory blocks.

◆ osMemoryPoolGetCount()

uint32_t osMemoryPoolGetCount ( osMemoryPoolId_t mp_id)

Get number of memory blocks used in a Memory Pool.

Parameters
[in]mp_idmemory pool ID obtained by osMemoryPoolNew.
Returns
number of memory blocks used.

◆ osMemoryPoolGetName()

const char * osMemoryPoolGetName ( osMemoryPoolId_t mp_id)

Get name of a Memory Pool object.

Parameters
[in]mp_idmemory pool ID obtained by osMemoryPoolNew.
Returns
name as null-terminated string.

◆ osMemoryPoolGetSpace()

uint32_t osMemoryPoolGetSpace ( osMemoryPoolId_t mp_id)

Get number of memory blocks available in a Memory Pool.

Parameters
[in]mp_idmemory pool ID obtained by osMemoryPoolNew.
Returns
number of memory blocks available.

◆ osMemoryPoolNew()

osMemoryPoolId_t osMemoryPoolNew ( uint32_t block_count,
uint32_t block_size,
const osMemoryPoolAttr_t * attr )

Create and Initialize a Memory Pool object.

Parameters
[in]block_countmaximum number of memory blocks in memory pool.
[in]block_sizememory block size in bytes.
[in]attrmemory pool attributes; NULL: default values.
Returns
memory pool ID for reference by other functions or NULL in case of error.

◆ osMessageQueueDelete()

osStatus_t osMessageQueueDelete ( osMessageQueueId_t mq_id)

Delete a Message Queue object.

Parameters
[in]mq_idmessage queue ID obtained by osMessageQueueNew.
Returns
status code that indicates the execution status of the function.

Definition at line 2360 of file cmsis_os2.c.

References IRQ_Context(), NULL, osError, osErrorISR, osErrorParameter, osOK, vQueueDelete(), and vQueueUnregisterQueue.

◆ osMessageQueueGet()

osStatus_t osMessageQueueGet ( osMessageQueueId_t mq_id,
void * msg_ptr,
uint8_t * msg_prio,
uint32_t timeout )

Get a Message from a Queue or timeout if Queue is empty.

Parameters
[in]mq_idmessage queue ID obtained by osMessageQueueNew.
[out]msg_ptrpointer to buffer for message to get from a queue.
[out]msg_priopointer to buffer for message priority or NULL.
[in]timeoutCMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
Returns
status code that indicates the execution status of the function.

Definition at line 2209 of file cmsis_os2.c.

References IRQ_Context(), NULL, osErrorParameter, osErrorResource, osErrorTimeout, osOK, pdFALSE, pdPASS, portYIELD_FROM_ISR, xQueueReceive(), and xQueueReceiveFromISR().

Referenced by poll_command().

◆ osMessageQueueGetCapacity()

uint32_t osMessageQueueGetCapacity ( osMessageQueueId_t mq_id)

Get maximum number of messages in a Message Queue.

Parameters
[in]mq_idmessage queue ID obtained by osMessageQueueNew.
Returns
maximum number of messages.

Definition at line 2254 of file cmsis_os2.c.

References NULL, and xSTATIC_QUEUE::uxDummy4.

◆ osMessageQueueGetCount()

uint32_t osMessageQueueGetCount ( osMessageQueueId_t mq_id)

Get number of queued messages in a Message Queue.

Parameters
[in]mq_idmessage queue ID obtained by osMessageQueueNew.
Returns
number of queued messages.

Definition at line 2290 of file cmsis_os2.c.

References count(), IRQ_Context(), NULL, uxQueueMessagesWaiting(), and uxQueueMessagesWaitingFromISR().

Referenced by work_waiting().

◆ osMessageQueueGetMsgSize()

uint32_t osMessageQueueGetMsgSize ( osMessageQueueId_t mq_id)

Get maximum message size in a Message Queue.

Parameters
[in]mq_idmessage queue ID obtained by osMessageQueueNew.
Returns
maximum message size in bytes.

Definition at line 2272 of file cmsis_os2.c.

References NULL, and xSTATIC_QUEUE::uxDummy4.

◆ osMessageQueueGetName()

const char * osMessageQueueGetName ( osMessageQueueId_t mq_id)

Get name of a Message Queue object.

Parameters
[in]mq_idmessage queue ID obtained by osMessageQueueNew.
Returns
name as null-terminated string.

◆ osMessageQueueGetSpace()

uint32_t osMessageQueueGetSpace ( osMessageQueueId_t mq_id)

Get number of available slots for messages in a Message Queue.

Parameters
[in]mq_idmessage queue ID obtained by osMessageQueueNew.
Returns
number of available slots for messages.

Definition at line 2311 of file cmsis_os2.c.

References IRQ_Context(), NULL, taskENTER_CRITICAL_FROM_ISR, taskEXIT_CRITICAL_FROM_ISR, xSTATIC_QUEUE::uxDummy4, and uxQueueSpacesAvailable().

◆ osMessageQueueNew()

osMessageQueueId_t osMessageQueueNew ( uint32_t msg_count,
uint32_t msg_size,
const osMessageQueueAttr_t * attr )

Create and Initialize a Message Queue object.

Parameters
[in]msg_countmaximum number of messages in queue.
[in]msg_sizemaximum message size in bytes.
[in]attrmessage queue attributes; NULL: default values.
Returns
message queue ID for reference by other functions or NULL in case of error.

Definition at line 2100 of file cmsis_os2.c.

References osMessageQueueAttr_t::cb_mem, osMessageQueueAttr_t::cb_size, IRQ_Context(), osMessageQueueAttr_t::mq_mem, osMessageQueueAttr_t::mq_size, osMessageQueueAttr_t::name, NULL, and vQueueAddToRegistry.

Referenced by idle_task_start().

◆ osMessageQueuePut()

osStatus_t osMessageQueuePut ( osMessageQueueId_t mq_id,
const void * msg_ptr,
uint8_t msg_prio,
uint32_t timeout )

Put a Message into a Queue or timeout if Queue is full.

Parameters
[in]mq_idmessage queue ID obtained by osMessageQueueNew.
[in]msg_ptrpointer to buffer with message to put into a queue.
[in]msg_priomessage priority.
[in]timeoutCMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
Returns
status code that indicates the execution status of the function.

Definition at line 2161 of file cmsis_os2.c.

References IRQ_Context(), NULL, osErrorParameter, osErrorResource, osErrorTimeout, osOK, pdFALSE, pdPASS, pdTRUE, portYIELD_FROM_ISR, xQueueSendToBack, and xQueueSendToBackFromISR.

Referenced by idle_task_command().

◆ osMessageQueueReset()

osStatus_t osMessageQueueReset ( osMessageQueueId_t mq_id)

Reset a Message Queue to initial empty state.

Parameters
[in]mq_idmessage queue ID obtained by osMessageQueueNew.
Returns
status code that indicates the execution status of the function.

Definition at line 2338 of file cmsis_os2.c.

References IRQ_Context(), NULL, osErrorISR, osErrorParameter, osOK, and xQueueReset.

◆ osMutexAcquire()

osStatus_t osMutexAcquire ( osMutexId_t mutex_id,
uint32_t timeout )

Acquire a Mutex or timeout if it is locked.

Parameters
[in]mutex_idmutex ID obtained by osMutexNew.
[in]timeoutCMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
Returns
status code that indicates the execution status of the function.

Referenced by board_spi_lock(), port_lock(), sensors_task(), sensors_task_snapshot(), anonymous_namespace{radio_task.cpp}::take(), and take().

◆ osMutexDelete()

osStatus_t osMutexDelete ( osMutexId_t mutex_id)

Delete a Mutex object.

Parameters
[in]mutex_idmutex ID obtained by osMutexNew.
Returns
status code that indicates the execution status of the function.

◆ osMutexGetName()

const char * osMutexGetName ( osMutexId_t mutex_id)

Get name of a Mutex object.

Parameters
[in]mutex_idmutex ID obtained by osMutexNew.
Returns
name as null-terminated string.

◆ osMutexGetOwner()

osThreadId_t osMutexGetOwner ( osMutexId_t mutex_id)

Get Thread which owns a Mutex object.

Parameters
[in]mutex_idmutex ID obtained by osMutexNew.
Returns
thread ID of owner thread or NULL when mutex was not acquired.

◆ osMutexNew()

osMutexId_t osMutexNew ( const osMutexAttr_t * attr)

Create and Initialize a Mutex object.

Parameters
[in]attrmutex attributes; NULL: default values.
Returns
mutex ID for reference by other functions or NULL in case of error.

Referenced by board_spi_init(), emmc_stm32_init(), radio_task_start(), sensors_task_start(), and take().

◆ osMutexRelease()

osStatus_t osMutexRelease ( osMutexId_t mutex_id)

Release a Mutex that was acquired by osMutexAcquire.

Parameters
[in]mutex_idmutex ID obtained by osMutexNew.
Returns
status code that indicates the execution status of the function.

Referenced by app_set_state(), board_spi_unlock(), anonymous_namespace{radio_task.cpp}::give(), port_unlock(), sensors_task(), and sensors_task_snapshot().

◆ osSemaphoreAcquire()

osStatus_t osSemaphoreAcquire ( osSemaphoreId_t semaphore_id,
uint32_t timeout )

Acquire a Semaphore token or timeout if no tokens are available.

Parameters
[in]semaphore_idsemaphore ID obtained by osSemaphoreNew.
[in]timeoutCMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
Returns
status code that indicates the execution status of the function.

Definition at line 1970 of file cmsis_os2.c.

References IRQ_Context(), NULL, osErrorParameter, osErrorResource, osErrorTimeout, osOK, pdFALSE, pdPASS, portYIELD_FROM_ISR, xSemaphoreTake, and xSemaphoreTakeFromISR.

Referenced by finish(), port_read(), and port_write().

◆ osSemaphoreDelete()

osStatus_t osSemaphoreDelete ( osSemaphoreId_t semaphore_id)

Delete a Semaphore object.

Parameters
[in]semaphore_idsemaphore ID obtained by osSemaphoreNew.
Returns
status code that indicates the execution status of the function.

Definition at line 2063 of file cmsis_os2.c.

References IRQ_Context(), NULL, osError, osErrorISR, osErrorParameter, osOK, vQueueUnregisterQueue, and vSemaphoreDelete.

◆ osSemaphoreGetCount()

uint32_t osSemaphoreGetCount ( osSemaphoreId_t semaphore_id)

Get current Semaphore token count.

Parameters
[in]semaphore_idsemaphore ID obtained by osSemaphoreNew.
Returns
number of tokens available.

Definition at line 2043 of file cmsis_os2.c.

References count(), IRQ_Context(), NULL, uxSemaphoreGetCount, and uxSemaphoreGetCountFromISR.

◆ osSemaphoreGetName()

const char * osSemaphoreGetName ( osSemaphoreId_t semaphore_id)

Get name of a Semaphore object.

Parameters
[in]semaphore_idsemaphore ID obtained by osSemaphoreNew.
Returns
name as null-terminated string.

◆ osSemaphoreNew()

osSemaphoreId_t osSemaphoreNew ( uint32_t max_count,
uint32_t initial_count,
const osSemaphoreAttr_t * attr )

Create and Initialize a Semaphore object.

Parameters
[in]max_countmaximum number of available tokens.
[in]initial_countinitial number of available tokens.
[in]attrsemaphore attributes; NULL: default values.
Returns
semaphore ID for reference by other functions or NULL in case of error.

Definition at line 1894 of file cmsis_os2.c.

References osSemaphoreAttr_t::cb_mem, osSemaphoreAttr_t::cb_size, IRQ_Context(), osSemaphoreAttr_t::name, NULL, pdPASS, vQueueAddToRegistry, vSemaphoreDelete, and xSemaphoreGive.

Referenced by emmc_stm32_init().

◆ osSemaphoreRelease()

osStatus_t osSemaphoreRelease ( osSemaphoreId_t semaphore_id)

Release a Semaphore token up to the initial maximum count.

Parameters
[in]semaphore_idsemaphore ID obtained by osSemaphoreNew.
Returns
status code that indicates the execution status of the function.

Definition at line 2011 of file cmsis_os2.c.

References IRQ_Context(), NULL, osErrorParameter, osErrorResource, osOK, pdFALSE, pdPASS, pdTRUE, portYIELD_FROM_ISR, xSemaphoreGive, and xSemaphoreGiveFromISR.

Referenced by HAL_MMC_ErrorCallback(), and HAL_MMC_TxCpltCallback().

◆ osThreadDetach()

osStatus_t osThreadDetach ( osThreadId_t thread_id)

Detach a thread (thread storage can be reclaimed when thread terminates).

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
status code that indicates the execution status of the function.

◆ osThreadEnumerate()

uint32_t osThreadEnumerate ( osThreadId_t * thread_array,
uint32_t array_items )

Enumerate active threads.

Parameters
[out]thread_arraypointer to array for retrieving thread IDs.
[in]array_itemsmaximum number of items in array for retrieving thread IDs.
Returns
number of enumerated threads.

Definition at line 886 of file cmsis_os2.c.

References count(), IRQ_Context(), NULL, pvPortMalloc(), uxTaskGetNumberOfTasks(), uxTaskGetSystemState(), vPortFree(), vTaskSuspendAll(), and xTaskResumeAll().

◆ osThreadExit()

__NO_RETURN void osThreadExit ( void )

Terminate execution of current running thread.

Definition at line 826 of file cmsis_os2.c.

References __NO_RETURN, NULL, and vTaskDelete().

◆ osThreadFlagsClear()

uint32_t osThreadFlagsClear ( uint32_t flags)

Clear the specified Thread Flags of current running thread.

Parameters
[in]flagsspecifies the flags of the thread that shall be cleared.
Returns
thread flags before clearing or error code if highest bit set.

◆ osThreadFlagsGet()

uint32_t osThreadFlagsGet ( void )

Get the current Thread Flags of current running thread.

Returns
current thread flags.

◆ osThreadFlagsSet()

uint32_t osThreadFlagsSet ( osThreadId_t thread_id,
uint32_t flags )

Set the specified Thread Flags of a thread.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
[in]flagsspecifies the flags of the thread that shall be set.
Returns
thread flags after setting or error code if highest bit set.

Referenced by gnss_task_set_active(), HAL_GPIO_EXTI_Callback(), HAL_UARTEx_RxEventCallback(), idle_task_command(), idle_task_set_active(), and sensors_task_set_active().

◆ osThreadFlagsWait()

uint32_t osThreadFlagsWait ( uint32_t flags,
uint32_t options,
uint32_t timeout )

Wait for one or more Thread Flags of the current running thread to become signaled.

Parameters
[in]flagsspecifies the flags to wait for.
[in]optionsspecifies flags options (osFlagsXxxx).
[in]timeoutCMSIS_RTOS_TimeOutValue or 0 in case of no time-out.
Returns
thread flags before clearing or error code if highest bit set.

Referenced by gnss_task(), idle_task(), anonymous_namespace{radio_task.cpp}::radio_task(), and sensors_task().

◆ osThreadGetCount()

uint32_t osThreadGetCount ( void )

Get number of active threads.

Returns
number of active threads.

Definition at line 869 of file cmsis_os2.c.

References count(), IRQ_Context(), and uxTaskGetNumberOfTasks().

◆ osThreadGetId()

osThreadId_t osThreadGetId ( void )

Return the thread ID of the current running thread.

Returns
thread ID for reference by other functions or NULL in case of error.

Definition at line 669 of file cmsis_os2.c.

References xTaskGetCurrentTaskHandle().

Referenced by gnss_task(), anonymous_namespace{radio_task.cpp}::radio_task(), and sensors_task().

◆ osThreadGetName()

const char * osThreadGetName ( osThreadId_t thread_id)

Get name of a thread.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
name as null-terminated string.

Definition at line 652 of file cmsis_os2.c.

References IRQ_Context(), NULL, and pcTaskGetName().

◆ osThreadGetPriority()

osPriority_t osThreadGetPriority ( osThreadId_t thread_id)

Get current priority of a thread.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
current priority value of the specified thread.

Definition at line 746 of file cmsis_os2.c.

References IRQ_Context(), NULL, osPriorityError, and uxTaskPriorityGet().

◆ osThreadGetStackSize()

uint32_t osThreadGetStackSize ( osThreadId_t thread_id)

Get stack size of a thread.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
stack size in bytes.

◆ osThreadGetStackSpace()

uint32_t osThreadGetStackSpace ( osThreadId_t thread_id)

Get available stack space of a thread based on stack watermark recording during execution.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
remaining stack space in bytes.

Definition at line 707 of file cmsis_os2.c.

References IRQ_Context(), NULL, and uxTaskGetStackHighWaterMark().

◆ osThreadGetState()

osThreadState_t osThreadGetState ( osThreadId_t thread_id)

Get current thread state of a thread.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
current thread state of the specified thread.

Definition at line 681 of file cmsis_os2.c.

References eBlocked, eDeleted, eInvalid, eReady, eRunning, eSuspended, eTaskGetState(), IRQ_Context(), NULL, osThreadBlocked, osThreadError, osThreadReady, osThreadRunning, and state.

◆ osThreadJoin()

osStatus_t osThreadJoin ( osThreadId_t thread_id)

Wait for specified thread to terminate.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
status code that indicates the execution status of the function.

References __NO_RETURN.

◆ osThreadNew()

osThreadId_t osThreadNew ( osThreadFunc_t func,
void * argument,
const osThreadAttr_t * attr )

Create a thread and add it to Active Threads.

Parameters
[in]functhread function.
[in]argumentpointer that is passed to the thread function as start argument.
[in]attrthread attributes; NULL: default values.
Returns
thread ID for reference by other functions or NULL in case of error.

Definition at line 577 of file cmsis_os2.c.

References osThreadAttr_t::attr_bits, osThreadAttr_t::cb_mem, osThreadAttr_t::cb_size, configMINIMAL_STACK_SIZE, configSTACK_DEPTH_TYPE, IRQ_Context(), osThreadAttr_t::name, NULL, osPriorityIdle, osPriorityISR, osPriorityNone, osPriorityNormal, osThreadJoinable, pdPASS, osThreadAttr_t::priority, osThreadAttr_t::stack_mem, and osThreadAttr_t::stack_size.

Referenced by bringup_task_start(), gnss_task_start(), idle_task_start(), main(), radio_task_start(), sensors_task_start(), and start_emmc().

◆ osThreadResume()

osStatus_t osThreadResume ( osThreadId_t thread_id)

Resume execution of a thread.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
status code that indicates the execution status of the function.

Definition at line 803 of file cmsis_os2.c.

References IRQ_Context(), NULL, osErrorISR, osErrorParameter, osOK, and vTaskResume().

◆ osThreadSetPriority()

osStatus_t osThreadSetPriority ( osThreadId_t thread_id,
osPriority_t priority )

Change priority of a thread.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
[in]prioritynew priority value for the thread function.
Returns
status code that indicates the execution status of the function.

Definition at line 724 of file cmsis_os2.c.

References IRQ_Context(), NULL, osErrorISR, osErrorParameter, osOK, osPriorityIdle, osPriorityISR, and vTaskPrioritySet().

◆ osThreadSuspend()

osStatus_t osThreadSuspend ( osThreadId_t thread_id)

Suspend execution of a thread.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
status code that indicates the execution status of the function.

Definition at line 781 of file cmsis_os2.c.

References IRQ_Context(), NULL, osErrorISR, osErrorParameter, osOK, and vTaskSuspend().

◆ osThreadTerminate()

osStatus_t osThreadTerminate ( osThreadId_t thread_id)

Terminate execution of a thread.

Parameters
[in]thread_idthread ID obtained by osThreadNew or osThreadGetId.
Returns
status code that indicates the execution status of the function.

Definition at line 836 of file cmsis_os2.c.

References eDeleted, eTaskGetState(), IRQ_Context(), NULL, osError, osErrorISR, osErrorParameter, osErrorResource, osOK, and vTaskDelete().

◆ osThreadYield()

osStatus_t osThreadYield ( void )

Pass control to next thread that is in state READY.

Returns
status code that indicates the execution status of the function.

Definition at line 763 of file cmsis_os2.c.

References IRQ_Context(), osErrorISR, osOK, and taskYIELD.

◆ osTimerDelete()

osStatus_t osTimerDelete ( osTimerId_t timer_id)

Delete a timer.

Parameters
[in]timer_idtimer ID obtained by osTimerNew.
Returns
status code that indicates the execution status of the function.

◆ osTimerGetName()

const char * osTimerGetName ( osTimerId_t timer_id)

Get name of a timer.

Parameters
[in]timer_idtimer ID obtained by osTimerNew.
Returns
name as null-terminated string.

◆ osTimerIsRunning()

uint32_t osTimerIsRunning ( osTimerId_t timer_id)

Check if a timer is running.

Parameters
[in]timer_idtimer ID obtained by osTimerNew.
Returns
0 not running, 1 running.

◆ osTimerNew()

osTimerId_t osTimerNew ( osTimerFunc_t func,
osTimerType_t type,
void * argument,
const osTimerAttr_t * attr )

Create and Initialize a timer.

Parameters
[in]funcfunction pointer to callback function.
[in]typeosTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
[in]argumentargument to the timer callback function.
[in]attrtimer attributes; NULL: default values.
Returns
timer ID for reference by other functions or NULL in case of error.

◆ osTimerStart()

osStatus_t osTimerStart ( osTimerId_t timer_id,
uint32_t ticks )

Start or restart a timer.

Parameters
[in]timer_idtimer ID obtained by osTimerNew.
[in]tickstime ticks value of the timer.
Returns
status code that indicates the execution status of the function.

◆ osTimerStop()

osStatus_t osTimerStop ( osTimerId_t timer_id)

Stop a timer.

Parameters
[in]timer_idtimer ID obtained by osTimerNew.
Returns
status code that indicates the execution status of the function.