-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
ports: Support UART.irq for the RP2, ESP32, MIMXRT, NRF, Renesas-RA and SAMD ports. #14041
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
01c046d
rp2/machine_uart: Implement a Python UART IRQ handler.
robert-hh 8e1123b
samd/machine_uart: Implement a Python UART IRQ handler.
robert-hh b7fa4e2
mimxrt/machine_uart: Implement a Python UART IRQ handler.
robert-hh 324c675
renesas-ra/machine_uart: Add the UART.IRQ_RX class constant.
robert-hh 1027b5f
cc3200/mods/pybuart: Add the UART.IRQ_RX class constant.
robert-hh a04a141
esp32/machine_uart: Implement Python UART IRQ with IRQ_RX and IRQ_BREAK.
robert-hh 4da5de9
nrf/modules/machine/uart: Allow changing the UART baud rate w/o reset.
robert-hh bae8090
nrf/modules/machine/uart: Implement Python UART IRQ for nrf52840 boards.
robert-hh a86619f
stm32/machine_uart: Add the UART.IRQ_RX event for UART.irq().
robert-hh ef69d0f
samd/machine_uart: Implement UART.IRQ_RXIDLE based on the softtimer.
robert-hh 7045975
renesas-ra/machine_uart: Implement UART.IRQ_RXIDLE based on softtimer.
robert-hh a38b4f4
esp32/machine_uart: Implement UART.RX_IDLE based on machine.Timer.
robert-hh 9bbe616
docs/library/machine.UART: Fix UART.irq docs to match current code.
dpgeorge 03b1b6d
docs/library/machine.UART: Extend the documentation for UART.irq.
robert-hh b8513e6
tests/extmod: Add test for machine.UART.IRQ_TXIDLE.
dpgeorge 09d070a
tests/extmod_hardware: Add tests for machine.UART.IRQ_RX/RXIDLE/BREAK.
dpgeorge 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
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,66 @@ | ||
/* | ||
* This file is part of the MicroPython project, http://micropython.org/ | ||
* | ||
* Development of the code in this file was sponsored by Microbric Pty Ltd | ||
* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2013-2015 Damien P. George | ||
* Copyright (c) 2016 Paul Sokolovsky | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
#ifndef MICROPY_INCLUDED_ESP32_MACHINE_TIMER_H | ||
#define MICROPY_INCLUDED_ESP32_MACHINE_TIMER_H | ||
|
||
#include "hal/timer_hal.h" | ||
#include "hal/timer_ll.h" | ||
#include "soc/timer_periph.h" | ||
|
||
#define TIMER_DIVIDER 8 | ||
|
||
// TIMER_BASE_CLK is normally 80MHz. TIMER_DIVIDER ought to divide this exactly | ||
#define TIMER_SCALE (APB_CLK_FREQ / TIMER_DIVIDER) | ||
|
||
#define TIMER_FLAGS 0 | ||
|
||
typedef struct _machine_timer_obj_t { | ||
mp_obj_base_t base; | ||
|
||
timer_hal_context_t hal_context; | ||
mp_uint_t group; | ||
mp_uint_t index; | ||
|
||
mp_uint_t repeat; | ||
// ESP32 timers are 64-bit | ||
uint64_t period; | ||
|
||
mp_obj_t callback; | ||
|
||
intr_handle_t handle; | ||
|
||
struct _machine_timer_obj_t *next; | ||
} machine_timer_obj_t; | ||
|
||
machine_timer_obj_t *machine_timer_create(mp_uint_t timer); | ||
void machine_timer_enable(machine_timer_obj_t *self, void (*timer_isr)); | ||
void machine_timer_disable(machine_timer_obj_t *self); | ||
|
||
#endif // MICROPY_INCLUDED_ESP32_MACHINE_TIMER_H |
Oops, something went wrong.
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.