2022-07-20 10:56:33 +00:00
|
|
|
/**
|
|
|
|
* @file event_flag.h
|
|
|
|
* Furi Event Flag
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "base.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2024-06-05 17:04:03 +00:00
|
|
|
typedef struct FuriEventFlag FuriEventFlag;
|
2022-07-20 10:56:33 +00:00
|
|
|
|
|
|
|
/** Allocate FuriEventFlag
|
|
|
|
*
|
|
|
|
* @return pointer to FuriEventFlag
|
|
|
|
*/
|
2024-03-19 14:43:52 +00:00
|
|
|
FuriEventFlag* furi_event_flag_alloc(void);
|
2022-07-20 10:56:33 +00:00
|
|
|
|
|
|
|
/** Deallocate FuriEventFlag
|
|
|
|
*
|
|
|
|
* @param instance pointer to FuriEventFlag
|
|
|
|
*/
|
|
|
|
void furi_event_flag_free(FuriEventFlag* instance);
|
|
|
|
|
|
|
|
/** Set flags
|
2024-09-09 21:11:53 +00:00
|
|
|
*
|
|
|
|
* @warning result of this function can be flags that you've just asked to
|
|
|
|
* set or not if someone was waiting for them and asked to clear it.
|
|
|
|
* It is highly recommended to read this function and
|
|
|
|
* xEventGroupSetBits source code.
|
2022-07-20 10:56:33 +00:00
|
|
|
*
|
|
|
|
* @param instance pointer to FuriEventFlag
|
2024-09-09 21:11:53 +00:00
|
|
|
* @param[in] flags The flags to set
|
2022-07-20 10:56:33 +00:00
|
|
|
*
|
2024-09-09 21:11:53 +00:00
|
|
|
* @return Resulting flags(see warning) or error (FuriStatus)
|
2022-07-20 10:56:33 +00:00
|
|
|
*/
|
|
|
|
uint32_t furi_event_flag_set(FuriEventFlag* instance, uint32_t flags);
|
|
|
|
|
|
|
|
/** Clear flags
|
|
|
|
*
|
|
|
|
* @param instance pointer to FuriEventFlag
|
|
|
|
* @param[in] flags The flags
|
|
|
|
*
|
|
|
|
* @return Resulting flags or error (FuriStatus)
|
|
|
|
*/
|
|
|
|
uint32_t furi_event_flag_clear(FuriEventFlag* instance, uint32_t flags);
|
|
|
|
|
|
|
|
/** Get flags
|
|
|
|
*
|
|
|
|
* @param instance pointer to FuriEventFlag
|
|
|
|
*
|
|
|
|
* @return Resulting flags
|
|
|
|
*/
|
|
|
|
uint32_t furi_event_flag_get(FuriEventFlag* instance);
|
|
|
|
|
|
|
|
/** Wait flags
|
|
|
|
*
|
|
|
|
* @param instance pointer to FuriEventFlag
|
|
|
|
* @param[in] flags The flags
|
|
|
|
* @param[in] options The option flags
|
|
|
|
* @param[in] timeout The timeout
|
|
|
|
*
|
|
|
|
* @return Resulting flags or error (FuriStatus)
|
|
|
|
*/
|
|
|
|
uint32_t furi_event_flag_wait(
|
|
|
|
FuriEventFlag* instance,
|
|
|
|
uint32_t flags,
|
|
|
|
uint32_t options,
|
|
|
|
uint32_t timeout);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|