EasyManua.ls Logo

Espressif ESP32-S2 - Page 942

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
is actually processed will depend on the priority of the timer service/daemon task relative to other tasks in
the system, although the timers expiry time is relative to when xTimerResetFromISR() is actually called.
The timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY configuration
constant.
Parameters
xTimer: The handle of the timer that is to be started, reset, or restarted.
pxHigherPriorityTaskWoken: The timer service/daemon task spends most of its time in
the Blocked state, waiting for messages to arrive on the timer command queue. Calling xTimer-
ResetFromISR() writes a message to the timer command queue, so has the potential to transition
the timer service/daemon task out of the Blocked state. If calling xTimerResetFromISR() causes
the timer service/daemon task to leave the Blocked state, and the timer service/ daemon task has
a priority equal to or greater than the currently executing task (the task that was interrupted), then
*pxHigherPriorityTaskWoken will get set to pdTRUE internally within the xTimerResetFromISR()
function. If xTimerResetFromISR() sets this value to pdTRUE then a context switch should be
performed before the interrupt exits.
Type Definitions
typedef struct tmrTimerControl *TimerHandle_t
typedef void (*TimerCallbackFunction_t)(TimerHandle_t xTimer)
typedef void (*PendedFunction_t)(void *, uint32_t)
Event Group API
Header File
components/freertos/include/freertos/event_groups.h
Functions
EventGroupHandle_t xEventGroupCreate(void)
Create a new event group.
Internally, within the FreeRTOS implementation, event groups use a [small] block of memory, in which
the event groups structure is stored. If an event groups is created using xEventGroupCreate() then the
required memory is automatically dynamically allocated inside the xEventGroupCreate() function. (see
https://www.FreeRTOS.org/a00111.html). If an event group is created using xEventGroupCreateStatic() then
the application writer must instead provide the memory that will get used by the event group. xEventGroupCre-
ateStatic() therefore allows an event group to be created without using any dynamic memory allocation.
Although event groups are not related to ticks, for internal implementation reasons the number of bits avail-
able for use in an event group is dependent on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h.
If configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit 0 to bit 7). If confi-
gUSE_16_BIT_TICKS is set to 0 then each event group has 24 usable bits (bit 0 to bit 23). The EventBits_t
type is used to store event bits within an event group.
Example usage:
// Declare a variable to hold the created event group.
EventGroupHandle_t xCreatedEventGroup;
// Attempt to create the event group.
xCreatedEventGroup = xEventGroupCreate();
// Was the event group created successfully?
if( xCreatedEventGroup == NULL )
{
// The event group was not created because there was insufficient
// FreeRTOS heap available.
}
(continues on next page)
Espressif Systems 931
Submit Document Feedback
Release v4.4

Table of Contents