Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 3 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:
1 Answer
7 years, 3 months ago.
I'm not sure why there are C drivers missing, but:
- mbed has C APIs available for SPI too, see spi_api.h.
- 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.