EasyManua.ls Logo

Espressif ESP32-S2 - Page 948

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
(continued from previous page)
// this task will only reach here if the synchronisation was made by all
// three tasks, so there is no need to test the return value.
}
}
Return The value of the event group at the time either the bits being waited for became set, or the block time
expired. Test the return value to know which bits were set. If xEventGroupSync() returned because its
timeout expired then not all the bits being waited for will be set. If xEventGroupSync() returned because
all the bits it was waiting for were set then the returned value is the event group value before any bits were
automatically cleared.
Parameters
xEventGroup: The event group in which the bits are being tested. The event group must have
previously been created using a call to xEventGroupCreate().
uxBitsToSet: The bits to set in the event group before determining if, and possibly waiting for,
all the bits specied by the uxBitsToWait parameter are set.
uxBitsToWaitFor: A bitwise value that indicates the bit or bits to test inside the event group.
For example, to wait for bit 0 and bit 2 set uxBitsToWaitFor to 0x05. To wait for bits 0 and bit 1
and bit 2 set uxBitsToWaitFor to 0x07. Etc.
xTicksToWait: The maximum amount of time (specified in ticks) to wait for all of the bits
specified by uxBitsToWaitFor to become set.
EventBits_t xEventGroupGetBitsFromISR(EventGroupHandle_t xEventGroup)
A version of xEventGroupGetBits() that can be called from an ISR.
Return The event group bits at the time xEventGroupGetBitsFromISR() was called.
Parameters
xEventGroup: The event group being queried.
void vEventGroupDelete(EventGroupHandle_t xEventGroup)
Delete an event group that was previously created by a call to xEventGroupCreate(). Tasks that are blocked on
the event group will be unblocked and obtain 0 as the event groups value.
Parameters
xEventGroup: The event group being deleted.
Macros
xEventGroupClearBitsFromISR(xEventGroup, uxBitsToClear)
A version of xEventGroupClearBits() that can be called from an interrupt.
Setting bits in an event group is not a deterministic operation because there are an unknown number of tasks
that may be waiting for the bit or bits being set. FreeRTOS does not allow nondeterministic operations to be
performed while interrupts are disabled, so protects event groups that are accessed from tasks by suspending
the scheduler rather than disabling interrupts. As a result event groups cannot be accessed directly from an
interrupt service routine. Therefore xEventGroupClearBitsFromISR() sends a message to the timer task to
have the clear operation performed in the context of the timer task.
Example usage:
#define BIT_0 ( 1 << 0 )
#define BIT_4 ( 1 << 4 )
// An event group which it is assumed has already been created by a call to
// xEventGroupCreate().
EventGroupHandle_t xEventGroup;
void anInterruptHandler( void )
{
// Clear bit 0 and bit 4 in xEventGroup.
xResult = xEventGroupClearBitsFromISR(
xEventGroup, // The event group being updated.
(continues on next page)
Espressif Systems 937
Submit Document Feedback
Release v4.4

Table of Contents