This commit is contained in:
Alexander Heldt
2024-08-12 21:54:29 +02:00
parent 2fc8ee4f92
commit 6caccce751
11 changed files with 780 additions and 529 deletions

View File

@@ -16,6 +16,15 @@ struct usart {
#define USART2_BASE_ADDR (0x40004400U)
#define USART2 ((struct usart *) USART2_BASE_ADDR)
// SR Register
// Transmission data register empty
#define USART_SR_TXE_BIT 7
#define USART_SR_TXE_TRANSMITTED (1 << USART_SR_TXE_BIT)
// Read data register not empty
#define USART_SR_RXNE_BIT 5
#define USART_SR_RXNE_READY (1 <<USART_SR_RXNE_BIT)
// CR Register
// Oversampling mode
#define USART_CR1_OVER8_BIT 15
@@ -43,4 +52,6 @@ struct usart {
void usart2_init(void);
void usart2_start(void);
void usart2_write_byte(char byte);
#endif