-
Notifications
You must be signed in to change notification settings - Fork 14
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
Merged
Merged
drivers: LPUARTE #202
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
Comment on lines
10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nordicjm to go through and add missing sort lines There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I understand it, this will be a separate PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.