88 lines
1.9 KiB
C
88 lines
1.9 KiB
C
#ifndef PACKETS_STRUCTS
|
|
#define PACKETS_STRUCTS
|
|
#include "stdint.h"
|
|
|
|
typedef struct __attribute__((packed))
|
|
{
|
|
uint32_t packetIndex;
|
|
uint8_t packetType;
|
|
uint32_t missionTimer;
|
|
} DownBoundPacket;
|
|
|
|
typedef struct __attribute__((packed))
|
|
{
|
|
// MPU data
|
|
int16_t accelerationX;
|
|
int16_t accelerationY;
|
|
int16_t accelerationZ;
|
|
int16_t gyroX;
|
|
int16_t gyroY;
|
|
int16_t gyroZ;
|
|
int16_t magnetX;
|
|
int16_t magnetY;
|
|
int16_t magnetZ;
|
|
int16_t accelerometer_temperature;
|
|
|
|
// CCS data
|
|
uint16_t eCO2;
|
|
uint16_t tvoc;
|
|
uint8_t currentCCS;
|
|
uint16_t rawCCSData;
|
|
|
|
// INA data
|
|
uint16_t volts;
|
|
uint16_t current;
|
|
uint16_t power;
|
|
|
|
// BME DATA
|
|
uint32_t temperature;
|
|
uint16_t humidity;
|
|
uint32_t pressure;
|
|
uint16_t gas;
|
|
bool gas_valid;
|
|
bool heater_stable;
|
|
uint8_t gas_range;
|
|
uint8_t gas_index;
|
|
|
|
// GPS DATA
|
|
uint32_t time_seconds; // Seconds since start of day
|
|
int32_t latitude_centi_degrees; // Latitude * 10,000
|
|
int32_t longitude_centi_degrees; // Longitude * 10,000
|
|
int16_t altitude_centi_meters; // Altitude * 100
|
|
uint8_t fix_quality;
|
|
uint8_t num_satellites;
|
|
uint16_t date_yyddmm; // YYDDMM (from GPRMC)
|
|
uint16_t speed_centi_knots; // Speed * 100 (from GPRMC)
|
|
|
|
int32_t predicted_latitude_centi_degrees; // Latitude * 10,000
|
|
int32_t predicted_longitude_centi_degrees; // Longitude * 10,000
|
|
int16_t predicted_altitude_centi_meters; // Altitude * 100
|
|
|
|
// ADC DATA
|
|
int32_t NH3;
|
|
int32_t CO;
|
|
int32_t NO2;
|
|
int32_t UVC;
|
|
|
|
int16_t currentServoA;
|
|
int16_t targetServoA;
|
|
int16_t currentServoB;
|
|
int16_t targetServoB;
|
|
|
|
} TelemetryPacket;
|
|
|
|
typedef struct __attribute__((packed))
|
|
{
|
|
uint32_t packetIndex;
|
|
uint8_t packetType;
|
|
} UplinkPacket;
|
|
|
|
typedef struct __attribute__((packed))
|
|
{
|
|
uint8_t powerMode;
|
|
uint8_t controlMode;
|
|
uint16_t servoA;
|
|
uint16_t servoB;
|
|
} SystemControlPacket;
|
|
|
|
#endif |