This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Interrupt priority on UART

Hi

I try to understand where does the interrupt proirity for UART is set.

I see that uarte_1_init() is called from uart_nrfx_uarte.c.

uarte_1_init() is declared from UART_NRF_UARTE_DEVICE(idx)

static int uarte_##idx##_init(const struct device *dev) \
{ \
const struct uarte_init_config init_config = { \
.pseltxd = UARTE_PROP(idx, tx_pin), /* must be set */ \
.pselrxd = UARTE_PSEL(idx, rx_pin), /* optional */ \
.pselcts = UARTE_PSEL(idx, cts_pin), /* optional */ \
.pselrts = UARTE_PSEL(idx, rts_pin), /* optional */ \
}; \
COND_CODE_1(CONFIG_UART_##idx##_ASYNC, \
(UARTE_IRQ_CONFIGURE(idx, uarte_nrfx_isr_async);), \
(UARTE_IRQ_CONFIGURE(idx, uarte_nrfx_isr_int);)) \
return uarte_instance_init( \
dev, \
&init_config, \
IS_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN)); \
} \

there UARTE_IRQ_CONFIGURE() is used.

#define UARTE_IRQ_CONFIGURE(idx, isr_handler) \
do { \
IRQ_CONNECT(DT_IRQN(UARTE(idx)), DT_IRQ(UARTE(idx), priority), \
isr_handler, DEVICE_DT_GET(UARTE(idx)), 0); \
irq_enable(DT_IRQN(UARTE(idx))); \
} while (0)

But where is priority defined?

Thanks for an explanation?

Related