* ao_adc.c
*/
-#define AO_ADC_RING 32
+#define AO_ADC_RING 8
#define ao_adc_ring_next(n) (((n) + 1) & (AO_ADC_RING - 1))
#define ao_adc_ring_prev(n) (((n) - 1) & (AO_ADC_RING - 1))
void
ao_led_init(uint8_t enable);
+/*
+ * ao_lcd.c
+ */
+
+void
+ao_lcd_init(void);
+
/*
* ao_romconfig.c
*/
(f).remove = ((f).remove + 1) & (AO_FIFO_SIZE-1); \
} while(0)
+#define ao_fifo_reset(f) ((f).insert = (f).remove = 0)
#define ao_fifo_full(f) ((((f).insert + 1) & (AO_FIFO_SIZE-1)) == (f).remove)
#define ao_fifo_empty(f) ((f).insert == (f).remove)
void
ao_debug_init(void);
+/* ao_spi_slave.c */
+
+int
+ao_spi_slave_read(uint8_t *data, int len);
+
+int
+ao_spi_slave_write(uint8_t *data, int len);
+
+void
+ao_spi_slave_debug(void);
+
+void
+ao_spi_slave_init(void);
+
+/* ao_companion.c */
+
+#define AO_COMPANION_SETUP 1
+#define AO_COMPANION_FETCH 2
+
+struct ao_companion_command {
+ uint8_t command;
+ uint8_t flight_state;
+ uint16_t tick;
+};
+
+struct ao_companion_setup {
+ uint16_t board_id;
+ uint16_t board_id_inverse;
+ uint8_t update_period;
+ uint8_t channels;
+};
+
#endif /* _AO_H_ */