Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
14bc232
modules: hal_nordic: nrfx: align MDK path to BSP
magp-nordic Sep 12, 2025
a69e8c0
tests: drivers: nrfx_integration_test: remove selecting PRS BOX > 0
magp-nordic Sep 15, 2025
926b695
lib: ram_pwrdn: replace deprecated NRF_POWER symbol
mstasiaknordic Sep 18, 2025
a812c46
scripts: quarantine: add not passing tests to quarantine
magp-nordic Sep 18, 2025
c4e17d0
applications: nrf5340_audio: add prescaler structure
mstasiaknordic Sep 30, 2025
3637664
dts: common: nordic: Switch saadc pin definitions for generic ones
jaz1-nordic Oct 13, 2025
1945bfb
tests: drivers: nrfx_integration_test: remove deleted configs
mstasiaknordic Sep 30, 2025
c40759f
treewide: align to modified include paths in nrfx
masz-nordic Oct 2, 2025
9714c9e
mpsl: align to name change in mpsl_hwres
masz-nordic Oct 16, 2025
3084c54
samples: bluetooth: align to nrfx 4.0
masz-nordic Oct 23, 2025
ce02f48
tests: bluetooth: replace deprecated API
masz-nordic Oct 28, 2025
d06be6f
application: nrf5340_audio: Align to new I2S driver
jaz1-nordic Oct 17, 2025
d0063a6
tests: drivers: nrfx_integration_test: remove deleted I2S configs
jaz1-nordic Oct 17, 2025
751e730
tests: drivers: nrfx_integration_test: remove deleted PDM configs
jaz1-nordic Oct 20, 2025
392368f
tests: drivers: nrfx_integration_test: remove deleted QDEC configs
kl-cruz Oct 24, 2025
8f2d6c3
tests: drivers: nrfx_integration_test: remove WDT configs
mstasiaknordic Sep 30, 2025
f6ac9eb
applications: remove UARTE instance config symbols
mstasiaknordic Oct 20, 2025
5bc77ca
modules: remove UARTE instance config symbols
mstasiaknordic Oct 20, 2025
661f17a
samples: remove UARTE instance config symbols
mstasiaknordic Oct 20, 2025
696d8aa
tests: remove UARTE instance config symbols
mstasiaknordic Oct 20, 2025
266eb32
boards: align to relocation of nrfx_coredep
masz-nordic Oct 29, 2025
1e66eaa
tests: drivers: nrfx_integration_test: remove PWM configs
mib1-nordic Oct 1, 2025
4bb6323
applications: Align to changes in nrfx_timer driver
mib1-nordic Oct 6, 2025
048878c
samples: Align to changes in nrfx_timer driver
mib1-nordic Oct 6, 2025
627b2db
tests: Align to changes in nrfx_timer driver
mib1-nordic Oct 22, 2025
5a7b5b3
debug: cpu_load: align to changes in nrfx_timer
mib1-nordic Oct 27, 2025
5237375
esb: Align to changes in nrfx_timer
mib1-nordic Oct 27, 2025
12521d5
nfc: Align to changes in nrfx_timer driver
mib1-nordic Oct 27, 2025
8d232c4
tests: i2c: Align tests to I2C API changes
adamkondraciuk Oct 17, 2025
03e4090
soc: nrf54ls05b: add config indicating MPU presense
mstasiaknordic Oct 27, 2025
95bff9a
mpsl: hwres: dppi: Align to use NRFX_GPPI
nordic-krch Oct 28, 2025
4f6de99
lib: fem_al: Use GPPI instead of nrfx_dppi
nordic-krch Oct 28, 2025
6f4afe7
debug: ppi_trace: Adapt to use new GPPI API
nordic-krch Oct 28, 2025
8af6b1f
mpsl: fem: Adapt to use GPPI API
nordic-krch Oct 28, 2025
42d767e
mpsl: pin_debug: Adapt to use GPPI API
nordic-krch Oct 28, 2025
57a58af
debug: cpu_load: Align to the new GPPI API
nordic-krch Oct 28, 2025
0a87794
dm: Use GPPI for PPI resource allocation
nordic-krch Oct 28, 2025
a3912e2
gazell: gzll_glue: Use GPPI for PPI resource allocation
nordic-krch Oct 28, 2025
797f0c0
esb: Use GPPI for allocating resources
nordic-krch Oct 28, 2025
c279a22
tests: drivers: audio: pdm_loopback: Align to the new GPPI API
nordic-krch Oct 29, 2025
b546e72
samples: bluetooth: Align to the new GPPI API
nordic-krch Oct 29, 2025
9b6139c
samples: bluetooth: direct_test_mode: Adapt to the new GPPI API
nordic-krch Oct 29, 2025
beafbc3
samples: peripheral: radio_test: Adapt to the new GPPI
nordic-krch Oct 29, 2025
3e00f83
modules: nrfxlib: nrf_802154: sl: Adapt to the new GPPI API
nordic-krch Oct 30, 2025
64995e0
samples: peripheral: 802154_phy_test: Align to the new GPPI API
nordic-krch Oct 30, 2025
e8eb773
applications: nrf5340_audio: Rework to use GPPI API
nordic-krch Oct 30, 2025
616808e
tests: drivers: i2c: i2c_latency: Align to changes in nrfx_twis
nordic-krch Oct 31, 2025
89b79b7
tests: modules: mcuboot: external_flash: disable gpio interrupts
nika-nordic Oct 30, 2025
6e7e3db
drivers: serial: lpuart: align to nrfx_gpiote changes
nika-nordic Oct 28, 2025
cb299e1
samples: bluetooth: time_sync: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
1dffbb4
samples: peripheral: 802154_phy_test: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
def06a2
subsys: debug: ppi_trace: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
bae3c77
subsys: mpsl: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
28993b5
tests: drivers: audio: pdm_loopback: align to nrfx_gpiote changes
nika-nordic Oct 30, 2025
d511663
tests: drivers: audio: pdm_loopback: fix incorrect error code
nika-nordic Oct 31, 2025
ab16fad
tests: drivers: i2c: i2c_latency: fix incorrect error code
nika-nordic Oct 31, 2025
74b78ca
samples: bluetooth: time_sync: fix gpiote reference
nika-nordic Oct 31, 2025
0622338
manifest: Update sdk-zephyr, nrfxlib and mcuboot revisions
jaz1-nordic Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions applications/connectivity_bridge/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
CONFIG_NRFX_UARTE0=y
CONFIG_NRFX_UARTE1=y
CONFIG_NRFX_TIMER1=y
CONFIG_NRFX_TIMER2=y
CONFIG_NRFX_UARTE=y
CONFIG_NRFX_TIMER=y
CONFIG_NRFX_PPI=y

CONFIG_HW_ID_LIBRARY=y
Expand Down
2 changes: 1 addition & 1 deletion applications/nrf5340_audio/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ config REGULATOR
config CONTIN_ARRAY
default y

config NRFX_I2S0
config NRFX_I2S
default y

config PCM_MIX
Expand Down
4 changes: 2 additions & 2 deletions applications/nrf5340_audio/src/audio/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#

# Audio sync timer
config NRFX_TIMER1
config NRFX_TIMER
default y

# Audio sync timer
config NRFX_DPPI
config NRFX_GPPI
default y
12 changes: 7 additions & 5 deletions applications/nrf5340_audio/src/modules/audio_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PINCTRL_DT_DEFINE(I2S_NL);
#error "Current AUDIO_SAMPLE_RATE_HZ setting not supported"
#endif

static nrfx_i2s_t i2s_inst = NRFX_I2S_INSTANCE(0);
static nrfx_i2s_t i2s_inst = NRFX_I2S_INSTANCE(NRF_I2S0);

static nrfx_i2s_config_t cfg = {
/* Pins are configured by pinctrl. */
Expand All @@ -46,8 +46,11 @@ static nrfx_i2s_config_t cfg = {
.mode = NRF_I2S_MODE_MASTER,
.format = NRF_I2S_FORMAT_I2S,
.alignment = NRF_I2S_ALIGN_LEFT,
.ratio = I2S_RATIO,
.mck_setup = 0x66666000,
.prescalers = {
.ratio = I2S_RATIO,
.mck_setup = 0x66666000,
.enable_bypass = false,
},
#if (CONFIG_AUDIO_BIT_DEPTH_16)
.sample_width = NRF_I2S_SWIDTH_16BIT,
#elif (CONFIG_AUDIO_BIT_DEPTH_32)
Expand All @@ -57,7 +60,6 @@ static nrfx_i2s_config_t cfg = {
#endif /* (CONFIG_AUDIO_BIT_DEPTH_16) */
.channels = NRF_I2S_CHANNELS_STEREO,
.clksrc = NRF_I2S_CLKSRC_ACLK,
.enable_bypass = false,
};

static i2s_blk_comp_callback_t i2s_blk_comp_callback;
Expand Down Expand Up @@ -148,7 +150,7 @@ void audio_i2s_init(void)
ret = pinctrl_apply_state(PINCTRL_DT_DEV_CONFIG_GET(I2S_NL), PINCTRL_STATE_DEFAULT);
__ASSERT_NO_MSG(ret == 0);

IRQ_CONNECT(DT_IRQN(I2S_NL), DT_IRQ(I2S_NL, priority), nrfx_isr, nrfx_i2s_0_irq_handler, 0);
IRQ_CONNECT(DT_IRQN(I2S_NL), DT_IRQ(I2S_NL, priority), nrfx_i2s_irq_handler, &i2s_inst, 0);
irq_enable(DT_IRQN(I2S_NL));

ret = nrfx_i2s_init(&i2s_inst, &cfg, i2s_comp_handler);
Expand Down
123 changes: 46 additions & 77 deletions applications/nrf5340_audio/src/modules/audio_sync_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <zephyr/kernel.h>
#include <zephyr/init.h>
#include <nrfx_dppi.h>
#include <helpers/nrfx_gppi.h>
#include <nrfx_i2s.h>
#include <nrfx_ipc.h>
#include <nrfx_rtc.h>
Expand All @@ -28,10 +28,10 @@ LOG_MODULE_REGISTER(audio_sync_timer, CONFIG_AUDIO_SYNC_TIMER_LOG_LEVEL);
#define AUDIO_SYNC_HF_TIMER_CURR_TIME_CAPTURE_CHANNEL 1
#define AUDIO_SYNC_HF_TIMER_CURR_TIME_CAPTURE NRF_TIMER_TASK_CAPTURE1

static const nrfx_timer_t audio_sync_hf_timer_instance =
NRFX_TIMER_INSTANCE(AUDIO_SYNC_HF_TIMER_INSTANCE_NUMBER);
static nrfx_timer_t audio_sync_hf_timer_instance =
NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(AUDIO_SYNC_HF_TIMER_INSTANCE_NUMBER));

static uint8_t dppi_channel_i2s_frame_start;
static nrfx_gppi_handle_t dppi_handle_i2s_frame_start;

#define AUDIO_SYNC_LF_TIMER_INSTANCE_NUMBER 0

Expand All @@ -41,15 +41,15 @@ static uint8_t dppi_channel_i2s_frame_start;
#define AUDIO_SYNC_LF_TIMER_CURR_TIME_CAPTURE NRF_RTC_TASK_CAPTURE_1
#define CC_GET_CALLS_MAX 20

static uint8_t dppi_channel_curr_time_capture;
static nrfx_gppi_handle_t dppi_handle_curr_time_capture;

static const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG;

static const nrfx_rtc_t audio_sync_lf_timer_instance =
NRFX_RTC_INSTANCE(AUDIO_SYNC_LF_TIMER_INSTANCE_NUMBER);

static uint8_t dppi_channel_timer_sync_with_rtc;
static uint8_t dppi_channel_rtc_start;
static nrfx_gppi_handle_t dppi_handle_timer_sync_with_rtc;
static nrfx_gppi_handle_t dppi_handle_rtc_start;
static volatile uint32_t num_rtc_overflows;

static nrfx_timer_config_t cfg = {.frequency = NRFX_MHZ_TO_HZ(1UL),
Expand Down Expand Up @@ -174,7 +174,7 @@ static void rtc_isr_handler(nrfx_rtc_int_type_t int_type)
static int audio_sync_timer_init(void)
{
nrfx_err_t ret;
nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0);
uint32_t eep0, tep0, tep1;

ret = nrfx_timer_init(&audio_sync_hf_timer_instance, &cfg, unused_timer_isr_handler);
if (ret - NRFX_ERROR_BASE_NUM) {
Expand All @@ -192,92 +192,61 @@ static int audio_sync_timer_init(void)
nrfx_rtc_overflow_enable(&audio_sync_lf_timer_instance, true);

/* Initialize capturing of I2S frame start event timestamps */
ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_i2s_frame_start);
if (ret - NRFX_ERROR_BASE_NUM) {
eep0 = nrf_i2s_event_address_get(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART);
tep0 = nrfx_rtc_task_address_get(&audio_sync_lf_timer_instance,
AUDIO_SYNC_LF_TIMER_I2S_FRAME_START_EVT_CAPTURE);
tep1 = nrfx_timer_task_address_get(&audio_sync_hf_timer_instance,
AUDIO_SYNC_HF_TIMER_I2S_FRAME_START_EVT_CAPTURE);

ret = nrfx_gppi_conn_alloc(eep0, tep0, &dppi_handle_i2s_frame_start);
if (ret < 0) {
LOG_ERR("nrfx DPPI channel alloc error (I2S frame start): %d", ret);
return -ENOMEM;
return ret;
}

nrf_timer_subscribe_set(audio_sync_hf_timer_instance.p_reg,
AUDIO_SYNC_HF_TIMER_I2S_FRAME_START_EVT_CAPTURE,
dppi_channel_i2s_frame_start);

/* Initialize capturing of I2S frame start event timestamps at the RTC as well. */
nrf_rtc_subscribe_set(audio_sync_lf_timer_instance.p_reg,
AUDIO_SYNC_LF_TIMER_I2S_FRAME_START_EVT_CAPTURE,
dppi_channel_i2s_frame_start);

nrf_i2s_publish_set(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART, dppi_channel_i2s_frame_start);
ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_i2s_frame_start);
if (ret - NRFX_ERROR_BASE_NUM) {
LOG_ERR("nrfx DPPI channel enable error (I2S frame start): %d", ret);
return -EIO;
}
nrfx_gppi_ep_attach(tep1, dppi_handle_i2s_frame_start);
nrfx_gppi_conn_enable(dppi_handle_i2s_frame_start);

/* Initialize capturing of current timestamps */
ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_curr_time_capture);
if (ret - NRFX_ERROR_BASE_NUM) {
eep0 = nrf_egu_event_address_get(NRF_EGU0, NRF_EGU_EVENT_TRIGGERED0);
tep0 = nrfx_rtc_task_address_get(&audio_sync_lf_timer_instance,
AUDIO_SYNC_LF_TIMER_CURR_TIME_CAPTURE);
tep1 = nrfx_timer_task_address_get(&audio_sync_hf_timer_instance,
AUDIO_SYNC_HF_TIMER_CURR_TIME_CAPTURE);

ret = nrfx_gppi_conn_alloc(eep0, tep0, &dppi_handle_curr_time_capture);
if (ret < 0) {
LOG_ERR("nrfx DPPI channel alloc error (I2S frame start): %d", ret);
return -ENOMEM;
}

nrf_rtc_subscribe_set(audio_sync_lf_timer_instance.p_reg,
AUDIO_SYNC_LF_TIMER_CURR_TIME_CAPTURE,
dppi_channel_curr_time_capture);

nrf_timer_subscribe_set(audio_sync_hf_timer_instance.p_reg,
AUDIO_SYNC_HF_TIMER_CURR_TIME_CAPTURE,
dppi_channel_curr_time_capture);

nrf_egu_publish_set(NRF_EGU0, NRF_EGU_EVENT_TRIGGERED0, dppi_channel_curr_time_capture);

ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_curr_time_capture);
if (ret - NRFX_ERROR_BASE_NUM) {
LOG_ERR("nrfx DPPI channel enable error (I2S frame start): %d", ret);
return -EIO;
return ret;
}
nrfx_gppi_ep_attach(tep1, dppi_handle_curr_time_capture);
nrfx_gppi_conn_enable(dppi_handle_curr_time_capture);

/* Initialize functionality for synchronization between APP and NET core */
ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_rtc_start);
if (ret - NRFX_ERROR_BASE_NUM) {
LOG_ERR("nrfx DPPI channel alloc error (timer clear): %d", ret);
return -ENOMEM;
eep0 = nrf_ipc_event_address_get(NRF_IPC, AUDIO_SYNC_TIMER_NET_APP_IPC_EVT);
tep0 = nrfx_rtc_task_address_get(&audio_sync_lf_timer_instance, NRF_RTC_TASK_CLEAR);
tep1 = nrfx_timer_task_address_get(&audio_sync_hf_timer_instance, NRF_TIMER_TASK_START);
ret = nrfx_gppi_conn_alloc(eep0, tep0, &dppi_handle_rtc_start);
if (ret < 0) {
LOG_ERR("nrfx DPPI channel alloc error (I2S frame start): %d", ret);
return ret;
}

nrf_rtc_subscribe_set(audio_sync_lf_timer_instance.p_reg, NRF_RTC_TASK_CLEAR,
dppi_channel_rtc_start);
nrf_timer_subscribe_set(audio_sync_hf_timer_instance.p_reg, NRF_TIMER_TASK_START,
dppi_channel_rtc_start);

nrfx_gppi_ep_attach(tep1, dppi_handle_rtc_start);
nrf_ipc_receive_config_set(NRF_IPC, AUDIO_SYNC_TIMER_NET_APP_IPC_EVT_CHANNEL,
NRF_IPC_CHANNEL_4);
nrf_ipc_publish_set(NRF_IPC, AUDIO_SYNC_TIMER_NET_APP_IPC_EVT, dppi_channel_rtc_start);

ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_rtc_start);
if (ret - NRFX_ERROR_BASE_NUM) {
LOG_ERR("nrfx DPPI channel enable error (timer clear): %d", ret);
return -EIO;
}
nrfx_gppi_conn_enable(dppi_handle_curr_time_capture);

/* Initialize functionality for synchronization between RTC and TIMER */
ret = nrfx_dppi_channel_alloc(&dppi, &dppi_channel_timer_sync_with_rtc);
if (ret - NRFX_ERROR_BASE_NUM) {
LOG_ERR("nrfx DPPI channel alloc error (timer clear): %d", ret);
return -ENOMEM;
eep0 = nrfx_rtc_event_address_get(&audio_sync_lf_timer_instance, NRF_RTC_EVENT_TICK);
tep0 = nrfx_timer_task_address_get(&audio_sync_hf_timer_instance, NRF_TIMER_TASK_CLEAR);
ret = nrfx_gppi_conn_alloc(eep0, tep0, &dppi_handle_timer_sync_with_rtc);
if (ret < 0) {
LOG_ERR("nrfx DPPI channel alloc error (I2S frame start): %d", ret);
return ret;
}

nrf_rtc_publish_set(audio_sync_lf_timer_instance.p_reg, NRF_RTC_EVENT_TICK,
dppi_channel_timer_sync_with_rtc);
nrf_timer_subscribe_set(audio_sync_hf_timer_instance.p_reg, NRF_TIMER_TASK_CLEAR,
dppi_channel_timer_sync_with_rtc);

nrfx_rtc_tick_enable(&audio_sync_lf_timer_instance, false);

ret = nrfx_dppi_channel_enable(&dppi, dppi_channel_timer_sync_with_rtc);
if (ret - NRFX_ERROR_BASE_NUM) {
LOG_ERR("nrfx DPPI channel enable error (timer clear): %d", ret);
return -EIO;
}
nrfx_gppi_conn_enable(dppi_handle_timer_sync_with_rtc);

nrfx_rtc_enable(&audio_sync_lf_timer_instance);

Expand Down
50 changes: 26 additions & 24 deletions drivers/serial/uart_nrf_sw_lpuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

#include <zephyr/drivers/uart.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/gpio/gpio_nrf.h>
#include <hal/nrf_gpio.h>
#include <hal/nrf_gpiote.h>
#include <nrfx_gpiote.h>
#include <gpiote_nrfx.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/onoff.h>
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
Expand Down Expand Up @@ -132,18 +134,18 @@ static inline const struct lpuart_config *get_dev_config(const struct device *de
}

#define GPIOTE_NODE(gpio_node) DT_PHANDLE(gpio_node, gpiote_instance)
#define GPIOTE_INST_AND_COMMA(gpio_node) \
IF_ENABLED(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), ( \
[DT_PROP(gpio_node, port)] = \
NRFX_GPIOTE_INSTANCE(DT_PROP(GPIOTE_NODE(gpio_node), instance)),))
#define GPIOTE_INST_AND_COMMA(gpio_node) [DT_PROP(gpio_node, port)] = \
COND_CODE_1(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), \
(&GPIOTE_NRFX_INST_BY_NODE(GPIOTE_NODE(gpio_node))), \
(NULL)),

static const nrfx_gpiote_t *get_gpiote(nrfx_gpiote_pin_t pin)
static nrfx_gpiote_t *get_gpiote(nrfx_gpiote_pin_t pin)
{
static const nrfx_gpiote_t gpiote[GPIO_COUNT] = {
static nrfx_gpiote_t * const gpiote_per_port[GPIO_COUNT] = {
DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio, GPIOTE_INST_AND_COMMA)
};

return &gpiote[pin >> 5];
return gpiote_per_port[NRF_PIN_NUMBER_TO_PORT(pin)];
}

/* Called when uart transfer is finished to indicate to the receiver that it
Expand Down Expand Up @@ -194,7 +196,7 @@ static void req_pin_arm(struct lpuart_data *data)
static int req_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin)
{
uint8_t ch;
nrfx_err_t err;
int err;
nrf_gpio_pin_pull_t pull_config = NRF_GPIO_PIN_PULLDOWN;
nrfx_gpiote_trigger_config_t trigger_config = {
.trigger = NRFX_GPIOTE_TRIGGER_HITOLO,
Expand All @@ -211,13 +213,13 @@ static int req_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin)
};

err = nrfx_gpiote_channel_alloc(get_gpiote(pin), &ch);
if (err != NRFX_SUCCESS) {
return -ENOMEM;
if (err < 0) {
return err;
}

err = nrfx_gpiote_input_configure(get_gpiote(pin), pin, &input_config);
if (err != NRFX_SUCCESS) {
return -EINVAL;
if (err < 0) {
return err;
}

data->req_pin = pin;
Expand All @@ -238,7 +240,7 @@ static void rdy_pin_suspend(struct lpuart_data *data)

static int rdy_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin)
{
nrfx_err_t err;
int err;
nrf_gpio_pin_pull_t pull_config = NRF_GPIO_PIN_NOPULL;
nrfx_gpiote_handler_config_t handler_config = {
.handler = rdy_pin_handler,
Expand All @@ -251,14 +253,14 @@ static int rdy_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin)
};

err = nrfx_gpiote_channel_alloc(get_gpiote(pin), &data->rdy_ch);
if (err != NRFX_SUCCESS) {
return -ENOMEM;
if (err < 0) {
return err;
}

err = nrfx_gpiote_input_configure(get_gpiote(pin), pin, &input_config);
if (err != NRFX_SUCCESS) {
LOG_ERR("err:%08x", err);
return -EINVAL;
if (err < 0) {
LOG_ERR("err: %d", err);
return err;
}

data->rdy_pin = pin;
Expand All @@ -270,7 +272,7 @@ static int rdy_pin_init(struct lpuart_data *data, nrfx_gpiote_pin_t pin)
/* Pin activated to detect high state (using SENSE). */
static void rdy_pin_idle(struct lpuart_data *data)
{
nrfx_err_t err;
int err;
nrfx_gpiote_trigger_config_t trigger_config = {
.trigger = NRFX_GPIOTE_TRIGGER_HIGH
};
Expand All @@ -279,10 +281,10 @@ static void rdy_pin_idle(struct lpuart_data *data)
.p_trigger_config = &trigger_config,
.p_handler_config = NULL
};
const nrfx_gpiote_t *gpiote = get_gpiote(data->rdy_pin);
nrfx_gpiote_t *gpiote = get_gpiote(data->rdy_pin);

err = nrfx_gpiote_input_configure(gpiote, data->rdy_pin, &input_config);
__ASSERT(err == NRFX_SUCCESS, "Unexpected err: %08x/%d", err, err);
__ASSERT(err == 0, "Unexpected err: %d", err);

nrfx_gpiote_trigger_enable(gpiote, data->rdy_pin, true);
}
Expand All @@ -295,7 +297,7 @@ static void rdy_pin_idle(struct lpuart_data *data)
*/
static bool rdy_pin_blink(struct lpuart_data *data)
{
nrfx_err_t err;
int err;
nrfx_gpiote_trigger_config_t trigger_config = {
.trigger = NRFX_GPIOTE_TRIGGER_HITOLO,
.p_in_channel = &data->rdy_ch
Expand All @@ -307,14 +309,14 @@ static bool rdy_pin_blink(struct lpuart_data *data)
};
const nrf_gpio_pin_dir_t dir_in = NRF_GPIO_PIN_DIR_INPUT;
const nrf_gpio_pin_dir_t dir_out = NRF_GPIO_PIN_DIR_OUTPUT;
const nrfx_gpiote_t *gpiote = get_gpiote(data->rdy_pin);
nrfx_gpiote_t *gpiote = get_gpiote(data->rdy_pin);
bool ret;

/* Drive low for a moment */
nrf_gpio_reconfigure(data->rdy_pin, &dir_out, NULL, NULL, NULL, NULL);

err = nrfx_gpiote_input_configure(gpiote, data->rdy_pin, &input_config);
__ASSERT(err == NRFX_SUCCESS, "Unexpected err: %08x/%d", err, err);
__ASSERT(err == 0, "Unexpected err: %d", err);

nrfx_gpiote_trigger_enable(gpiote, data->rdy_pin, true);

Expand Down
Loading
Loading