Midnight Sun Firmware
Loading...
Searching...
No Matches
notify.h
1#pragma once
2
3/************************************************************************************************
4 * @file notify.h
5 *
6 * @brief Notify Library Header file
7 *
8 * @date 2024-11-05
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13
14/* Inter-component Headers */
15#include "FreeRTOS.h"
16
17/* Intra-component Headers */
18#include "status.h"
19#include "tasks.h"
20
27/* Maximum block amount */
28#define BLOCK_INDEFINITELY UINT16_MAX
29
30/* Invalid event ID */
31#define INVALID_EVENT 32
32
33/* 8 bit value that represents a bit in the notification */
34typedef uint8_t Event;
35
44StatusCode event_from_notification(uint32_t *notification, Event *event);
45
51bool notify_check_event(uint32_t *notification, Event event);
52
59StatusCode notify_get(uint32_t *notification);
60
68StatusCode notify_wait(uint32_t *notification, uint32_t ms_to_wait);
69
76StatusCode notify(Task *task, Event event);
77
83void notify_from_isr(Task *task, Event event);
84
StatusCode event_from_notification(uint32_t *notification, Event *event)
Get the highest priority event available and clears it.
Definition: notify.c:19
StatusCode notify(Task *task, Event event)
Notify a specific task with an event.
Definition: notify.c:70
void notify_from_isr(Task *task, Event event)
Sends an event notification from an ISR to a task.
Definition: notify.c:84
bool notify_check_event(uint32_t *notification, Event event)
Checks if the notification is available in the event.
Definition: notify.c:36
StatusCode notify_wait(uint32_t *notification, uint32_t ms_to_wait)
Get the current notification value for the calilng task with a maximum timeout.
Definition: notify.c:54
StatusCode notify_get(uint32_t *notification)
Get the current notification value for the calilng task without a timeout.
Definition: notify.c:50
StatusCode
StatusCodes for various errors.
Definition: status.h:27
Definition: tasks.h:83