ESP32-P4 OBC Firmware
ESP-IDF firmware for Plant-B CubeSat OBC
 
Loading...
Searching...
No Matches
rtos_utils.h File Reference

A collection of useful ESP-IDF FreeRTOS wrappers. More...

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "pal_err.h"
#include "pal_log.h"
#include "payload_utils.h"
#include "packet_utils.h"

Go to the source code of this file.

Data Structures

struct  rtos_instance_t
 Instance of a FreeRTOS task. More...
 

Macros

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.
 

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.
 

Variables

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.
 

Detailed Description

A collection of useful ESP-IDF FreeRTOS wrappers.

Author
Adrien Chevrier

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Version
0.1
Date
2026-02-05