summaryrefslogtreecommitdiff
path: root/project/Core/Src/Homework/hw6.c
blob: 4fea34b92c1ae8637e4dbb6ff0d4ab4855ea3a2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
}