Espressif ESP32-S2 Programming Manual page 948

Table of Contents

Advertisement

Chapter 2. API Reference
//
this task will only reach here
//
three tasks, so there
}
}
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 specified 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
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
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 group's 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
// xEventGroupCreate().
EventGroupHandle_t xEventGroup;
void anInterruptHandler( void )
{
//
Clear bit
xResult
=
Espressif Systems
is
no need to test the
is
assumed has already been created by a call to
0
and
bit
4
in
xEventGroup.
xEventGroupClearBitsFromISR(
xEventGroup,
Submit Document Feedback
if
the synchronisation was made by
return
xEventGroup)
xEventGroup)
//
The event group being
937
(continued from previous page)
all
value.
updated.
(continues on next page)
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF