32 #ifndef ROSFLIGHT_FIRMWARE_BOARD_H 33 #define ROSFLIGHT_FIRMWARE_BOARD_H 80 virtual void init_board() = 0;
81 virtual void board_reset(
bool bootloader) = 0;
84 virtual uint32_t clock_millis() = 0;
85 virtual uint64_t clock_micros() = 0;
86 virtual void clock_delay(uint32_t milliseconds) = 0;
89 virtual void serial_init(uint32_t baud_rate, uint32_t dev) = 0;
90 virtual void serial_write(
const uint8_t *src,
size_t len) = 0;
91 virtual uint16_t serial_bytes_available() = 0;
92 virtual uint8_t serial_read() = 0;
93 virtual void serial_flush() = 0;
96 virtual void sensors_init() = 0;
101 virtual void imu_not_responding_error() = 0;
104 virtual void mag_update() = 0;
105 virtual void mag_read(
float mag[3]) = 0;
108 virtual void baro_update() = 0;
111 virtual bool diff_pressure_present() = 0;
112 virtual void diff_pressure_update() = 0;
113 virtual void diff_pressure_read(
float *diff_pressure,
float *
temperature) = 0;
116 virtual void sonar_update() = 0;
117 virtual float sonar_read() = 0;
119 virtual bool gnss_present() = 0;
120 virtual void gnss_update() = 0;
123 virtual bool gnss_has_new_data() = 0;
124 virtual GNSSRaw gnss_raw_read() = 0;
127 virtual void rc_init(
rc_type_t rc_type) = 0;
128 virtual bool rc_lost() = 0;
129 virtual float rc_read(uint8_t channel) = 0;
132 virtual void pwm_init(uint32_t refresh_rate, uint16_t idle_pwm) = 0;
133 virtual void pwm_disable() = 0;
134 virtual void pwm_write(uint8_t channel,
float value) = 0;
137 virtual void memory_init() = 0;
138 virtual bool memory_read(
void *dest,
size_t len) = 0;
139 virtual bool memory_write(
const void *src,
size_t len) = 0;
142 virtual void led0_on() = 0;
143 virtual void led0_off() = 0;
144 virtual void led0_toggle() = 0;
146 virtual void led1_on() = 0;
147 virtual void led1_off() = 0;
148 virtual void led1_toggle() = 0;
151 virtual bool has_backup_data() = 0;
158 #endif // ROSLFIGHT_FIRMWARE_BOARD_H static volatile int16_t gyro[3]
static volatile int16_t accel[3]
StateManager::State state
uint16_t num_sensor_errors()