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

Data Structures

struct  scd30_meas_t
 SCD30 CO₂, temperature, and humidity measurement. More...
 
struct  veml7700_meas_t
 VEML7700 ambient light level measurement. More...
 
struct  bme280_meas_t
 BME280 temperature, humidity and pressure measurement. More...
 
struct  sensor_payload_t
 Aggregated payload holding measurements from all sensors. More...
 

Functions

pal_err_t pl_set_scd30_data (sensor_payload_t *restrict pl, const scd30_meas_t *restrict data)
 Copy SCD30 measurement data into a sensor payload.
 
pal_err_t pl_set_veml7700_data (sensor_payload_t *restrict pl, const veml7700_meas_t *restrict data)
 Copy VEML7700 measurement data into a sensor payload.
 
pal_err_t pl_set_bme280_data (sensor_payload_t *restrict pl, const bme280_meas_t *restrict data)
 Copy BME280 measurement data into a sensor payload.
 

Detailed Description

Provides measurement structures for each supported sensor and helper functions to copy their data into a unified payload strucuture ready for transmission.

Todo
Add relevant identification metadata to the sensor payload structure so that it would be possible to know when measurements were taken.
Warning
The current sensor payload implementation writes the sensor struct directly into the packet payload as-is, without any byte-by-byte packing as described in the protocol. This makes it sensitive to the platform endianness (little-endian).
Todo
Rewrite the sensor payload structure and packing processes to store each field byte by byte instead of copying the raw data struct, as recommended by the protocol.

Data Structure Documentation

◆ scd30_meas_t

struct scd30_meas_t

SCD30 CO₂, temperature, and humidity measurement.

Data Fields
float co2 CO₂ concentration [ppm].
float rh Relative humidity [%].
float t Temperature [°C].

◆ veml7700_meas_t

struct veml7700_meas_t

VEML7700 ambient light level measurement.

Data Fields
uint32_t als Ambient light level [lx].

◆ bme280_meas_t

struct bme280_meas_t

BME280 temperature, humidity and pressure measurement.

Data Fields
float p Atmospheric pressure [hPa].
float rh Relative humidity [%].
float t Temperature [°C].

◆ sensor_payload_t

struct sensor_payload_t

Aggregated payload holding measurements from all sensors.

Fields are populated individually via the pl_set_*_data() helpers.

Data Fields
uint32_t als_veml7700 VEML7700 ambient light level [lx].
float co2_scd30 SCD30 CO₂ concentration [ppm].
float p_bme280 BME280 atmospheric [hPa].
float rh_bme280 BME280 relative humidity [%].
float rh_scd30 SCD30 relative humidity [%].
float t_bme280 BME280 temperature [°C].
float t_scd30 SCD30 temperature [°C].

Function Documentation

◆ pl_set_bme280_data()

pal_err_t pl_set_bme280_data ( sensor_payload_t *restrict pl,
const bme280_meas_t *restrict data )

Copy BME280 measurement data into a sensor payload.

Parameters
[in,out]plPointer to the payload to update.
[in]dataPointer to the BME280 measurement to copy from.
Return values
PAL_OKOn success.
PAL_ERR_INVALID_ARGAny pointer is NULL.

◆ pl_set_scd30_data()

pal_err_t pl_set_scd30_data ( sensor_payload_t *restrict pl,
const scd30_meas_t *restrict data )

Copy SCD30 measurement data into a sensor payload.

Parameters
[in,out]plPointer to the payload to update.
[in]dataPointer to the SCD30 measurement to copy from.
Return values
PAL_OKOn success.
PAL_ERR_INVALID_ARGAny pointer is NULL.

◆ pl_set_veml7700_data()

pal_err_t pl_set_veml7700_data ( sensor_payload_t *restrict pl,
const veml7700_meas_t *restrict data )

Copy VEML7700 measurement data into a sensor payload.

Parameters
[in,out]plPointer to the payload to update.
[in]dataPointer to the VEML7700 measurement to copy from.
Return values
PAL_OKOn success.
PAL_ERR_INVALID_ARGAny pointer is NULL.