Reading the incoming data bypasses the SPI API and touches the SPI
data register directly; which port that is needs to be specified in
the pins file
Signed-off-by: Keith Packard <keithp@keithp.com>
{
uint8_t d;
- d = stm_spi2.dr;
- stm_spi2.dr = 0;
+ d = AO_CC1120_SPI.dr;
+ AO_CC1120_SPI.dr = 0;
if (rx_ignore == 0) {
if (rx_data_cur >= rx_data_count)
ao_exti_disable(AO_CC1120_INT_PORT, AO_CC1120_INT_PIN);
ao_radio_wake = 0;
ao_radio_mcu_wake = 0;
- stm_spi2.cr2 = 0;
+ AO_CC1120_SPI.cr2 = 0;
/* clear any RXNE */
- (void) stm_spi2.dr;
+ (void) AO_CC1120_SPI.dr;
/* Have the radio signal when the preamble quality goes high */
ao_radio_reg_write(AO_CC1120_INT_GPIO_IOCFG, CC1120_IOCFG_GPIO_CFG_PQT_REACHED);
#define AO_CC1120_SPI_CS_PORT (&stm_gpioa)
#define AO_CC1120_SPI_CS_PIN 0
#define AO_CC1120_SPI_BUS AO_SPI_2_PB13_PB14_PB15
+#define AO_CC1120_SPI stm_spi2
#define AO_CC1120_INT_PORT (&stm_gpioc)
-#define AO_CC1120_INT_PIN 14
+#define AO_CC1120_INT_PIN 13
#define AO_CC1120_MCU_WAKEUP_PORT (&stm_gpioc)
#define AO_CC1120_MCU_WAKEUP_PIN (0)
#define AO_CC1120_SPI_CS_PORT (&stm_gpioc)
#define AO_CC1120_SPI_CS_PIN 5
#define AO_CC1120_SPI_BUS AO_SPI_2_PB13_PB14_PB15
+#define AO_CC1120_SPI stm_spi2
#define AO_CC1120_INT_PORT (&stm_gpioc)
#define AO_CC1120_INT_PIN 14