mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
stm32/uart: Add support for LPUART1 on L0, L4, H7 and WB MCUs.
Add LPUART1 as a standard UART. No low power features are supported, yet.
LPUART1 is enabled as the next available UART after the standard U(S)ARTs:
STM32WB: LPUART1 = UART(2)
STM32L0: LPUART1 = UART(6)
STM32L4: LPUART1 = UART(6)
STM32H7: LPUART1 = UART(9)
On all ports: LPUART1 = machine.UART('LP1')
LPUART1 is enabled by defining MICROPY_HW_LPUART1_TX and
MICROPY_HW_LPUART1_RX in mpconfigboard.h.
Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
This commit is contained in:
committed by
Damien George
parent
1342debb9b
commit
9d674cf7ab
@@ -742,11 +742,13 @@ void USART1_IRQHandler(void) {
|
||||
IRQ_EXIT(USART1_IRQn);
|
||||
}
|
||||
|
||||
#if defined(USART2)
|
||||
void USART2_IRQHandler(void) {
|
||||
IRQ_ENTER(USART2_IRQn);
|
||||
uart_irq_handler(2);
|
||||
IRQ_EXIT(USART2_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(STM32F0)
|
||||
|
||||
@@ -772,29 +774,37 @@ void USART4_5_IRQHandler(void) {
|
||||
|
||||
#else
|
||||
|
||||
#if defined(USART3)
|
||||
void USART3_IRQHandler(void) {
|
||||
IRQ_ENTER(USART3_IRQn);
|
||||
uart_irq_handler(3);
|
||||
IRQ_EXIT(USART3_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UART4)
|
||||
void UART4_IRQHandler(void) {
|
||||
IRQ_ENTER(UART4_IRQn);
|
||||
uart_irq_handler(4);
|
||||
IRQ_EXIT(UART4_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UART5)
|
||||
void UART5_IRQHandler(void) {
|
||||
IRQ_ENTER(UART5_IRQn);
|
||||
uart_irq_handler(5);
|
||||
IRQ_EXIT(UART5_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USART6)
|
||||
void USART6_IRQHandler(void) {
|
||||
IRQ_ENTER(USART6_IRQn);
|
||||
uart_irq_handler(6);
|
||||
IRQ_EXIT(USART6_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UART7)
|
||||
void UART7_IRQHandler(void) {
|
||||
@@ -830,6 +840,14 @@ void UART10_IRQHandler(void) {
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(LPUART1)
|
||||
void LPUART1_IRQHandler(void) {
|
||||
IRQ_ENTER(LPUART1_IRQn);
|
||||
uart_irq_handler(PYB_LPUART_1);
|
||||
IRQ_EXIT(LPUART1_IRQn);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MICROPY_PY_PYB_LEGACY
|
||||
|
||||
#if defined(MICROPY_HW_I2C1_SCL)
|
||||
|
||||
Reference in New Issue
Block a user