Chapter 2. API Reference
const TickType_t xTicksToWait
//
Wait a maximum of 100ms
//
the event
uxBits
=
xEventGroupWaitBits(
for.
→
returning.
→
do.
→
be
set.
→
if( ( uxBits
{
//
xEventGroupWaitBits() returned because both bits were
}
else
if( ( uxBits
{
//
xEventGroupWaitBits() returned because just BIT_0 was
}
else
if( ( uxBits
{
//
xEventGroupWaitBits() returned because just BIT_4 was
}
else
{
//
xEventGroupWaitBits() returned because xTicksToWait ticks passed
//
without either BIT_0
}
}
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 xEventGroupWaitBits() returned because
its timeout expired then not all the bits being waited for will be set. If xEventGroupWaitBits() returned
because the bits it was waiting for were set then the returned value is the event group value before any
bits were automatically cleared in the case that xClearOnExit parameter was set to pdTRUE.
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().
• uxBitsToWaitFor: A bitwise value that indicates the bit or bits to test inside the event group.
For example, to wait for bit 0 and/or bit 2 set uxBitsToWaitFor to 0x05. To wait for bits 0 and/or
bit 1 and/or bit 2 set uxBitsToWaitFor to 0x07. Etc.
• xClearOnExit: If xClearOnExit is set to pdTRUE then any bits within uxBitsToWaitFor that
are set within the event group will be cleared before xEventGroupWaitBits() returns if the wait
condition was met (if the function returns for a reason other than a timeout). If xClearOnExit is set to
pdFALSE then the bits set in the event group are not altered when the call to xEventGroupWaitBits()
returns.
• xWaitForAllBits: If xWaitForAllBits is set to pdTRUE then xEventGroupWaitBits() will re-
turn when either all the bits in uxBitsToWaitFor are set or the specified block time expires. If
xWaitForAllBits is set to pdFALSE then xEventGroupWaitBits() will return when any one of the
bits set in uxBitsToWaitFor is set or the specified block time expires. The block time is specified by
the xTicksToWait parameter.
• xTicksToWait: The maximum amount of time (specified in 'ticks') to wait for one/all (de-
pending on the xWaitForAllBits value) of the bits specified by uxBitsToWaitFor to become set.
EventBits_t xEventGroupClearBits(EventGroupHandle_t
Espressif Systems
=
100
/
for
either bit
group.
Clear the bits before
xEventGroup,
//
The event group being
BIT_0
|
BIT_4,
//
The bits within the event group to
pdTRUE,
//
BIT_0
pdFALSE,
//
Don't wait for both bits, either bit
xTicksToWait );
//
Wait a maximum of 100ms
&
( BIT_0
|
BIT_4 ) )
&
BIT_0 )
!=
0
&
BIT_4 )
!=
0
or
BIT_4 becoming
Clear)
933
Submit Document Feedback
portTICK_PERIOD_MS;
0
or
bit
4
exiting.
and
BIT_4 should be cleared
==
( BIT_0
|
BIT_4 ) )
)
)
set.
xEventGroup, const
(continued from previous page)
to be
set
within
tested.
wait␣
before␣
will␣
for
either bit
to␣
set.
set.
set.
EventBits_t
uxBitsTo-
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?