CMSIS-RTOS2: Timer Functions

| CMSIS-RTOS2 Version 2.1.3 Real-Time Operating System: API and RTX Reference Implementation

- Main Page
- Usage and Description
- Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Timer Functions
Event functions

Events generated by timer functions. More...

## Functions

void | EvrRtxTimerError (osTimerId_t timer_id, int32_t status)
| Event on timer error (Error) More...
void | EvrRtxTimerCallback (osTimerFunc_t func, void *argument)
| Event on timer callback call (Op) More...
void | EvrRtxTimerNew (osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr)
| Event on timer create and initialize (API) More...
void | EvrRtxTimerCreated (osTimerId_t timer_id, const char *name)
| Event on successful timer create (Op) More...
void | EvrRtxTimerGetName (osTimerId_t timer_id, const char *name)
| Event on timer name retrieve (API) More...
void | EvrRtxTimerStart (osTimerId_t timer_id, uint32_t ticks)
| Event on timer start (API) More...
void | EvrRtxTimerStarted (osTimerId_t timer_id)
| Event on successful timer start (Op) More...
void | EvrRtxTimerStop (osTimerId_t timer_id)
| Event on timer stop (API) More...
void | EvrRtxTimerStopped (osTimerId_t timer_id)
| Event on successful timer stop (Op) More...
void | EvrRtxTimerIsRunning (osTimerId_t timer_id, uint32_t running)
| Event on timer running state check (API) More...
void | EvrRtxTimerDelete (osTimerId_t timer_id)
| Event on timer delete (API) More...
void | EvrRtxTimerDestroyed (osTimerId_t timer_id)
| Event on successful timer delete (Op) More...

## Description

## Function Documentation

void EvrRtxTimerError | ( | osTimerId_t | timer_id,
|  | int32_t | status
| ) |  |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew or NULL when ID is unknown.
  [in] | status | extended execution status.

The event TimerError is generated when Timer Management routines complete their execution due to an error.

The status parameter indicates the execution status and can be one of the osStatus_t codes or one of the extended execution status codes which are summarized in the table below.

Extended Status Code | Description
--- | ---
osRtxErrorKernelNotReady | Kernel scheduler is not in Ready state.
osRtxErrorKernelNotRunning | Kernel scheduler is not executing - there is no running thread.
osRtxErrorInvalidControlBlock | Object control block with invalid alignment or size was specified.
osRtxErrorInvalidDataMemory | Object data memory with invalid alignment or size was specified.
osRtxErrorInvalidThreadStack | Thread stack memory with invalid alignment or size was specified.
osRtxErrorInvalidPriority | Invalid thread priority was specified.
osRtxErrorThreadNotJoinable | Specified thread is not joinable.
osRtxErrorMutexNotOwned | Specified mutex is not owned by the current running thread.
osRtxErrorMutexNotLocked | Specified mutex is not locked.
osRtxErrorMutexLockLimit | Maximum number of recursive mutex locks reached.
osRtxErrorSemaphoreCountLimit | Semaphore count limit reached.
osRtxErrorTZ_InitContext_S | Secure context memory system initialization failed.
osRtxErrorTZ_AllocContext_S | Secure context memory allocation failed.
osRtxErrorTZ_FreeContext_S | Secure context memory deallocation failed.
osRtxErrorTZ_LoadContext_S | Secure context load failed.
osRtxErrorTZ_SaveContext_S | Secure context save failed.

Value in the Event Recorder shows:

- timer_id : timer ID.
- status : execution status code.

void EvrRtxTimerCallback | ( | osTimerFunc_t | func,
|  | void * | argument
| ) |  |

Parameters

  [in] | func | start address of a timer call back function.
  [in] | argument | argument to the timer call back function.

The event TimerCallback is generated when the timer callback function is called.

Value in the Event Recorder shows:

- func : start address of a timer call back function.
- argument : memory address of argument to the timer call back function.

void EvrRtxTimerNew | ( | osTimerFunc_t | func,
|  | osTimerType_t | type,
|  | void * | argument,
|  | const osTimerAttr_t * | attr
| ) |  |

Parameters

  [in] | func | start address of a timer call back function.
  [in] | type | osTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
  [in] | argument | argument to the timer call back function.
  [in] | attr | timer attributes.

The event TimerNew is generated when the function osTimerNew is called.

Value in the Event Recorder shows:

- func : start address of a timer call back function.
- type : timer type: osTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
- argument : memory address of argument to the timer call back function.
- attr : memory address of Timer attributes or 0 when they are not specified.

void EvrRtxTimerCreated | ( | osTimerId_t | timer_id,
|  | const char * | name
| ) |  |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew.
  [in] | name | pointer to timer object name.

The event TimerCreated is generated when the function osTimerNew successfully creates a timer object.

Value in the Event Recorder shows:

- timer_id : timer ID.

void EvrRtxTimerGetName | ( | osTimerId_t | timer_id,
|  | const char * | name
| ) |  |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew.
  [in] | name | pointer to timer object name.

The event TimerGetName is generated when the function osTimerGetName is called and its execution result is known.

Value in the Event Recorder shows:

- timer_id : timer ID.
- name : retrieved memory address of name string (0 in case of a failure).

void EvrRtxTimerStart | ( | osTimerId_t | timer_id,
|  | uint32_t | ticks
| ) |  |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew.
  [in] | ticks | time ticks value of the timer.

The event TimerStart is generated when the function osTimerStart is called.

Value in the Event Recorder shows:

- timer_id : timer ID.
- ticks : time ticks value of the timer.

void EvrRtxTimerStarted | ( | osTimerId_t | timer_id | ) |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew.

The event TimerStarted is generated when the function osTimerStart successfully starts or restarts the timer operation.

Value in the Event Recorder shows:

- timer_id : timer ID.

void EvrRtxTimerStop | ( | osTimerId_t | timer_id | ) |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew.

The event TimerStop is generated when the function osTimerStop is called.

Value in the Event Recorder shows:

- timer_id : timer ID.

void EvrRtxTimerStopped | ( | osTimerId_t | timer_id | ) |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew.

The event TimerStopped is generated when the function osTimerStop successfully stops the timer operation.

Value in the Event Recorder shows:

- timer_id : timer ID.

void EvrRtxTimerIsRunning | ( | osTimerId_t | timer_id,
|  | uint32_t | running
| ) |  |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew.
  [in] | running | running state: 0 not running, 1 running.

The event TimerIsRunning is generated when the function osTimerIsRunning is called and its execution result is known.

Value in the Event Recorder shows:

- timer_id : timer ID.
- running : timer running state: 0 not running, 1 running.

void EvrRtxTimerDelete | ( | osTimerId_t | timer_id | ) |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew.

The event TimerDelete is generated when the function osTimerDelete is called.

Value in the Event Recorder shows:

- timer_id : timer ID.

void EvrRtxTimerDestroyed | ( | osTimerId_t | timer_id | ) |

Parameters

  [in] | timer_id | timer ID obtained by osTimerNew.

The event TimerDestroyed is generated when the function osTimerDelete successfully deletes the timer object.

Value in the Event Recorder shows:

- timer_id : timer ID.