Hi friend,
I am using SDK16.0 and softdevice is S140 7.0.1 version. But SPI can only send out 1 byte. It can't call back the function of spi_event_handler, so my code is locked while checking spi_xfer_done.
Can someone help me? My code snippet is below.
Thank you in advance.
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static void cc1101_gpio_init(void)
{
nrf_gpio_pin_dir_set(CC1101A_SS_PIN, NRF_GPIO_PIN_DIR_OUTPUT);
nrf_gpio_pin_set(CC1101A_SS_PIN);
nrf_gpio_pin_dir_set(CC1101B_SS_PIN, NRF_GPIO_PIN_DIR_OUTPUT);
nrf_gpio_pin_set(CC1101B_SS_PIN);
nrf_gpio_pin_dir_set(CC1101A_PWR_PIN, NRF_GPIO_PIN_DIR_OUTPUT);
nrf_gpio_pin_clear(CC1101A_PWR_PIN);
nrf_gpio_pin_dir_set(CC1101B_PWR_PIN, NRF_GPIO_PIN_DIR_OUTPUT);
nrf_gpio_pin_clear(CC1101B_PWR_PIN);
}
void spi_event_handler(nrf_drv_spi_evt_t const * p_event, void *p_context)
{
spi_xfer_done = true;
}
void cc1101_spi_init(void)
{
nrf_drv_spi_config_t const spi_config =