voilier-team-1/driver/UART.h

27 lines
574 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;
#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);
void USART1_IRQHandler(void);
void USART2_IRQHandler(void);
void USART3_IRQHandler(void);
char MyUART_Read(MyUART_Struct_Typedef * UARTStructPtr);
#endif