voilier-team-1/driver/uart.h

30 lines
586 B
C
Raw Normal View History

2023-03-31 09:37:30 +02:00
#ifndef UART_H
#define UART_H
#include "stm32f10x.h"
typedef struct {
USART_TypeDef * UART;
unsigned int BaudRate;
unsigned char Wlengh;
unsigned char Wparity;
unsigned char Wstop;
}MyUART_Struct_Typedef;
typedef enum {
//DIV_Fraction ->
//1D4C
}MyUART_BRR
2023-03-31 09:37:30 +02:00
#define parity_none 0x0
#define parity_even 0x1
#define parity_odd 0x2
#define Wlengh8 0x0
#define Wlengh9 0X1
#define stop1b 0x0
#define stop2b 0x2
void MyUART_Init(MyUART_Struct_Typedef * UARTStructPtr);
int MyUART_setClockBit(USART_TypeDef * UART);
2023-03-31 09:37:30 +02:00
char MyUART_Read(MyUART_Struct_Typedef * UARTStructPtr);
#endif