RTOS Abstraction (abstraction-rtos)
Events

General Description

APIs for acquiring and working with Events.

cy_rslt_t cy_rtos_event_init (cy_event_t *event)
 Create an event. More...
 
cy_rslt_t cy_rtos_event_setbits (cy_event_t *event, uint32_t bits)
 Set the event flag bits. More...
 
cy_rslt_t cy_rtos_event_clearbits (cy_event_t *event, uint32_t bits)
 Clear the event flag bits. More...
 
cy_rslt_t cy_rtos_event_getbits (cy_event_t *event, uint32_t *bits)
 Get the event bits. More...
 
cy_rslt_t cy_rtos_event_waitbits (cy_event_t *event, uint32_t *bits, bool clear, bool all, cy_time_t timeout_ms)
 Wait for the event and return bits. More...
 
cy_rslt_t cy_rtos_event_deinit (cy_event_t *event)
 Deinitialize a event. More...
 
#define cy_rtos_init_event(event)   cy_rtos_event_init(event)
 Create an event. More...
 
#define cy_rtos_setbits_event(event, bits, in_isr)   cy_rtos_event_setbits(event, bits)
 Set the event flag bits. More...
 
#define cy_rtos_clearbits_event(event, bits, in_isr)   cy_rtos_event_clearbits(event, bits)
 Clear the event flag bits. More...
 
#define cy_rtos_getbits_event(event, bits)   cy_rtos_event_getbits(event, bits)
 Get the event bits. More...
 
#define cy_rtos_waitbits_event(event, bits, clear, all, timeout_ms)    cy_rtos_event_waitbits(event, bits, clear, all, timeout_ms)
 Wait for the event and return bits. More...
 
#define cy_rtos_deinit_event(event)   cy_rtos_event_deinit(event)
 Deinitialize a event. More...
 

Macro Definition Documentation

◆ cy_rtos_init_event

#define cy_rtos_init_event (   event)    cy_rtos_event_init(event)

Create an event.

This is an event which can be used to signal a set of threads with a 32 bit data element.

Parameters
[in,out]eventPointer to the event handle to be initialized
Returns
The status of the event initialization request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_setbits_event

#define cy_rtos_setbits_event (   event,
  bits,
  in_isr 
)    cy_rtos_event_setbits(event, bits)

Set the event flag bits.

This is an event which can be used to signal a set of threads with a 32 bit data element. Any threads waiting on this event are released

Parameters
[in]eventPointer to the event handle
[in]bitsThe value of the 32 bit flags
[in]in_isrIf true, this is called from an ISR, otherwise from a thread
Returns
The status of the set request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_clearbits_event

#define cy_rtos_clearbits_event (   event,
  bits,
  in_isr 
)    cy_rtos_event_clearbits(event, bits)

Clear the event flag bits.

This function clears bits in the event.

Parameters
[in]eventPointer to the event handle
[in]bitsAny bits set in this value, will be cleared in the event.
[in]in_isrif true, this is called from an ISR, otherwise from a thread
Returns
The status of the clear flags request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_getbits_event

#define cy_rtos_getbits_event (   event,
  bits 
)    cy_rtos_event_getbits(event, bits)

Get the event bits.

Returns the current bits for the event.

Parameters
[in]eventPointer to the event handle
[out]bitspointer to receive the value of the event flags
Returns
The status of the get request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_waitbits_event

#define cy_rtos_waitbits_event (   event,
  bits,
  clear,
  all,
  timeout_ms 
)     cy_rtos_event_waitbits(event, bits, clear, all, timeout_ms)

Wait for the event and return bits.

Waits for the event to be set and then returns the bits associated with the event, or waits for the given timeout period.

Note
This function returns if any bit in the set is set.
Parameters
[in]eventPointer to the event handle
[in,out]bitspointer to receive the value of the event flags
[in]clearif true, clear any bits set that cause the wait to return if false, do not clear bits
[in]allif true, all bits in the initial bits value must be set to return if false, any one bit in the initial bits value must be set to return
[in]timeout_msThe amount of time to wait in milliseconds
Returns
The status of the wait for event request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_deinit_event

#define cy_rtos_deinit_event (   event)    cy_rtos_event_deinit(event)

Deinitialize a event.

This function frees the resources associated with an event.

Parameters
[in]eventPointer to the event handle
Returns
The status of the deletion request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]

Function Documentation

◆ cy_rtos_event_init()

cy_rslt_t cy_rtos_event_init ( cy_event_t event)

Create an event.

This is an event which can be used to signal a set of threads with a 32 bit data element.

Parameters
[in,out]eventPointer to the event handle to be initialized
Returns
The status of the event initialization request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_event_setbits()

cy_rslt_t cy_rtos_event_setbits ( cy_event_t event,
uint32_t  bits 
)

Set the event flag bits.

This is an event which can be used to signal a set of threads with a 32 bit data element. Any threads waiting on this event are released

Parameters
[in]eventPointer to the event handle
[in]bitsThe value of the 32 bit flags
Returns
The status of the set request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_event_clearbits()

cy_rslt_t cy_rtos_event_clearbits ( cy_event_t event,
uint32_t  bits 
)

Clear the event flag bits.

This function clears bits in the event.

Parameters
[in]eventPointer to the event handle
[in]bitsAny bits set in this value, will be cleared in the event.
Returns
The status of the clear flags request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_event_getbits()

cy_rslt_t cy_rtos_event_getbits ( cy_event_t event,
uint32_t *  bits 
)

Get the event bits.

Returns the current bits for the event.

Parameters
[in]eventPointer to the event handle
[out]bitspointer to receive the value of the event flags
Returns
The status of the get request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_event_waitbits()

cy_rslt_t cy_rtos_event_waitbits ( cy_event_t event,
uint32_t *  bits,
bool  clear,
bool  all,
cy_time_t  timeout_ms 
)

Wait for the event and return bits.

Waits for the event to be set and then returns the bits associated with the event, or waits for the given timeout period.

Note
This function returns if any bit in the set is set.
Parameters
[in]eventPointer to the event handle
[in,out]bitspointer to receive the value of the event flags
[in]clearif true, clear any bits set that cause the wait to return if false, do not clear bits
[in]allif true, all bits in the initial bits value must be set to return if false, any one bit in the initial bits value must be set to return
[in]timeout_msThe amount of time to wait in milliseconds
Returns
The status of the wait for event request. [CY_RSLT_SUCCESS, CY_RTOS_NO_MEMORY, CY_RTOS_GENERAL_ERROR]

◆ cy_rtos_event_deinit()

cy_rslt_t cy_rtos_event_deinit ( cy_event_t event)

Deinitialize a event.

This function frees the resources associated with an event.

Parameters
[in]eventPointer to the event handle
Returns
The status of the deletion request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]