nrfx 2.11.0 to 3.0.0 - NordicSemiconductor/nrfx GitHub Wiki
nrfx 3.0 introduces API changes. This guide lists actions required to make your code compatible with these changes.
HALs
CACHE
-
Encapsulated the following parameters:
- The
setandwaycache parameters in thenrf_cache_set_way_loc_tstructure - The
wordcache data parameter in thenrf_cache_du_word_loc_tstructure
Action: update the
nrf_cache_data_get(),nrf_cache_tag_get(),nrf_cache_line_validity_check()functions calls to use new structures instead of theset,way,wordparameters. - The
CCM
- Changed a type of the
p_dataparameter in thenrf_ccm_cnfptr_set()function tonrf_ccm_cnf_t.
Action: update the affected code. - Changed a returned type of the
nrf_ccm_cnfptr_get()function tonrf_ccm_cnf_t.
Action: update the affected code.
CLOCK
- Changed names of constants in the
nrf_clock_lfclk_tenumerator to uppercase.
Action: update the affected code.
COMP
-
Changed names of the following
nrf_comp_ref_tenumerator constants:NRF_COMP_REF_Int1V2toNRF_COMP_REF_INT_1V2NRF_COMP_REF_Int1V8toNRF_COMP_REF_INT_1V8NRF_COMP_REF_Int2V4toNRF_COMP_REF_INT_2V4NRF_COMP_REF_AReftoNRF_COMP_REF_AREF
Action: update the affected code.
-
Changed names of constants in
nrf_comp_main_mode_t,nrf_comp_hyst_t,nrf_comp_sp_mode_t,nrf_isource_tenumerators to uppercase.
Action: update the affected code.
GPIO
- Replaced the
nrf_gpio_pin_mcusel_tenumerator withnrf_gpio_pin_sel_t.
Action: replace allNRF_GPIO_PIN_MCUSEL_*symbols withNRF_GPIO_PIN_SEL_*. - Removed the deprecated
nrf_gpio_pin_mcu_select()function.
Action: use thenrf_gpio_pin_control_select()function instead.
I2S
- Changed parameters in the
nrf_i2s_pins_set()function to a pointer to thenrf_i2s_pins_tstructure.
Action: update the function calls to pass the I2S pins structure instead of individual parameters. - Changed parameters in the
nrf_i2s_configure()function to a pointer to thenrf_i2s_config_tstructure.
Action: update the function calls to pass the I2S configuration structure instead of individual parameters.
QDEC
- Changed names of constants in the
nrf_qdec_sampleper_tenumerator to uppercase.
Action: align symbols names in the affected code. - Removed the deprecated
nrf_qdec_pio_assign()function.
Action: use thenrf_qdec_pins_set()function instead. - Changed a name of the
NRF_QDEC_LED_NOT_CONNECTEDsymbol toNRF_QDEC_PIN_NOT_CONNECTED.
Action: update the affected code.
QSPI
- Changed types of all members in the
nrf_qspi_pins_tstructure touint32_t.
Action: update the affected code.
RTC
-
Changed names of the following symbols:
RTC_FREQ_TO_PRESCALER()toNRF_RTC_FREQ_TO_PRESCALER()RTC_WRAP()toNRF_RTC_WRAP()RTC_CHANNEL_INT_MASK()toNRF_RTC_CHANNEL_INT_MASK()RTC_INPUT_FREQtoNRF_RTC_INPUT_FREQRTC_CHANNEL_EVENT_ADDRtoNRF_RTC_CHANNEL_EVENT_ADDR
Action: update the affected code.
TIMER
- Removed the deprecated
nrf_timer_frequency_set()andnrf_timer_frequency_get()functions.
Action: usenrf_timer_prescaler_set()andnrf_timer_prescaler_get()instead. - Changed a type of the
channelparameter touint8_tin thenrf_timer_capture_task_get(),nrf_timer_compare_event_get(),nrf_timer_compare_int_get()functions.
Action: update the affected code.
WDT
-
Changed the
nrf_wdt_behaviour_ttype tonrf_wdt_behaviour_mask_tand added the_MASKsuffix to all previously available elements innrf_wdt_behaviour_t.
Action: update the affected code. -
Changed names of the following functions:
nrf_wdt_started()tonrf_wdt_started_check()nrf_wdt_request_status()tonrf_wdt_request_status_check()nrf_wdt_reload_request_is_enabled()tonrf_wdt_reload_request_enable_check()
Action: update the affected code.
Drivers
COMP
- Changed a name of the
NRFX_VOLTAGE_THRESHOLD_TO_INT()macro toNRFX_COMP_VOLTAGE_THRESHOLD_TO_INT().
Action: update the affected code.
GPIOTE
-
Removed the
nrfx_gpiote_out_init(),nrfx_gpiote_out_prealloc_init()functions used for configuring an output pin to be controlled either by a GPIO OUT register or GPIOTE task.
Action: change the following part of the code:nrfx_gpiote_out_config_t config = NRFX_GPIOTE_CONFIG_OUT_TASK_TOGGLE(init_high); err = nrfx_gpiote_out_init(pin, &config);to:
uint8_t task_channel; err = nrfx_gpiote_channel_alloc(&task_channel); nrfx_gpiote_output_config_t config = NRFX_GPIOTE_DEFAULT_OUTPUT_CONFIG; nrfx_gpiote_task_config_t task_config = { .task_ch = task_channel, .polarity = NRF_GPIOTE_POLARITY_TOGGLE, .init_val = NRF_GPIOTE_INITIAL_VALUE_HIGH }; err = nrfx_gpiote_output_configure(pin, &config, &task_config); -
Removed the
nrfx_gpiote_in_init(),nrfx_gpiote_in_prealloc_init()functions used for configuring an input pin to utilize GPIOTEINorPORTevents.
Action: change the following part of the code:nrfx_gpiote_in_config_t config = NRFX_GPIOTE_CONFIG_IN_SENSE_LOTOHI(true); err = nrfx_gpiote_in_init(pin, &config, evt_handler);to:
uint8_t evt_channel; err = nrfx_gpiote_channel_alloc(&evt_channel); nrfx_gpiote_input_config_t config = NRFX_GPIOTE_DEFAULT_INPUT_CONFIG; nrfx_gpiote_trigger_config_t trigger_config = { .trigger = NRFX_GPIOTE_TRIGGER_LOTOHI, .p_in_channel = evt_channel }; nrfx_gpiote_handler_config_t handler_config = { .handler = evt_handler, .p_context = user_context }; err = nrfx_gpiote_input_configure(pin, &config, &trigger_config, &handler_config); -
Removed the
nrfx_gpiote_in_uninit(),nrfx_gpiote_out_uninit()functions.
Action: use thenrfx_gpiote_pin_uninit()function instead. If a channel (a task or event) is used, it should be freed explicitly by the user by calling thenrfx_gpiote_channel_free()function. -
Changed names of the
nrfx_gpiote_in_event_*()functions tonrfx_gpiote_trigger_*().
Action: update the affected code. -
Changed a name of the
nrfx_gpiote_evt_handler_tevent handler prototype tonrfx_gpiote_interrupt_handler_t, and added thep_contextparameter.
Action: update the callback function in the affected code. -
Changed a name and type of the
actionparameter totriggerin the event handler prototype.
Action: update the callback function in the affected code.
I2S
-
The driver now supports multiple I2S peripheral instances. Every function takes a pointer to the instance as the first parameter.
Action: declare an instance and pass a pointer to thenrfx_i2s_tdriver instance in thenrfx_i2s_init(),nrfx_i2s_start(),nrfx_i2s_next_buffers_set()functions as follows:nrfx_i2s_t const i2s_instance = NRFX_I2S_INSTANCE(0); ... nrfx_i2s_uninit(&i2s_instance); -
Changed names of members in the
nrfx_i2s_config_tstructure:- Encapsulated
sck_pin,lrck_pin,mck_pin,sdout_pin,sdin_pinin thepinsstructure of thenrf_i2s_pins_ttype. - Encapsulated
mode,format,alignment,sample_width,channels,mck_setup,ratioin theconfigstructure of thenrf_i2s_config_ttype.
Action: update the affected code.
- Encapsulated
QDEC
-
The driver now supports multiple QDEC peripheral instances. Every function takes a pointer to the instance as the first parameter.
Action: to support older code with the new QDEC driver, declare an instance and pass it as the first argument to eachnrfx_qdec_*function as follows:nrfx_qdec_t const qdec_instance = NRFX_QDEC_INSTANCE(0); ... nrfx_qdec_enable(&qdec_instance); -
Added context to the event handler declaration.
Action: update the event handler definition in the affected code.
IPC
- Removed the deprecated event handler prototype using the
uint32_t event_maskparameter.
Action: update callback functions to use theuint8_t event_idxparameter. - Changed a name of the
nrfx_ipc_mem_get()function tonrfx_ipc_gpmem_get().
Action: update the affected code.
LPCOMP
- Changed a name of the
halmember in thenrf_lpcomp_config_tstructure toconfig.
Action: update the affected code.
PDM
-
Changed names of the following members of the
nrf_pdm_config_tstructure:pin_clktoclk_pinpin_dintodin_pin
Action: update the affected code.
PWM
-
Changed names of the
p_registersanddrv_inst_idxmembers in thenrf_pwm_tstructure top_regandinstance_id.
Action: update your driver instance structure. -
Removed the following deprecated API functions:
nrfx_pwm_sequence_values_update()nrfx_pwm_sequence_length_update()nrfx_pwm_sequence_repeats_update()nrfx_pwm_sequence_end_delay_update()
Action: use the
nrfx_pwm_sequence_update()function instead. -
Removed the
NRFX_PWM_PIN_NOT_USEDsymbol.
Action: use theNRF_PWM_PIN_NOT_CONNECTEDsymbol instead. -
Changed a name of the
nrfx_pwm_is_stopped()function tonrfx_pwm_stopped_check().
Action: update the affected code.
SPIM
-
Removed the
NRFX_SPIM_PIN_NOT_USEDsymbol.
Action: use theNRF_SPIM_PIN_NOT_CONNECTEDsymbol instead. -
Changed names of the following functions and made them inline:
nrfx_spim_start_task_get()tonrfx_spim_start_task_address_get()nrfx_spim_end_event_get()tonrfx_spim_end_event_address_get()
Action: update the affected code.
-
Changed a type of the
*_pinfields innrfx_spim_config_tfromuint8_ttouint32_t.
Action: update the affected code. -
Changed a type of the
frequencyfield innrfx_spim_config_tfromnrf_spim_frequency_ttouint32_t. It now takes a frequency value in Hz.
Action: update the use of thefrequencyfield of the configuration structure in the affected code.
SPIS
- Removed the
NRFX_SPIS_PIN_NOT_USEDsymbol.
Action: use theNRF_SPIS_PIN_NOT_CONNECTEDsymbol instead.
TIMER
- Added the
frequencyparameter to theNRFX_TIMER_DEFAULT_CONFIG()macro.
Action: update the use of macro with the frequency parameter. - Changed a type of the
frequencyfield innrfx_timer_config_tfromnrf_timer_frequency_ttouint32_t. It now takes a frequency value in Hz.
Action: update the use of thefrequencyfield of the configuration structure in the affected code. - Changed the
nrfx_timer_us_to_ticks()andnrfx_timer_ms_to_ticks()functions to non-inline functions.
TWIM
-
Changed names of the
sclandsdafields in thenrfx_twim_config_tstructure toscl_pinandsda_pin, respectively.
Action: update the affected code. -
Changed names of the following functions:
nrfx_twim_start_task_get()tonrfx_twim_start_task_address_get()nrfx_twim_stopped_event_get()tonrfx_twim_stopped_event_address_get()
Action: update the affected code.
TWIS
- Changed names of the
sclandsdafields in thenrfx_twis_config_tstructure toscl_pinandsda_pin, respectively.
Action: update the affected code.
UARTE
-
Changed names of the following members of the
nrfx_uarte_config_tstructure:pseltxdtotxd_pinpselrxdtorxd_pinpselrtstorts_pinpselctstocts_pinhal_cfgtoconfig
Action: update the affected code.
-
Added the following new parameters:
uint32_t flagsto thenrfx_uarte_tx()functionbool syncto thenrfx_uarte_tx_abort()functionsize_t * p_rx_amountto thenrfx_uarte_rx_ready()functionbool disable_allandbool syncto thenrfx_uarte_rx_abort()function
Action: update the affected code.
-
Changed the return type to
nrfx_err_tin the following functions:nrfx_uarte_tx_abort()nrfx_uarte_rx_ready()nrfx_uarte_rx_abort()
Action: update the affected code.
-
Changed a name of the
rxtxmember in thenrfx_uarte_xfer_evt_tstructure torx.
Action: update the affected code. -
Replaced the
rxtxmember in thenrfx_uarte_xfer_evt_tstructure torxandtxmembers.
Action: update the affected code.
WDT
- Extended the event handler prototype with a value of the request status register.
Action: update the event handler function in the affected code. - Changed a type of the
behaviourfield in thenrfx_wdt_config_tstructure fromnrf_wdt_behaviour_ttouint32_t. It now accepts masks constructed fromnrf_wdt_behaviour_mask_telements.
Action: update the affected code.
Others
nrfx_common.h
- Changed the method for API version checking from boolean symbols to
NRFX_API_VER_AT_LEAST()macro.
Action: update the affected code. - Changed the type casting inside the
NRFX_PERIPHERAL_ID_GET()macro fromuint8_ttouint16_t.
nrfx_gppi.h
- Changed all functions to non-inline and non-static functions.
Action: add corresponding source files to the compilation.