summaryrefslogtreecommitdiff
path: root/stmhal/stm32f4xx_it.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-10-11 17:57:10 +0100
committerDamien George <damien.p.george@gmail.com>2014-10-21 22:15:20 +0100
commit481d714bd56e0173668b249760e9cea8fce9b04f (patch)
tree4a1e9458676177d05b18e7d50966469bf44e1ec1 /stmhal/stm32f4xx_it.c
parent20f59e182e1ca5874a94ce939f8a81af6c3dd71a (diff)
stmhal: Overhaul UART class to use read/write, and improve it.v1.3.4
UART object now uses a stream-like interface: read, readall, readline, readinto, readchar, write, writechar. Timeouts are configured when the UART object is initialised, using timeout and timeout_char keyword args. The object includes optional read buffering, using interrupts. You can set the buffer size dynamically using read_buf_len keyword arg. A size of 0 disables buffering.
Diffstat (limited to 'stmhal/stm32f4xx_it.c')
-rw-r--r--stmhal/stm32f4xx_it.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/stmhal/stm32f4xx_it.c b/stmhal/stm32f4xx_it.c
index 74fdf53d1..eb65b1a54 100644
--- a/stmhal/stm32f4xx_it.c
+++ b/stmhal/stm32f4xx_it.c
@@ -76,6 +76,7 @@
#include "obj.h"
#include "extint.h"
#include "timer.h"
+#include "uart.h"
#include "storage.h"
extern void __fatal_error(const char*);
@@ -395,3 +396,24 @@ void TIM8_UP_TIM13_IRQHandler(void) {
void TIM8_TRG_COM_TIM14_IRQHandler(void) {
timer_irq_handler(14);
}
+
+// UART/USART IRQ handlers
+void USART1_IRQHandler(void) {
+ uart_irq_handler(1);
+}
+
+void USART2_IRQHandler(void) {
+ uart_irq_handler(2);
+}
+
+void USART3_IRQHandler(void) {
+ uart_irq_handler(3);
+}
+
+void UART4_IRQHandler(void) {
+ uart_irq_handler(4);
+}
+
+void USART6_IRQHandler(void) {
+ uart_irq_handler(6);
+}