-
Couldn't load subscription status.
- Fork 22
drivers: LPUARTE #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: LPUARTE #202
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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/* |
| 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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
|
||
| 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) |
| 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" | ||
anhmolt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 | ||
Uh oh!
There was an error while loading. Please reload this page.