-
Notifications
You must be signed in to change notification settings - Fork 137
nrfx 2.11.0 to 3.0.0
nrfx 3.0 introduces API changes. This guide lists actions required to make your code compatible with these changes.
-
Encapsulated the following parameters:
- The
set
andway
cache parameters in thenrf_cache_set_way_loc_t
structure - The
word
cache data parameter in thenrf_cache_du_word_loc_t
structure
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
,word
parameters. - The
- Changed a type of the
p_data
parameter 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.
- Changed names of constants in the
nrf_clock_lfclk_t
enumerator to uppercase.
Action: update the affected code.
-
Changed names of the following
nrf_comp_ref_t
enumerator constants:-
NRF_COMP_REF_Int1V2
toNRF_COMP_REF_INT_1V2
-
NRF_COMP_REF_Int1V8
toNRF_COMP_REF_INT_1V8
-
NRF_COMP_REF_Int2V4
toNRF_COMP_REF_INT_2V4
-
NRF_COMP_REF_ARef
toNRF_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_t
enumerators to uppercase.
Action: update the affected code.
- Replaced the
nrf_gpio_pin_mcusel_t
enumerator 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.
- Changed parameters in the
nrf_i2s_pins_set()
function to a pointer to thenrf_i2s_pins_t
structure.
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_t
structure.
Action: update the function calls to pass the I2S configuration structure instead of individual parameters.
- Changed names of constants in the
nrf_qdec_sampleper_t
enumerator 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_CONNECTED
symbol toNRF_QDEC_PIN_NOT_CONNECTED
.
Action: update the affected code.
- Changed types of all members in the
nrf_qspi_pins_t
structure touint32_t
.
Action: update the affected code.
-
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_FREQ
toNRF_RTC_INPUT_FREQ
-
RTC_CHANNEL_EVENT_ADDR
toNRF_RTC_CHANNEL_EVENT_ADDR
Action: update the affected code.
-
- 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
channel
parameter touint8_t
in thenrf_timer_capture_task_get()
,nrf_timer_compare_event_get()
,nrf_timer_compare_int_get()
functions.
Action: update the affected code.
-
Changed the
nrf_wdt_behaviour_t
type tonrf_wdt_behaviour_mask_t
and added the_MASK
suffix 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.
-
- Changed a name of the
NRFX_VOLTAGE_THRESHOLD_TO_INT()
macro toNRFX_COMP_VOLTAGE_THRESHOLD_TO_INT()
.
Action: update the affected code.
-
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 GPIOTEIN
orPORT
events.
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_t
event handler prototype tonrfx_gpiote_interrupt_handler_t
, and added thep_context
parameter.
Action: update the callback function in the affected code. -
Changed a name and type of the
action
parameter totrigger
in the event handler prototype.
Action: update the callback function in the affected code.
-
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_t
driver 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_t
structure:- Encapsulated
sck_pin
,lrck_pin
,mck_pin
,sdout_pin
,sdin_pin
in thepins
structure of thenrf_i2s_pins_t
type. - Encapsulated
mode
,format
,alignment
,sample_width
,channels
,mck_setup
,ratio
in theconfig
structure of thenrf_i2s_config_t
type.
Action: update the affected code.
- Encapsulated
-
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.
- Removed the deprecated event handler prototype using the
uint32_t event_mask
parameter.
Action: update callback functions to use theuint8_t event_idx
parameter. - Changed a name of the
nrfx_ipc_mem_get()
function tonrfx_ipc_gpmem_get()
.
Action: update the affected code.
- Changed a name of the
hal
member in thenrf_lpcomp_config_t
structure toconfig
.
Action: update the affected code.
-
Changed names of the following members of the
nrf_pdm_config_t
structure:-
pin_clk
toclk_pin
-
pin_din
todin_pin
Action: update the affected code.
-
-
Changed names of the
p_registers
anddrv_inst_idx
members in thenrf_pwm_t
structure top_reg
andinstance_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_USED
symbol.
Action: use theNRF_PWM_PIN_NOT_CONNECTED
symbol instead. -
Changed a name of the
nrfx_pwm_is_stopped()
function tonrfx_pwm_stopped_check()
.
Action: update the affected code.
-
Removed the
NRFX_SPIM_PIN_NOT_USED
symbol.
Action: use theNRF_SPIM_PIN_NOT_CONNECTED
symbol 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
*_pin
fields innrfx_spim_config_t
fromuint8_t
touint32_t
.
Action: update the affected code. -
Changed a type of the
frequency
field innrfx_spim_config_t
fromnrf_spim_frequency_t
touint32_t
. It now takes a frequency value in Hz.
Action: update the use of thefrequency
field of the configuration structure in the affected code.
- Removed the
NRFX_SPIS_PIN_NOT_USED
symbol.
Action: use theNRF_SPIS_PIN_NOT_CONNECTED
symbol instead.
- Added the
frequency
parameter to theNRFX_TIMER_DEFAULT_CONFIG()
macro.
Action: update the use of macro with the frequency parameter. - Changed a type of the
frequency
field innrfx_timer_config_t
fromnrf_timer_frequency_t
touint32_t
. It now takes a frequency value in Hz.
Action: update the use of thefrequency
field 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.
-
Changed names of the
scl
andsda
fields in thenrfx_twim_config_t
structure toscl_pin
andsda_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.
-
- Changed names of the
scl
andsda
fields in thenrfx_twis_config_t
structure toscl_pin
andsda_pin
, respectively.
Action: update the affected code.
-
Changed names of the following members of the
nrfx_uarte_config_t
structure:-
pseltxd
totxd_pin
-
pselrxd
torxd_pin
-
pselrts
torts_pin
-
pselcts
tocts_pin
-
hal_cfg
toconfig
Action: update the affected code.
-
-
Added the following new parameters:
-
uint32_t flags
to thenrfx_uarte_tx()
function -
bool sync
to thenrfx_uarte_tx_abort()
function -
size_t * p_rx_amount
to thenrfx_uarte_rx_ready()
function -
bool disable_all
andbool sync
to thenrfx_uarte_rx_abort()
function
Action: update the affected code.
-
-
Changed the return type to
nrfx_err_t
in 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
rxtx
member in thenrfx_uarte_xfer_evt_t
structure torx
.
Action: update the affected code. -
Replaced the
rxtx
member in thenrfx_uarte_xfer_evt_t
structure torx
andtx
members.
Action: update the affected code.
- 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
behaviour
field in thenrfx_wdt_config_t
structure fromnrf_wdt_behaviour_t
touint32_t
. It now accepts masks constructed fromnrf_wdt_behaviour_mask_t
elements.
Action: update the affected code.
- 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_t
touint16_t
.
- Changed all functions to non-inline and non-static functions.
Action: add corresponding source files to the compilation.