Folks,
Using the HID mouse ble-peripheral example code as a base, I'm attempting to add SPI support, using the SPI example for pieces of code.
- Both sets of code build and run just fine using the SES IDE on my Mac with the nRF52-DK (PCA10040) just fine.
- I used the CMSIS Configuration Wizard to modify the sdk_config.h file in my base project:
- SPI_ENABLED, SPI0_ENABLED, and the ...EASY_DMA option were all set.
- The other flavors of SPI access were checked and left unset.
- Added the extra "includes" needed by SPI, including nrf_drv_spi.h
Started moving lines from the SPI example main.c to my HID example, including:
#define SPI_INSTANCE 0 /**< SPI instance index. */ static const nrf_drv_spi_t spi = NRF_DRV_SPI_DEFAULT_CONFIG NRF_DRV_SPI_INSTANCE(SPI_INSTANCE); /**< SPI instance. */
The second line breaks with a cascade of error messages:
4> In file included from /Users/mikewirth/Desktop/Repositories/nRF5_SDK_15.2.0_9412b96/examples/ble_peripheral/Wield_Mk1/main.c:91:0:
4> ../../../../../../integration/nrfx/legacy/nrf_drv_spi.h:216:6: error: 'nrf_drv_spi_t {aka const struct }' has no member named 'sck_pin'
...
4> /Users/mikewirth/Desktop/Repositories/nRF5_SDK_15.2.0_9412b96/examples/ble_peripheral/Wield_Mk1/main.c:100:34: note: in expansion of macro 'NRF_DRV_SPI_DEFAULT_CONFIG' 4> ../../../../../../integration/nrfx/legacy/nrf_drv_spi.h:148:35: warning: excess elements in struct initializer
...
<color added by me>
Both NRF_DRV_SPI_DEFAULT_CONFIG and NRF_DRV_SPI_INSTANCE(SPI_INSTANCE) seem to return the correct results, e.g., {.sck_pin = NRF_DRV_SPI_PIN_NOT_USED,...} and {...}
Is there some other sdk_config.h setting I'm missing? Any other suggestions?
TIA,
Mike