Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
d61e7a6d
Commit
d61e7a6d
authored
Dec 05, 2019
by
Chris Mason
Committed by
Damien George
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stm32/uart: Add support for UART4/5 on L0 MCUs.
parent
9ca8a503
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
ports/stm32/mpconfigboard_common.h
ports/stm32/mpconfigboard_common.h
+1
-1
ports/stm32/stm32_it.c
ports/stm32/stm32_it.c
+9
-0
ports/stm32/uart.c
ports/stm32/uart.c
+8
-0
No files found.
ports/stm32/mpconfigboard_common.h
View file @
d61e7a6d
...
...
@@ -196,7 +196,7 @@
#define PYB_EXTI_NUM_VECTORS (30) // TODO (22 configurable, 7 direct)
#define MICROPY_HW_MAX_I2C (3)
#define MICROPY_HW_MAX_TIMER (22)
#define MICROPY_HW_MAX_UART (
4
)
#define MICROPY_HW_MAX_UART (
5
)
// Configuration for STM32L4 series
#elif defined(STM32L4)
...
...
ports/stm32/stm32_it.c
View file @
d61e7a6d
...
...
@@ -731,6 +731,15 @@ void USART3_8_IRQHandler(void) {
IRQ_EXIT
(
USART3_8_IRQn
);
}
#elif defined(STM32L0)
void
USART4_5_IRQHandler
(
void
)
{
IRQ_ENTER
(
USART4_5_IRQn
);
uart_irq_handler
(
4
);
uart_irq_handler
(
5
);
IRQ_EXIT
(
USART4_5_IRQn
);
}
#else
void
USART3_IRQHandler
(
void
)
{
...
...
ports/stm32/uart.c
View file @
d61e7a6d
...
...
@@ -247,6 +247,10 @@ bool uart_init(pyb_uart_obj_t *uart_obj,
UARTx
=
USART4
;
irqn
=
USART3_8_IRQn
;
__HAL_RCC_USART4_CLK_ENABLE
();
#elif defined(STM32L0)
UARTx
=
USART4
;
irqn
=
USART4_5_IRQn
;
__HAL_RCC_USART4_CLK_ENABLE
();
#else
UARTx
=
UART4
;
irqn
=
UART4_IRQn
;
...
...
@@ -274,6 +278,10 @@ bool uart_init(pyb_uart_obj_t *uart_obj,
UARTx
=
USART5
;
irqn
=
USART3_8_IRQn
;
__HAL_RCC_USART5_CLK_ENABLE
();
#elif defined(STM32L0)
UARTx
=
USART5
;
irqn
=
USART4_5_IRQn
;
__HAL_RCC_USART5_CLK_ENABLE
();
#else
UARTx
=
UART5
;
irqn
=
UART5_IRQn
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment