wip
This commit is contained in:
11
src/usart.h
11
src/usart.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user