summaryrefslogtreecommitdiff
path: root/src/ao_pins.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-12-22 21:06:22 -0800
committerKeith Packard <keithp@keithp.com>2010-12-22 21:17:36 -0800
commit9f7296b3feab872bf51fc369ade69cc1e7cf7a3f (patch)
tree3ec494cea281d5df871ffecc94f61cfff88d0226 /src/ao_pins.h
parent51c410c1c952e0e9bcf1b2c438813de63753be5f (diff)
altos: Split out SPI driver.
For TM with the companion connector, the SPI bus will be shared among multiple devices. Split out the existing SPI code into a common driver, with the SPI bus protected by a mutex. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_pins.h')
-rw-r--r--src/ao_pins.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ao_pins.h b/src/ao_pins.h
index e9a265b0..edbb4908 100644
--- a/src/ao_pins.h
+++ b/src/ao_pins.h
@@ -31,6 +31,8 @@
#define AO_LED_RED 1
#define LEDS_AVAILABLE (AO_LED_RED)
#define HAS_EXTERNAL_TEMP 0
+ #define SPI_CS_ON_P1 1
+ #define SPI_CS_ON_P0 0
#endif
#if defined(TELEDONGLE_V_0_2)
@@ -45,6 +47,8 @@
#define AO_LED_RED 1
#define AO_LED_GREEN 2
#define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
+ #define SPI_CS_ON_P1 1
+ #define SPI_CS_ON_P0 0
#endif
#if defined(TELEMETRUM_V_0_1)
@@ -60,6 +64,8 @@
#define AO_LED_GREEN 1
#define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
#define HAS_EXTERNAL_TEMP 1
+ #define SPI_CS_ON_P1 1
+ #define SPI_CS_ON_P0 0
#endif
#if defined(TELEDONGLE_V_0_1)
@@ -74,6 +80,8 @@
#define AO_LED_RED 2
#define AO_LED_GREEN 1
#define LEDS_AVAILABLE (AO_LED_RED|AO_LED_GREEN)
+ #define SPI_CS_ON_P1 0
+ #define SPI_CS_ON_P0 1
#endif
#if defined(TIDONGLE)
@@ -87,6 +95,8 @@
#define PACKET_HAS_SLAVE 0
#define AO_LED_RED 2
#define LEDS_AVAILABLE (AO_LED_RED)
+ #define SPI_CS_ON_P1 0
+ #define SPI_CS_ON_P0 1
#endif
#if DBG_ON_P1
@@ -125,6 +135,18 @@
#endif /* DBG_ON_P0 */
+#if SPI_CS_ON_P1
+ #define SPI_CS_PORT P1
+ #define SPI_CS_SEL P1SEL
+ #define SPI_CS_DIR P1DIR
+#endif
+
+#if SPI_CS_ON_P0
+ #define SPI_CS_PORT P0
+ #define SPI_CS_SEL P0SEL
+ #define SPI_CS_DIR P0DIR
+#endif
+
#ifndef HAS_SERIAL_1
#error Please define HAS_SERIAL_1
#endif