summaryrefslogtreecommitdiff
path: root/project/Core/Src/Homework
diff options
context:
space:
mode:
Diffstat (limited to 'project/Core/Src/Homework')
-rw-r--r--project/Core/Src/Homework/hw6.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/project/Core/Src/Homework/hw6.c b/project/Core/Src/Homework/hw6.c
new file mode 100644
index 0000000..4fea34b
--- /dev/null
+++ b/project/Core/Src/Homework/hw6.c
@@ -0,0 +1,22 @@
+/*
+ * hw6.c
+ *
+ * Created on: Oct 30, 2025
+ * Author: sowgro
+ */
+
+#include "stm32l476xx.h"
+#include "stdio.h"
+#include "UART.h"
+
+void hw6_run() {
+
+ UART2_Init();
+ USART2->CR1 |= USART_CR1_RXNEIE; // Enable RX interrupt
+ NVIC_EnableIRQ(USART2_IRQn);
+}
+
+void USART2_IRQHandler() {
+ int ch = USART_Read(USART2);
+ putchar(ch);
+}