Hello, What is the diference between nrf_dvr_XXX vs nrf_XXX and why can't I add nrf_dvr_XXX to my project?
And that is my packs:
Thank you
Hello, What is the diference between nrf_dvr_XXX vs nrf_XXX and why can't I add nrf_dvr_XXX to my project?
And that is my packs:
Thank you
The nrf_drv_X is the driver, and the nrf_X is the HAL (Hardware abstraction layer).
The HAL provides basic APIs for accessing the registers. The driver provides APIs on a higher level.
If you have a look in the documentation, you will see that many of the peripheral drivers are divided into an abstraction layer that maps the hardware register operations to functions which are then used in the higher level driver (nrf_drv_X).
For example the PPI is divided into the HAL (developer.nordicsemi.com/.../a00761.html), and the driver (developer.nordicsemi.com/.../a00792.html)
Thank you, Are the driver intend to use with softdevices only?
I think it is important to emphasise that in our case HAL is NOT the abbreviation for the Hardware Abstraction Layer, but it is the abbreviation for the Hardware Access Layer. The Hardware Access Layer gives you the ability to directly access hardware features, while not having to think in terms of registers and bitfields.
For example, insted of writing a code in terms of bitfields and shifts like that:
NRF_ADC->CONFIG =
((uint32_t)NRF_ADC_CONFIG_INPUT_0 << ADC_CONFIG_PSEL_Pos) | (NRF_ADC->CONFIG & ~ADC_CONFIG_PSEL_Msk);
NRF_ADC->ENABLE = ADC_ENABLE_ENABLE_Enabled << ADC_ENABLE_ENABLE_Pos;
you can use this HAL function:
nrf_adc_input_select(NRF_ADC_CONFIG_INPUT_0);
HAL consists of simple, stateless and mostly inline functions. HAL functions are not drivers but are used by drivers as a fundation.
All drivers can be used with and without SoftDevice. The API is the same for both cases. The only thing that you have to do is to define or not SOFTDEVICE_PRESENT in your project.