EasyManua.ls Logo

Espressif ESP32-S2 - Page 929

Espressif ESP32-S2
1695 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
frequency set by the xTimerPeriodInTicks parameter. If uxAutoReload is set to pdFALSE then the
timer will be a one-shot timer and enter the dormant state after it expires.
pvTimerID: An identifier that is assigned to the timer being created. Typically this would be used
in the timer callback function to identify which timer expired when the same callback function is
assigned to more than one timer.
pxCallbackFunction: The function to call when the timer expires. Callback functions must
have the prototype defined by TimerCallbackFunction_t, which isvoid vCallbackFunction( Timer-
Handle_t xTimer );.
pxTimerBuffer: Must point to a variable of type StaticTimer_t, which will be then be used
to hold the software timers data structures, removing the need for the memory to be allocated
dynamically.
void *pvTimerGetTimerID(const TimerHandle_t xTimer)
void *pvTimerGetTimerID( TimerHandle_t xTimer );
Returns the ID assigned to the timer.
IDs are assigned to timers using the pvTimerID parameter of the call to xTimerCreated() that was used to
create the timer, and by calling the vTimerSetTimerID() API function.
If the same callback function is assigned to multiple timers then the timer ID can be used as time specific (timer
local) storage.
Example usage:
Return The ID assigned to the timer being queried.
Parameters
xTimer: The timer being queried.
See the xTimerCreate() API function example usage scenario.
void vTimerSetTimerID(TimerHandle_t xTimer, void *pvNewID)
void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID );
Sets the ID assigned to the timer.
IDs are assigned to timers using the pvTimerID parameter of the call to xTimerCreated() that was used to
create the timer.
If the same callback function is assigned to multiple timers then the timer ID can be used as time specific (timer
local) storage.
Example usage:
Parameters
xTimer: The timer being updated.
pvNewID: The ID to assign to the timer.
See the xTimerCreate() API function example usage scenario.
BaseType_t xTimerIsTimerActive(TimerHandle_t xTimer)
BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer );
Queries a timer to see if it is active or dormant.
A timer will be dormant if: 1) It has been created but not started, or 2) It is an expired one-shot timer that has
not been restarted.
Timers are created in the dormant state. The xTimerStart(), xTimerReset(), xTimerStartFromISR(), xTimer-
ResetFromISR(), xTimerChangePeriod() and xTimerChangePeriodFromISR() API functions can all be used
to transition a timer into the active state.
Example usage:
* // This function assumes xTimer has already been created.
* void vAFunction( TimerHandle_t xTimer )
* {
(continues on next page)
Espressif Systems 918
Submit Document Feedback
Release v4.4

Table of Contents