ESP32-P4 OBC Firmware
ESP-IDF firmware for Plant-B CubeSat OBC
 
Loading...
Searching...
No Matches
FreeRTOS Utilities

Data Structures

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

Enumerations

enum  rtos_event_t { RESEND_SENSOR = 0 , RESEND_IMAGE , RESEND_VIDEO }
 

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)
 
pal_err_t system_queues_init (void)
 

Variables

QueueHandle_t queue_scd30
 
QueueHandle_t queue_veml7700
 
QueueHandle_t queue_bme280
 
QueueHandle_t queue_sens_agg
 
QueueHandle_t queue_pkt_tx
 
QueueHandle_t queue_pkt_rx
 
QueueHandle_t queue_pkt_retx
 
QueueHandle_t queue_mem_evt
 

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)
 
#define SENSOR_RESEND_QUEUE_DEPTH   (32)
 
#define NOT_SET   (255)
 Default uninitialized value.
 

Detailed Description

A collection of useful ESP-IDF FreeRTOS wrappers.


Data Structure Documentation

◆ rtos_instance_t

struct rtos_instance_t

Instance of a FreeRTOS task.

Stores the task handle and its configuration parameters.

Data Fields
const BaseType_t CORE CPU core for pinning the task.
const UBaseType_t PRIORITY Task priority.
const uint32_t STACK_SIZE Task stack size in words.
const char *const TAG Tag used for logging.
TaskHandle_t task_handle FreeRTOS task handle.

Macro Definition Documentation

◆ BASIC_QUEUE_DEPTH

#define BASIC_QUEUE_DEPTH   (5)

◆ CORE0

#define CORE0   (0)

CPU core 0.

◆ CORE1

#define CORE1   (1)

CPU core 1.

◆ NOT_SET

#define NOT_SET   (255)

Default uninitialized value.

◆ SENSOR_RESEND_QUEUE_DEPTH

#define SENSOR_RESEND_QUEUE_DEPTH   (32)

◆ WORD_LEN_BYTE

#define WORD_LEN_BYTE   (4)

Word length in bytes.

Enumeration Type Documentation

◆ rtos_event_t

Enumerator
RESEND_SENSOR 
RESEND_IMAGE 
RESEND_VIDEO 

Function Documentation

◆ log_info()

void log_info ( const rtos_instance_t *const inst)

Log general task information in a human-readable way.

The following information is logged:

  • Core ID.
  • Current state.
  • Current priority level.
  • Current high-water mark.
Parameters
instPointer to the rtos_instance_t structure.
Note
Pass NULL if calling this function from within the task itself.

◆ log_watermark()

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.

See also
uxTaskGetStackHighWaterMark() from FreeRTOS for more details.
Parameters
instPointer to the rtos_instance_t structure.
Note
Pass NULL if calling this function from within the task itself.

◆ sensor_queues_init()

pal_err_t sensor_queues_init ( void )

◆ system_queues_init()

pal_err_t system_queues_init ( void )

◆ task_create()

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.

See also
xTaskCreatePinnedToCore() from FreeRTOS for more details.
Parameters
[in]pxTaskCodePointer to the task function.
[in,out]instPointer to a preconfigured rtos_instance_t structure.
[in]pvParametersParameters to pass to the task function.
Returns
Any BaseType_t value from xTaskCreatePinnedToCore().

Variable Documentation

◆ queue_bme280

QueueHandle_t queue_bme280
extern

◆ queue_mem_evt

QueueHandle_t queue_mem_evt
extern

◆ queue_pkt_retx

QueueHandle_t queue_pkt_retx
extern

◆ queue_pkt_rx

QueueHandle_t queue_pkt_rx
extern

◆ queue_pkt_tx

QueueHandle_t queue_pkt_tx
extern

◆ queue_scd30

QueueHandle_t queue_scd30
extern

◆ queue_sens_agg

QueueHandle_t queue_sens_agg
extern

◆ queue_veml7700

QueueHandle_t queue_veml7700
extern