Files | |
file | mars_task_event_flag_types.h |
MARS Task Event Flag Types. | |
file | mars_task_event_flag.h |
[host] MARS Task Event Flag API | |
file | mars_task_event_flag.h |
[MPU] MARS Task Event Flag API | |
Data Structures | |
struct | mars_task_event_flag |
MARS task event flag structure. More... | |
Defines | |
#define | MARS_TASK_EVENT_FLAG_SIZE 128 |
Size of task event flag structure. | |
#define | MARS_TASK_EVENT_FLAG_ALIGN 128 |
Alignment of task event flag structure. | |
#define | MARS_TASK_EVENT_FLAG_ALIGN_MASK 0x7f |
Alignment mask of task event flag structure. | |
#define | MARS_TASK_EVENT_FLAG_HOST_TO_MPU 0x10 |
Event flag direction from PPU to SPU. | |
#define | MARS_TASK_EVENT_FLAG_MPU_TO_HOST 0x11 |
Event flag direction from SPU to PPU. | |
#define | MARS_TASK_EVENT_FLAG_MPU_TO_MPU 0x12 |
Event flag direction from SPU to SPU. | |
#define | MARS_TASK_EVENT_FLAG_CLEAR_AUTO 0x20 |
Event flag clear mode automatic. | |
#define | MARS_TASK_EVENT_FLAG_CLEAR_MANUAL 0x21 |
Event flag clear mode manual. | |
#define | MARS_TASK_EVENT_FLAG_MASK_OR 0x30 |
Event flag mask mode bitwise OR. | |
#define | MARS_TASK_EVENT_FLAG_MASK_AND 0x31 |
Event flag mask mode bitwise AND. | |
#define | MARS_TASK_EVENT_FLAG_WAIT_MAX 15 |
Maximum tasks allowed to wait on a single event flag. | |
Functions | |
int | mars_task_event_flag_initialize (struct mars_context *mars, struct mars_task_event_flag *event_flag, uint8_t direction, uint8_t clear_mode) |
[host] Initializes a task event flag. | |
int | mars_task_event_flag_clear (struct mars_task_event_flag *event_flag, uint32_t bits) |
[host] Clears the bits specified in the task event flag. | |
int | mars_task_event_flag_set (struct mars_task_event_flag *event_flag, uint32_t bits) |
[host] Sets the bits specified in the task event flag. | |
int | mars_task_event_flag_wait (struct mars_task_event_flag *event_flag, uint32_t mask, uint8_t mask_mode) |
[host] Waits on a task event flag. (Blocking) | |
int | mars_task_event_flag_try_wait (struct mars_task_event_flag *event_flag, uint32_t mask, uint8_t mask_mode) |
[host] Waits on a task event flag. (Non-Blocking) | |
int | mars_task_event_flag_initialize (uint64_t event_flag_ea, uint8_t direction, uint8_t clear_mode) |
[MPU] Initializes a task event flag. | |
int | mars_task_event_flag_clear (uint64_t event_flag_ea, uint32_t bits) |
[MPU] Clears the bits specified in the task event flag. | |
int | mars_task_event_flag_set (uint64_t event_flag_ea, uint32_t bits) |
[MPU] Sets the bits specified in the task event flag. | |
int | mars_task_event_flag_wait (uint64_t event_flag_ea, uint32_t mask, uint8_t mask_mode) |
[MPU] Waits on a task event flag. (Blocking) | |
int | mars_task_event_flag_try_wait (uint64_t event_flag_ea, uint32_t mask, uint8_t mask_mode) |
[MPU] Waits on a task event flag. (Non-Blocking) | |
Variables | |
mars_task_event_flag | MARS_TASK_EVENT_FLAG_ALIGN |
MARS task event flag structure. |
The event flags can be sent from host program to MARS task or vice versa, as well as between multiple MARS tasks. While waiting on certain event flags to be received, the task transitions to the waiting state until the event flag is received.
int mars_task_event_flag_initialize | ( | struct mars_context * | mars, | |
struct mars_task_event_flag * | event_flag, | |||
uint8_t | direction, | |||
uint8_t | clear_mode | |||
) |
[host] Initializes a task event flag.
[in] | mars | - pointer to initialized MARS context |
[out] | event_flag | - pointer to event flag instance to initialize |
[in] | direction | - direction of the event flag |
[in] | clear_mode | - behavior of how the event flag is cleared |
int mars_task_event_flag_clear | ( | struct mars_task_event_flag * | event_flag, | |
uint32_t | bits | |||
) |
[host] Clears the bits specified in the task event flag.
[in] | event_flag | - pointer to initialized event flag instance |
[in] | bits | - bits to clear |
int mars_task_event_flag_set | ( | struct mars_task_event_flag * | event_flag, | |
uint32_t | bits | |||
) |
[host] Sets the bits specified in the task event flag.
[in] | event_flag | - pointer to initialized event flag instance |
[in] | bits | - bits to set |
int mars_task_event_flag_wait | ( | struct mars_task_event_flag * | event_flag, | |
uint32_t | mask, | |||
uint8_t | mask_mode | |||
) |
[host] Waits on a task event flag. (Blocking)
[in] | event_flag | - pointer to initialized event flag instance |
[in] | mask | - bit mask to test event flag bits against |
[in] | mask_mode | - specifies how to mask bits (AND, OR) |
int mars_task_event_flag_try_wait | ( | struct mars_task_event_flag * | event_flag, | |
uint32_t | mask, | |||
uint8_t | mask_mode | |||
) |
[host] Waits on a task event flag. (Non-Blocking)
[in] | event_flag | - pointer to initialized event flag instance |
[in] | mask | - bit mask to test event flag bits against |
[in] | mask_mode | - specifies how to mask bits (AND, OR) |
int mars_task_event_flag_initialize | ( | uint64_t | event_flag_ea, | |
uint8_t | direction, | |||
uint8_t | clear_mode | |||
) |
[MPU] Initializes a task event flag.
[out] | event_flag_ea | - ea of event flag instance to initialize |
[in] | direction | - direction of the event flag |
[in] | clear_mode | - behavior of how the event flag is cleared |
int mars_task_event_flag_clear | ( | uint64_t | event_flag_ea, | |
uint32_t | bits | |||
) |
[MPU] Clears the bits specified in the task event flag.
[in] | event_flag_ea | - ea of initialized event flag instance |
[in] | bits | - bits to clear |
int mars_task_event_flag_set | ( | uint64_t | event_flag_ea, | |
uint32_t | bits | |||
) |
[MPU] Sets the bits specified in the task event flag.
[in] | event_flag_ea | - ea of initialized event flag instance |
[in] | bits | - bits to set |
int mars_task_event_flag_wait | ( | uint64_t | event_flag_ea, | |
uint32_t | mask, | |||
uint8_t | mask_mode | |||
) |
[MPU] Waits on a task event flag. (Blocking)
[in] | event_flag_ea | - ea of initialized event flag instance |
[in] | mask | - bit mask to test event flag bits against |
[in] | mask_mode | - specifies how to mask bits (AND, OR) |
int mars_task_event_flag_try_wait | ( | uint64_t | event_flag_ea, | |
uint32_t | mask, | |||
uint8_t | mask_mode | |||
) |
[MPU] Waits on a task event flag. (Non-Blocking)
[in] | event_flag_ea | - ea of initialized event flag instance |
[in] | mask | - bit mask to test event flag bits against |
[in] | mask_mode | - specifies how to mask bits (AND, OR) |
MARS task event flag structure.
An instance of this structure must be created when using any of the MARS event flag API.
If allocating a memory area for this structure, make sure to allocate a memory area that is aligned to MARS_TASK_EVENT_FLAG_ALIGN bytes and of size MARS_TASK_EVENT_FLAG_SIZE bytes.