altos: Change CC1120 SPI speed to 4MHz.
authorKeith Packard <keithp@keithp.com>
Mon, 14 Jan 2013 05:38:26 +0000 (21:38 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 14 Jan 2013 05:38:26 +0000 (21:38 -0800)
Most of the chip can run at 8MHz, but extended register access is
limited to 6.1MHz. Instead of pushing things, just run the SPI bus at
4MHz.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_cc1120.c

index 8068740f91782483e6f83329a4f439d2c778b5a5..53bb5a62f5621bedb4c94d48d76b660b5213ea46 100644 (file)
@@ -38,7 +38,7 @@ extern const uint32_t ao_radio_cal;
 
 #define FOSC   32000000
 
-#define ao_radio_select()      ao_spi_get_mask(AO_CC1120_SPI_CS_PORT,(1 << AO_CC1120_SPI_CS_PIN),AO_CC1120_SPI_BUS,AO_SPI_SPEED_1MHz)
+#define ao_radio_select()      ao_spi_get_mask(AO_CC1120_SPI_CS_PORT,(1 << AO_CC1120_SPI_CS_PIN),AO_CC1120_SPI_BUS,AO_SPI_SPEED_4MHz)
 #define ao_radio_deselect()    ao_spi_put_mask(AO_CC1120_SPI_CS_PORT,(1 << AO_CC1120_SPI_CS_PIN),AO_CC1120_SPI_BUS)
 #define ao_radio_spi_send(d,l) ao_spi_send((d), (l), AO_CC1120_SPI_BUS)
 #define ao_radio_spi_send_fixed(d,l) ao_spi_send_fixed((d), (l), AO_CC1120_SPI_BUS)