Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
# Drivers
/drivers/clock_control/ @nrfconnect/ncs-bm
/drivers/console/ @nrfconnect/ncs-bm
/drivers/lpuarte/ @nrfconnect/ncs-bm

# Include
/include/*.h @nrfconnect/ncs-bm
Expand Down
18 changes: 18 additions & 0 deletions boards/nordic/bm_nrf54l15dk/include/board-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ extern "C" {
#define BOARD_APP_UARTE_PIN_CTS NRF_PIN_PORT_TO_PIN_NUMBER(3, 0)
#endif

/* Application LPUART configuration */
#ifndef BOARD_APP_LPUARTE_INST
#define BOARD_APP_LPUARTE_INST 21
#endif

#ifndef BOARD_APP_LPUARTE_PIN_TX
#define BOARD_APP_LPUARTE_PIN_TX NRF_PIN_PORT_TO_PIN_NUMBER(11, 1)
#endif
#ifndef BOARD_APP_LPUARTE_PIN_RX
#define BOARD_APP_LPUARTE_PIN_RX NRF_PIN_PORT_TO_PIN_NUMBER(10, 1)
#endif
#ifndef BOARD_APP_LPUARTE_PIN_REQ
#define BOARD_APP_LPUARTE_PIN_REQ NRF_PIN_PORT_TO_PIN_NUMBER(8, 1)
#endif
#ifndef BOARD_APP_LPUARTE_PIN_RDY
#define BOARD_APP_LPUARTE_PIN_RDY NRF_PIN_PORT_TO_PIN_NUMBER(9, 1)
#endif

#ifdef __cplusplus
}
#endif
Expand Down
17 changes: 17 additions & 0 deletions doc/nrf-bm/drivers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _drivers:

Drivers
#######

In supplement to nrfx drivers, |BMlong| provides drivers for typical use cases with Nordic Semiconductor devices.
If the driver you are looking for is not available below, please check the `nrfx documentation`_.

Only nrfx drivers and the drivers located under :file:`nrf-bm/drivers` are in the scope of the |BMshort| option.
All other drivers that are included in the distribution must be ignored when working with the |BMshort| option.

.. toctree::
:maxdepth: 1
:glob:
:caption: Subpages:

drivers/*
55 changes: 55 additions & 0 deletions doc/nrf-bm/drivers/lpuarte.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.. _driver_lpuarte:

Low Power UART with EasyDMA (LPUARTE)
#####################################

The Low Power UART with EasyDMA (LPUARTE) driver implements the standard UART with EasyDMA and two extra control lines for low power capabilities.
The control lines allow for disabling the UART receiver during the idle period.
This results in low power consumption, as you can shut down the high-frequency clock when UART is in idle state.

Control protocol
****************

You can use the protocol for duplex transmission between two devices.

The control protocol uses two additional lines alongside the standard TX and RX lines:

* the *Request* line (REQ),
* the *Ready* line (RDY).

The REQ line of the first device is connected with the RDY line of the second device.
It is configured as an output and set to low.

The RDY line is configured as input without pull-up and the interrupt is configured to detect the transition from low to high state.

Implementation
**************

The driver implements the control protocol in the following way:

#. The transmitter initiates the transmission by calling :c:func:`bm_lpuarte_tx`.
#. The driver reconfigures the REQ line to input with pull-up and enables the detection of high to low transition.
#. The line is set to high due to the pull-up register, and that triggers an interrupt on the RDY line on the receiver device.
#. On that interrupt, the driver starts the UART receiver.
#. When the receiver is ready, the driver reconfigures the RDY line to output low.
#. Then, the driver reconfigures the RDY line to input with pull-up and enables the interrupt on detection of high to low transition.
#. This sequence results in a short pulse on the line, as the line goes low and high.
#. The initiator detects the pulse and starts the standard UART transfer.
#. When the transfer is completed, the transmitter driver reconfigures the REQ line to the initial state: output set to low.
This results in a line state change.
#. As the line goes low, the receiver detects the change.
This indicates that the UARTE receiver can be stopped.

Once the receiver acknowledges the transfer, it must be capable of receiving the whole transfer until the REQ line goes down.

This requirement can be fulfilled in two ways:

* By providing a buffer of the size of the maximum packet length.
* By continuously responding to the RX buffer request event.
The latency of the event handling must be taken into account in that case.
For example, a flash page erase on some devices might have a significant impact.

Sample usage
************

See the :ref:`bm_lpuarte_sample` sample for the implementation of this driver.
1 change: 1 addition & 0 deletions doc/nrf-bm/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The |BMlong| is a distinct repository that incorporates elements from the existi
:caption: Contents

install_nrf_bm.rst
drivers.rst
libraries/index.rst
samples.rst
ug_dfu.rst
Expand Down
1 change: 1 addition & 0 deletions doc/nrf-bm/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@
.. _`nRF54L15`: https://docs.nordicsemi.com/category/nRF54L15-category
.. _`nRF54L10`: https://docs.nordicsemi.com/category/nRF54L10-category
.. _`nRF54L05`: https://docs.nordicsemi.com/category/nRF54L05-category
.. _`nrfx documentation`: https://docs.nordicsemi.com/bundle/nrfx-apis-latest/page/index.html
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_compile_options($<TARGET_PROPERTY:compiler,warning_shadow_variables>)
add_subdirectory_ifdef(CONFIG_CONSOLE console)
add_subdirectory_ifdef(CONFIG_CLOCK_CONTROL clock_control)
add_subdirectory_ifdef(CONFIG_FLASH flash)
add_subdirectory_ifdef(CONFIG_BM_SW_LPUARTE lpuarte)
Comment on lines 10 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nordicjm to go through and add missing sort lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it, this will be a separate PR.

1 change: 1 addition & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ menu "Device Drivers"
# zephyr-keep-sorted-start
rsource "console/Kconfig"
rsource "flash/Kconfig"
rsource "lpuarte/Kconfig"
# zephyr-keep-sorted-stop

endmenu
8 changes: 8 additions & 0 deletions drivers/lpuarte/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
zephyr_library()

zephyr_library_sources(lpuarte.c)
20 changes: 20 additions & 0 deletions drivers/lpuarte/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Copyright (c) 2025 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config BM_SW_LPUARTE
bool "Low Power UARTE using REQ/RDY lines"
depends on BM_TIMER
help
Low Power UARTE implements UARTE API and extends standard UARTE
communication with a 2-pin protocol for receiver wake-up and flow control.

if BM_SW_LPUARTE

module = BM_SW_LPUARTE
module-str = Low Power UARTE
source "subsys/logging/Kconfig.template.log_config"

endif # BM_SW_LPUARTE
Loading