altos: Add SPI slave get/put macros to cc1111
authorKeith Packard <keithp@keithp.com>
Mon, 27 Aug 2012 20:35:39 +0000 (13:35 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 27 Aug 2012 20:35:39 +0000 (13:35 -0700)
Theese don't try to drive the chip select line

Signed-off-by: Keith Packard <keithp@keithp.com>
src/cc1111/ao_arch_funcs.h

index 29755b5c5c8c47d3b3e177a21b0cbad01a044189..5e2fc13db1ab808f8a6e5eda1607d5fe871626d5 100644 (file)
@@ -29,6 +29,15 @@ extern __xdata uint8_t       ao_spi_mutex;
                                          UxGCR_ORDER_MSB |             \
                                          ((speed) << UxGCR_BAUD_E_SHIFT)))
 
+#define ao_spi_get_slave(bus) do {                     \
+               ao_mutex_get(&ao_spi_mutex);            \
+               ao_spi_set_speed(AO_SPI_SPEED_FAST);    \
+       } while (0)
+
+#define ao_spi_put_slave(bus) do {             \
+               ao_mutex_put(&ao_spi_mutex);    \
+       } while (0)
+
 #define ao_spi_get_mask(reg,mask,bus,speed) do {       \
                ao_mutex_get(&ao_spi_mutex);            \
                ao_spi_set_speed(speed);                \