projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Split out SPI driver.
[fw/altos]
/
src
/
ao.h
diff --git
a/src/ao.h
b/src/ao.h
index 8db22799f24df6fca7ec59fb30cc54416572d504..69f4665bca14d84dfcf8acb5863322fe02586512 100644
(file)
--- a/
src/ao.h
+++ b/
src/ao.h
@@
-69,17
+69,13
@@
ao_sleep(__xdata void *wchan);
void
ao_wakeup(__xdata void *wchan);
void
ao_wakeup(__xdata void *wchan);
-/* Wake up a specific task */
-void
-ao_wake_task(__xdata struct ao_task *task);
-
/* set an alarm to go off in 'delay' ticks */
void
ao_alarm(uint16_t delay);
/* Yield the processor to another task */
void
/* set an alarm to go off in 'delay' ticks */
void
ao_alarm(uint16_t delay);
/* Yield the processor to another task */
void
-ao_yield(void) _naked;
+ao_yield(void) _
_
naked;
/* Add a task to the run queue */
void
/* Add a task to the run queue */
void
@@
-139,7
+135,7
@@
ao_timer_set_adc_interval(uint8_t interval) __critical;
/* Timer interrupt */
void
/* Timer interrupt */
void
-ao_timer_isr(void) interrupt 9;
+ao_timer_isr(void)
__
interrupt 9;
/* Initialize the timer */
void
/* Initialize the timer */
void
@@
-198,7
+194,7
@@
ao_adc_get(__xdata struct ao_adc *packet);
/* The A/D interrupt handler */
void
/* The A/D interrupt handler */
void
-ao_adc_isr(void) interrupt 1;
+ao_adc_isr(void)
__
interrupt 1;
/* Initialize the A/D converter */
void
/* Initialize the A/D converter */
void
@@
-325,7
+321,7
@@
ao_usb_flush(void);
/* USB interrupt handler */
void
/* USB interrupt handler */
void
-ao_usb_isr(void) interrupt 6;
+ao_usb_isr(void)
__
interrupt 6;
/* Enable the USB controller */
void
/* Enable the USB controller */
void
@@
-391,14
+387,10
@@
ao_cmd_init(void);
* ao_dma.c
*/
* ao_dma.c
*/
-/* Allocate a DMA channel. the 'done' parameter will be set
- * when the dma is finished or aborted and will be used to
- * wakeup any waiters
+/* Allocate a DMA channel. the 'done' parameter will be set when the
+ * dma is finished and will be used to wakeup any waiters
*/
*/
-#define AO_DMA_DONE 1
-#define AO_DMA_ABORTED 2
-
uint8_t
ao_dma_alloc(__xdata uint8_t * done);
uint8_t
ao_dma_alloc(__xdata uint8_t * done);
@@
-425,7
+417,7
@@
ao_dma_abort(uint8_t id);
/* DMA interrupt routine */
void
/* DMA interrupt routine */
void
-ao_dma_isr(void) interrupt 8;
+ao_dma_isr(void)
__
interrupt 8;
/*
* ao_mutex.c
/*
* ao_mutex.c
@@
-722,10
+714,10
@@
ao_dbg_init(void);
#if HAS_SERIAL_1
void
#if HAS_SERIAL_1
void
-ao_serial_rx1_isr(void) interrupt 3;
+ao_serial_rx1_isr(void)
__
interrupt 3;
void
void
-ao_serial_tx1_isr(void) interrupt 14;
+ao_serial_tx1_isr(void)
__
interrupt 14;
char
ao_serial_getchar(void) __critical;
char
ao_serial_getchar(void) __critical;
@@
-744,6
+736,19
@@
void
ao_serial_init(void);
#endif
ao_serial_init(void);
#endif
+/*
+ * ao_spi.c
+ */
+
+void
+ao_spi_send(void __xdata *block, uint16_t len) __reentrant;
+
+void
+ao_spi_recv(void __xdata *block, uint16_t len) __reentrant;
+
+void
+ao_spi_init(void);
+
/*
* ao_gps.c
*/
/*
* ao_gps.c
*/
@@
-781,9
+786,11
@@
struct ao_gps_sat_data {
uint8_t c_n_1;
};
uint8_t c_n_1;
};
+#define AO_MAX_GPS_TRACKING 12
+
struct ao_gps_tracking_data {
uint8_t channels;
struct ao_gps_tracking_data {
uint8_t channels;
- struct ao_gps_sat_data sats[
12
];
+ struct ao_gps_sat_data sats[
AO_MAX_GPS_TRACKING
];
};
extern __xdata uint8_t ao_gps_mutex;
};
extern __xdata uint8_t ao_gps_mutex;
@@
-836,6
+843,15
@@
struct ao_telemetry {
struct ao_gps_tracking_data gps_tracking;
};
struct ao_gps_tracking_data gps_tracking;
};
+/*
+ * ao_radio_recv tacks on rssi and status bytes
+ */
+struct ao_telemetry_recv {
+ struct ao_telemetry telemetry;
+ int8_t rssi;
+ uint8_t status;
+};
+
/* Set delay between telemetry reports (0 to disable) */
#define AO_TELEMETRY_INTERVAL_PAD AO_MS_TO_TICKS(1000)
/* Set delay between telemetry reports (0 to disable) */
#define AO_TELEMETRY_INTERVAL_PAD AO_MS_TO_TICKS(1000)
@@
-861,7
+877,7
@@
extern __xdata uint8_t ao_radio_done;
extern __xdata uint8_t ao_radio_mutex;
void
extern __xdata uint8_t ao_radio_mutex;
void
-ao_radio_general_isr(void) interrupt 16;
+ao_radio_general_isr(void)
__
interrupt 16;
void
ao_radio_get(void);
void
ao_radio_get(void);
@@
-878,22
+894,16
@@
void
ao_radio_set_rdf(void);
void
ao_radio_set_rdf(void);
void
-ao_radio_send(__xdata struct ao_telemetry *telemetry) __reentrant;
-
-struct ao_radio_recv {
- struct ao_telemetry telemetry;
- int8_t rssi;
- uint8_t status;
-};
+ao_radio_send(__xdata void *data, uint8_t size) __reentrant;
uint8_t
uint8_t
-ao_radio_recv(__xdata
struct ao_radio_recv *recv
) __reentrant;
+ao_radio_recv(__xdata
void *data, uint8_t size
) __reentrant;
void
void
-ao_radio_r
df(int ms
);
+ao_radio_r
ecv_abort(void
);
void
void
-ao_radio_
abort(void
);
+ao_radio_
rdf(int ms
);
void
ao_radio_rdf_abort(void);
void
ao_radio_rdf_abort(void);