blob: 9be3851b1f66e2357717eddc62880cf2e0caf6be [file] [edit]
# nrfx UART configuration
# Copyright (c) 2016 - 2018, Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
menuconfig UART_NRFX
bool "nRF UART nrfx drivers"
default y
select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
select SERIAL_SUPPORT_ASYNC
select PINCTRL
depends on DT_HAS_NORDIC_NRF_UART_ENABLED || DT_HAS_NORDIC_NRF_UARTE_ENABLED
help
Enable support for nrfx UART drivers for nRF MCU series.
Peripherals with the same instance ID cannot be used together,
e.g. UART_0 and UARTE_0.
if UART_NRFX
config UART_NRFX_UART
def_bool y
depends on DT_HAS_NORDIC_NRF_UART_ENABLED
config UART_NRFX_UARTE
def_bool y
depends on DT_HAS_NORDIC_NRF_UARTE_ENABLED
config UART_NRFX_UARTE_NO_IRQ
bool "Polling without interrupt"
depends on UART_NRFX_UARTE
depends on !UART_ASYNC_API && !UART_INTERRUPT_DRIVEN
help
When enabled, then interrupt handler is not used at all and it is possible
to get to the lowest power state after uart_poll_out if receiver is not used.
config UART_NRFX_UARTE_ENHANCED_RX
bool "Enhanced RX handling"
select DEPRECATED
help
Option is deprecated as it is used as default unless TIMER peripheral is used
for RX byte counting.
Enable RX handling mode which is switching buffers on timeout. This is an
enhancement compared to other two modes (default and hardware assisted).
Default mode could miscount bytes when interrupt was not handled on time
and hardware assisted required TIMER peripheral instance and PPI channel
for accurate byte counting.
config UART_ASYNC_TX_CACHE_SIZE
int "TX cache buffer size"
depends on UART_ASYNC_API
default 8
help
For UARTE, TX cache buffer is used when provided TX buffer is not located
in RAM, because EasyDMA in UARTE peripherals can only transfer data
from RAM.
config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER
bool "Use TIMER to count RX bytes"
depends on UART_ASYNC_API
depends on $(dt_compat_any_has_prop,$(DT_COMPAT_NORDIC_NRF_UARTE),frame-timeout-supported)
depends on !ARCH_POSIX # Mode not supported on BSIM target
select NRFX_GPPI
config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY
bool "Use TIMER to count RX bytes on legacy platforms"
depends on UART_ASYNC_API
select NRFX_GPPI
help
Method used on nRF52x, nRF53x and nRF91x series.
config UART_NRFX_UARTE_BOUNCE_BUF_LEN
int "RX bounce buffer size"
depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER
default 256
range 64 1024
help
Buffer is used when workaround with bounce buffers is applied
config UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY
int "RX bounce buffer swap latency (in microseconds)"
depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER
default 300
help
Option decides how long before current bounce buffer is filled driver
attempts to swap the buffer. It must be long enough to ensure that
space following the buffer is not overwritten. Too high value results
in more frequent buffer swaps so it impacts performance. Setting should
take into account potential interrupt handling latency.
config UART_NRFX_UARTE_DIRECT_ISR
bool "Use direct ISR"
default y if !MULTITHREADING
if HAS_HW_NRF_UART0 || HAS_HW_NRF_UARTE0
nrfx_uart_num = 0
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE1
nrfx_uart_num = 1
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE2
nrfx_uart_num = 2
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE3
nrfx_uart_num = 3
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE00
nrfx_uart_num = 00
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE20
nrfx_uart_num = 20
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE21
nrfx_uart_num = 21
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE22
nrfx_uart_num = 22
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE23
nrfx_uart_num = 23
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE24
nrfx_uart_num = 24
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE30
nrfx_uart_num = 30
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE120
nrfx_uart_num = 120
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE130
nrfx_uart_num = 130
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE131
nrfx_uart_num = 131
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE132
nrfx_uart_num = 132
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE133
nrfx_uart_num = 133
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE134
nrfx_uart_num = 134
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE135
nrfx_uart_num = 135
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE136
nrfx_uart_num = 136
rsource "Kconfig.nrfx_uart_instance"
endif
if HAS_HW_NRF_UARTE137
nrfx_uart_num = 137
rsource "Kconfig.nrfx_uart_instance"
endif
config NRFX_TIMER
default y
depends on UART_0_NRF_HW_ASYNC_TIMER = 0 \
|| UART_1_NRF_HW_ASYNC_TIMER = 0 \
|| UART_2_NRF_HW_ASYNC_TIMER = 0 \
|| UART_3_NRF_HW_ASYNC_TIMER = 0 \
|| UART_0_NRF_HW_ASYNC_TIMER = 1 \
|| UART_1_NRF_HW_ASYNC_TIMER = 1 \
|| UART_2_NRF_HW_ASYNC_TIMER = 1 \
|| UART_3_NRF_HW_ASYNC_TIMER = 1 \
|| UART_0_NRF_HW_ASYNC_TIMER = 2 \
|| UART_1_NRF_HW_ASYNC_TIMER = 2 \
|| UART_2_NRF_HW_ASYNC_TIMER = 2 \
|| UART_3_NRF_HW_ASYNC_TIMER = 2 \
|| UART_0_NRF_HW_ASYNC_TIMER = 3 \
|| UART_1_NRF_HW_ASYNC_TIMER = 3 \
|| UART_2_NRF_HW_ASYNC_TIMER = 3 \
|| UART_3_NRF_HW_ASYNC_TIMER = 3 \
|| UART_0_NRF_HW_ASYNC_TIMER = 4 \
|| UART_1_NRF_HW_ASYNC_TIMER = 4 \
|| UART_2_NRF_HW_ASYNC_TIMER = 4 \
|| UART_3_NRF_HW_ASYNC_TIMER = 4
endif # UART_NRFX