1#nRF UART(E) instance configuration
2
3# Copyright (c) 2023 Nordic Semiconductor ASA
4# SPDX-License-Identifier: Apache-2.0
5
6config UART_$(nrfx_uart_num)_INTERRUPT_DRIVEN
7	bool "Interrupt support on port $(nrfx_uart_num)"
8	depends on UART_INTERRUPT_DRIVEN
9	select UART_ASYNC_TO_INT_DRIVEN_API if !UART_NRFX_UARTE_LEGACY_SHIM
10	default y
11	help
12	  This option enables UART interrupt support on port $(nrfx_uart_num).
13
14config UART_$(nrfx_uart_num)_ASYNC
15	bool "Asynchronous API support on port $(nrfx_uart_num)"
16	depends on UART_ASYNC_API && !UART_$(nrfx_uart_num)_INTERRUPT_DRIVEN
17	default y
18	help
19	  This option enables UART Asynchronous API support on port $(nrfx_uart_num).
20
21config UART_$(nrfx_uart_num)_ENHANCED_POLL_OUT
22	bool "Efficient poll out on port $(nrfx_uart_num)"
23	depends on !$(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),endtx-stoptx-supported)
24	default y
25	depends on HAS_HW_NRF_UARTE$(nrfx_uart_num)
26	depends on HAS_HW_NRF_PPI || HAS_HW_NRF_DPPIC
27	select NRFX_GPPI
28	help
29	  When enabled, polling out does not trigger interrupt which stops TX.
30	  Feature uses a PPI channel.
31
32config NRFX_UARTE$(nrfx_uart_num)
33	def_bool y if HAS_HW_NRF_UARTE$(nrfx_uart_num) && !UART_NRFX_UARTE_LEGACY_SHIM
34
35config UART_$(nrfx_uart_num)_NRF_PARITY_BIT
36	bool "Parity bit"
37	help
38	  Enable parity bit.
39
40config UART_$(nrfx_uart_num)_NRF_TX_BUFFER_SIZE
41	int "Size of RAM buffer"
42	depends on HAS_HW_NRF_UARTE$(nrfx_uart_num)
43	depends on UART_NRFX_UARTE_LEGACY_SHIM
44	range 1 $(UINT16_MAX)
45	default 32
46	help
47	  Size of the transmit buffer for API function: fifo_fill.
48	  This value is limited by range of TXD.MAXCNT register for
49	  particular SoC.
50
51config UART_$(nrfx_uart_num)_NRF_HW_ASYNC
52	bool "[DEPRECATED] Use hardware RX byte counting"
53	depends on HAS_HW_NRF_UARTE$(nrfx_uart_num)
54	depends on UART_ASYNC_API
55	depends on UART_NRFX_UARTE_LEGACY_SHIM
56	depends on !UART_NRFX_UARTE_ENHANCED_RX
57	depends on HAS_HW_NRF_PPI || HAS_HW_NRF_DPPIC
58	select NRFX_GPPI
59	select DEPRECATED
60	help
61	  If default driver uses interrupts to count incoming bytes, it is possible
62	  that with higher speeds and/or high cpu load some data can be lost.
63	  It is recommended to use hardware byte counting in such scenarios.
64	  Hardware RX byte counting requires timer instance and one PPI channel.
65
66	  This options is deprecated. Use UART_NRFX_UARTE_ENHANCED_RX which supports
67	  reliable byte counting without additional HW resources (TIMER and (D)PPI).
68
69config UART_$(nrfx_uart_num)_NRF_ASYNC_LOW_POWER
70	bool "Low power mode"
71	depends on HAS_HW_NRF_UARTE$(nrfx_uart_num)
72	depends on UART_ASYNC_API
73	depends on UART_NRFX_UARTE_LEGACY_SHIM
74	default y if !PM_DEVICE
75	help
76	  When enabled, UARTE is enabled before each TX or RX usage and disabled
77	  when not used. Disabling UARTE while in idle allows to achieve lowest
78	  power consumption. It is only feasible if receiver is not always on.
79	  This option is irrelevant when device power management (PM) is enabled
80	  because then device state is controlled by the PM actions.
81
82
83config UART_$(nrfx_uart_num)_NRF_HW_ASYNC_TIMER
84	int "Timer instance"
85	depends on UART_$(nrfx_uart_num)_NRF_HW_ASYNC
86
87config UART_$(nrfx_uart_num)_HAS_RX_CACHE_SECTION
88	def_bool $(dt_nodelabel_has_prop,uart$(nrfx_uart_num),memory-regions)
89	imply NRFX_UARTE_CONFIG_RX_CACHE_ENABLED
90	help
91	  This helper symbol indicates the existence of a linker section which
92	  can be dedicated to an RX cache buffer.
93
94config UART_$(nrfx_uart_num)_TX_CACHE_SIZE
95	int "TX cache buffer size"
96	depends on !UART_NRFX_UARTE_LEGACY_SHIM
97	default 8
98	help
99	  For UARTE, TX cache buffer is used when provided TX buffer is not located
100	  in memory which can be used by the EasyDMA.
101
102config UART_$(nrfx_uart_num)_RX_CACHE_SIZE
103	int "RX cache buffer size"
104	depends on !UART_NRFX_UARTE_LEGACY_SHIM
105	default 32 if UART_$(nrfx_uart_num)_HAS_RX_CACHE_SECTION
106	default 5
107	range 5 $(UINT8_MAX)
108	help
109	  For UARTE, RX cache buffer is used when provided RX buffer is not located
110	  in memory which can be used by the EasyDMA. It is also used to store
111	  flushed data.
112
113config UART_$(nrfx_uart_num)_A2I_RX_SIZE
114	depends on !UART_NRFX_UARTE_LEGACY_SHIM
115	int "Asynchronous to interrupt driven adaptation layer RX buffer size"
116	default 64 if UART_$(nrfx_uart_num)_INTERRUPT_DRIVEN
117	default 0
118	help
119	  Amount of space dedicated for RX. It is divided into chunks with some
120	  amount of that space used for control data.
121
122config UART_$(nrfx_uart_num)_A2I_RX_BUF_COUNT
123	depends on !UART_NRFX_UARTE_LEGACY_SHIM
124	int "Asynchronous to interrupt driven adaptation layer RX buffer count"
125	default 8 if UART_$(nrfx_uart_num)_INTERRUPT_DRIVEN
126	default 0
127	help
128	  Number of chunks into RX space is divided.
129