6 years, 9 months ago.

why are many nrf51 sdk drivers not in the libraries?

I noticed comparing the nordic mbed sdk libs (nrf51-sdk and nrf51822) vs the nordic sdks, e.g. 10.0.0, there seem to be missing quite a few C drivers, e.g. drivers_nrf/spi_master/nrf_drv_spi.h

I know that the mbed api implements many of these at a low level, but I'm working on an mbed project which have some C libs which I want to use C function callbacks instead of the C++ OO way. Maybe there is a better way to access spi peripherals, for example, via C?

Question relating to:

Nordic Semiconductor is a fabless semiconductor company specializing in ultra low-power wireless SoCs and connectivity devices for the 2.4 GHz ISM band.

1 Answer

6 years, 9 months ago.

I'm not sure why there are C drivers missing, but:

  1. mbed has C APIs available for SPI too, see spi_api.h.
  2. If you want to mix C++ and C and want to pass an mbed Callback<> object to a C API, you can use the ::thunk method. See Callback.h.

Accepted Answer