UoS³ Flight Computer Firmware
 All Data Structures Files Functions Groups Pages
configuration.h
1 
11 #ifndef __CONFIGURATION_H__
12 #define __CONFIGURATION_H__
13 
14 #include <stdint.h>
15 #include <stdbool.h>
16 
17 /* TODO: Move these below into the relevant modules */
18 
19 typedef enum {
20  tx_datarate_6kbps,
21  tx_datarate_3kbps,
22  tx_datarate_1kbps,
23  tx_datarate_05kbps,
24  tx_datarate_025kbps
25 } tx_datarate_t;
26 
27 typedef enum {
28  tx_power_300mw,
29  tx_power_200mw,
30  tx_power_100mw,
31  tx_power_50mw,
32  tx_power_10mw
33 } tx_power_t;
34 
35 typedef enum {
36  image_acquisition_profile_1600x1200_10,
37  image_acquisition_profile_640x480_10
38 } image_acquisition_profile_t;
39 
40 /* Refer to https://docs.google.com/spreadsheets/d/1OFgH6SIJJw-ISLHxVPTY4VEa49qBMccs4Qu1e_zjqvg/ */
41 /* Packing work in progress */
42 typedef struct configuration_data_t {
43  /* 32b word */
44  bool tx_enable:1;
45  bool enable_gps_time_sync:1;
46  bool imu_accel_enabled:1;
47  bool imu_gyro_enabled:1;
48  bool imu_magno_enabled:1;
49 
50  /* 32b word */
51  tx_datarate_t tx_datarate:4;
52  tx_power_t tx_power:4;
53  tx_power_t tx_overtemp_power:4;
54  imu_bandwidth_t imu_bandwidth:4;
55  image_acquisition_profile_t image_acquisition_profile:4;
56 
57  uint8_t tx_interval;
58  uint8_t tx_interval_burst;
59 
60  uint8_t tx_overtemp_threshold;
61 
62  uint8_t low_voltage_threshold;
63  uint8_t low_voltage_recovery;
64 
65  uint16_t health_acquisition_interval; // seconds
66  uint16_t configuration_acquisition_interval; // seconds
67  uint16_t imu_acquisition_interval; // seconds
68  uint16_t gps_acquisition_interval; // seconds
69  uint32_t image_acquisition_time; // unix epoch time
70 
71 
72  uint8_t imu_sample_count;
73  uint8_t imu_sample_interval; // *10ms
74 
75  uint8_t gps_sample_count;
76  uint8_t gps_sample_interval; // seconds
77 
78 
79 
80  uint16_t greetings_message_transmission_interval; // packets
82 
83 typedef struct configuration_t {
85  uint16_t checksum;
87 
88 
89 configuration_t spacecraft_configuration;
90 
91 void Configuration_Init(void);
92 
93 bool Configuration_verify_checksum(void);
94 
95 #endif /* __CONFIGURATION_H__ */