altos: Add TelePyro v0.1 support
[fw/altos] / src / core / ao.h
index 8b978272349607e8c9dc493fcd29cfa1d81fe9c3..04610fea4324de241af45de38527eea21c5e8e87 100644 (file)
@@ -974,12 +974,23 @@ ao_spi_init(void);
  * ao_spi_slave.c
  */
 
+uint8_t
+ao_spi_read(uint8_t *buf, uint8_t len);
+
 void
-ao_spi_slave_debug(void);
+ao_spi_write(uint8_t *buf, uint8_t len);
 
 void
 ao_spi_slave_init(void);
 
+/* This must be defined by the product; it will get called when chip
+ * select goes low, at which point it should use ao_spi_read and
+ * ao_spi_write to deal with the request
+ */
+
+void
+ao_spi_slave(void);
+
 /*
  * ao_telemetry.c
  */
@@ -1330,8 +1341,18 @@ ao_radio_recv(__xdata void *data, uint8_t size) __reentrant;
 void
 ao_radio_recv_abort(void);
 
+/*
+ * Compute the packet length as follows:
+ *
+ * 2000 bps (for a 1kHz tone)
+ * so, for 'ms' milliseconds, we need
+ * 2 * ms bits, or ms / 4 bytes
+ */
+
+#define AO_MS_TO_RDF_LEN(ms) ((ms) > 255 * 4 ? 255 : ((ms) >> 2))
+
 void
-ao_radio_rdf(int ms);
+ao_radio_rdf(uint8_t pkt_len);
 
 void
 ao_radio_rdf_abort(void);
@@ -1360,6 +1381,7 @@ extern __xdata union ao_monitor ao_monitor_ring[AO_MONITOR_RING];
 
 #define ao_monitor_ring_next(n)        (((n) + 1) & (AO_MONITOR_RING - 1))
 
+extern __data uint8_t ao_monitoring;
 extern __data uint8_t ao_monitor_head;
 
 void
@@ -1435,6 +1457,8 @@ extern __xdata struct ao_ignition ao_ignition[2];
 enum ao_igniter_status
 ao_igniter_status(enum ao_igniter igniter);
 
+extern __pdata uint8_t ao_igniter_present;
+
 void
 ao_ignite_set_pins(void);
 
@@ -1787,4 +1811,10 @@ ao_log_single_init(void);
 void
 ao_log_single(void);
 
+/*
+ * ao_pyro_slave.c
+ */
+
+#define AO_TELEPYRO_NUM_ADC    9
+
 #endif /* _AO_H_ */