altos: Define CC115L spi speed in each product
authorKeith Packard <keithp@keithp.com>
Tue, 4 Apr 2017 22:59:56 +0000 (15:59 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 4 Apr 2017 22:59:56 +0000 (15:59 -0700)
Different SoCs have different SPI speeds available; have each product
specify the speed to use instead of trying to use 4Mhz everywhere.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_cc115l.c
src/telegps-v0.1/ao_pins.h
src/telegps-v0.3/ao_pins.h
src/telegps-v1.0/ao_pins.h

index a67071d24d879c44e348bb8ecb5ff8831e624e9c..c1c21e0d404e2a0259dd3b20ae23e5a0ad464c77 100644 (file)
@@ -39,7 +39,7 @@ static uint8_t ao_radio_abort;                /* radio operation should abort */
 
 #define FOSC   26000000
 
-#define ao_radio_select()      ao_spi_get_mask(AO_CC115L_SPI_CS_PORT,(1 << AO_CC115L_SPI_CS_PIN),AO_CC115L_SPI_BUS,AO_SPI_SPEED_6MHz)
+#define ao_radio_select()      ao_spi_get_mask(AO_CC115L_SPI_CS_PORT,(1 << AO_CC115L_SPI_CS_PIN),AO_CC115L_SPI_BUS,AO_CC115L_SPI_SPEED)
 #define ao_radio_deselect()    ao_spi_put_mask(AO_CC115L_SPI_CS_PORT,(1 << AO_CC115L_SPI_CS_PIN),AO_CC115L_SPI_BUS)
 #define ao_radio_spi_send(d,l) ao_spi_send((d), (l), AO_CC115L_SPI_BUS)
 #define ao_radio_spi_send_fixed(d,l) ao_spi_send_fixed((d), (l), AO_CC115L_SPI_BUS)
index 96e8cfd7d1d5f4d00a2f0d152d5d9cc6d313df5c..0b610cacf3782a5c17e0d4b1e073bb4f9f5418a7 100644 (file)
 #define AO_CC115L_SPI_CS_PIN   12
 #define AO_CC115L_SPI_BUS      AO_SPI_2_PB13_PB14_PB15
 #define AO_CC115L_SPI          stm_spi2
+#define AO_CC115L_SPI_SPEED    AO_SPI_SPEED_4MHz
 
 #define AO_CC115L_FIFO_INT_GPIO_IOCFG  CC115L_IOCFG2
 #define AO_CC115L_FIFO_INT_PORT                (&stm_gpioa)
index 9c650cc42441f1b646ab9de036fa887fd46a6202..28ae30a47da0d0501e2ddc787272da3dcf3d8d54 100644 (file)
@@ -95,6 +95,7 @@
 #define AO_CC115L_SPI_CS_PORT  0
 #define AO_CC115L_SPI_CS_PIN   3
 #define AO_CC115L_SPI_BUS      0
+#define AO_CC115L_SPI_SPEED    AO_SPI_SPEED_6MHz
 
 #define AO_CC115L_FIFO_INT_GPIO_IOCFG  CC115L_IOCFG2
 #define AO_CC115L_FIFO_INT_PORT                0
index 19774f63cc703e514902e38934b890864e1811c7..9672ab037dbd8005b2c2efe2c9c78e2f8080f684 100644 (file)
@@ -97,6 +97,7 @@
 #define AO_CC115L_SPI_CS_PORT  0
 #define AO_CC115L_SPI_CS_PIN   3
 #define AO_CC115L_SPI_BUS      0
+#define AO_CC115L_SPI_SPEED    AO_SPI_SPEED_6MHz
 
 #define AO_CC115L_FIFO_INT_GPIO_IOCFG  CC115L_IOCFG2
 #define AO_CC115L_FIFO_INT_PORT                0