Data Structures | |
| struct | rtos_instance_t |
| Instance of a FreeRTOS task. More... | |
Enumerations | |
| enum | rtos_event_t { RESEND_SENSOR = 0 , RESEND_IMAGE , RESEND_VIDEO } |
| Event types posted to the memory event queue. More... | |
Functions | |
| BaseType_t | task_create (TaskFunction_t pxTaskCode, rtos_instance_t *inst, void *const pvParameters) |
| Create a FreeRTOS task using the provided instance parameters. | |
| void | log_watermark (const rtos_instance_t *const inst) |
| Log the high-water mark (stack usage in bytes) of a FreeRTOS task. | |
| void | log_info (const rtos_instance_t *const inst) |
| Log general task information in a human-readable way. | |
| pal_err_t | sensor_queues_init (void) |
| Create and initialize all sensor measurement queues. | |
| pal_err_t | system_queues_init (void) |
| Create and initialize all system queues. | |
Sensor Queues | |
FreeRTOS queues carrying measurements from each sensor task. | |
| QueueHandle_t | queue_scd30 |
| SCD30 measurement queue. | |
| QueueHandle_t | queue_veml7700 |
| VEML7700 measurement queue. | |
| QueueHandle_t | queue_bme280 |
| BME280 measurement queue. | |
System Queues | |
FreeRTOS queues used by the aggregation, packet and memory tasks. | |
| QueueHandle_t | queue_sens_agg |
| Aggregated sensor payload queue. | |
| QueueHandle_t | queue_pkt_tx |
| New outgoing packets queue. | |
| QueueHandle_t | queue_pkt_rx |
| Inbound packet queue. | |
| QueueHandle_t | queue_pkt_retx |
| Stored outgoing packet queue. | |
| QueueHandle_t | queue_mem_evt |
| Memory task event queue. | |
Core Definitions | |
CPU core identifiers | |
| #define | CORE0 (0) |
| CPU core 0. | |
| #define | CORE1 (1) |
| CPU core 1. | |
General Macros | |
| #define | WORD_LEN_BYTE (4) |
| Word length in bytes. | |
| #define | BASIC_QUEUE_DEPTH (5) |
| Default number of items a queue can hold. | |
| #define | SENSOR_RESEND_QUEUE_DEPTH (32) |
| Depth for the sensor data retransmission queue. | |
| #define | NOT_SET (255) |
| Sentinel value for uninitialized fields. | |
A collection of useful ESP-IDF FreeRTOS wrappers.
| struct rtos_instance_t |
Instance of a FreeRTOS task.
Stores the task handle and its configuration parameters.
| #define BASIC_QUEUE_DEPTH (5) |
Default number of items a queue can hold.
| #define CORE0 (0) |
CPU core 0.
| #define CORE1 (1) |
CPU core 1.
| #define NOT_SET (255) |
Sentinel value for uninitialized fields.
| #define SENSOR_RESEND_QUEUE_DEPTH (32) |
Depth for the sensor data retransmission queue.
| #define WORD_LEN_BYTE (4) |
Word length in bytes.
| enum rtos_event_t |
| void log_info | ( | const rtos_instance_t *const | inst | ) |
Log general task information in a human-readable way.
The following information is logged:
| inst | Pointer to the rtos_instance_t structure. |
NULL if calling this function from within the task itself. | void log_watermark | ( | const rtos_instance_t *const | inst | ) |
Log the high-water mark (stack usage in bytes) of a FreeRTOS task.
Uses FreeRTOS uxTaskGetStackHighWaterMark() internally.
uxTaskGetStackHighWaterMark() from FreeRTOS for more details.| inst | Pointer to the rtos_instance_t structure. |
NULL if calling this function from within the task itself. | pal_err_t sensor_queues_init | ( | void | ) |
Create and initialize all sensor measurement queues.
Initializes the following queues:
queue_scd30 to hold sensor payload part items of type scd30_meas_t. queue_veml7700 to hold sensor payload part items of type veml7700_meas_t. queue_bme280 to hold sensor payload part items of type bme280_meas_t. All queues can hold BASIC_QUEUE_DEPTH items.
payload_utils.h for payload item types.| PAL_OK | On success. |
| PAL_ERR_INVALID_ARG | One or more queues could not be created. |
| pal_err_t system_queues_init | ( | void | ) |
Create and initialize all system queues.
Initializes the following queues:
queue_sens_agg to hold sensor paylaod items of type sensor_payload_t. queue_pkt_tx to hold packet items of type packet_t. queue_pkt_rx to hold packet items of type packet_t. queue_pkt_retx to hold packet memory indexes of type uint8_t. queue_mem_evt to hold RTOS event items of type rtos_event_t. Queues can hold BASIC_QUEUE_DEPTH items, except queue_pkt_retx which is of depth SENSOR_RESEND_QUEUE_DEPTH.
payload_utils.h for payload item types and packet_utils.h for packet items type.| PAL_OK | On success. |
| PAL_ERR_INVALID_ARG | One or more queues could not be created. |
| BaseType_t task_create | ( | TaskFunction_t | pxTaskCode, |
| rtos_instance_t * | inst, | ||
| void *const | pvParameters ) |
Create a FreeRTOS task using the provided instance parameters.
Uses FreeRTOS xTaskCreatePinnedToCore() internally.
xTaskCreatePinnedToCore() from FreeRTOS for more details.| [in] | pxTaskCode | Pointer to the task function. |
| [in,out] | inst | Pointer to a preconfigured rtos_instance_t structure. |
| [in] | pvParameters | Parameters to pass to the task function. |
BaseType_t value from xTaskCreatePinnedToCore().
|
extern |
BME280 measurement queue.
|
extern |
Memory task event queue.
|
extern |
Stored outgoing packet queue.
|
extern |
Inbound packet queue.
|
extern |
New outgoing packets queue.
|
extern |
SCD30 measurement queue.
|
extern |
Aggregated sensor payload queue.
|
extern |
VEML7700 measurement queue.