first commit

This commit is contained in:
2024-10-10 00:45:09 +06:00
commit e56944bbcd
89 changed files with 31498 additions and 0 deletions

17
include/uart.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef UART_H
#define UART_H
#include <stdint.h>
// Macro definitions
#define APB1_CLOCK (FUNCONF_SYSTEM_CORE_CLOCK / 2) // APB1 is divided by 2
#define UART_BRR_APB1 \
(((APB1_CLOCK) + (UART_BAUD_RATE / 2)) / (UART_BAUD_RATE)) // USART2
#define UART_BRR_APB2 \
(((FUNCONF_SYSTEM_CORE_CLOCK) + (UART_BAUD_RATE / 2)) / \
(UART_BAUD_RATE)) // USART1
// Function prototypes
void setup_uart(int uart_brr);
#endif // UART_H