voilier-team-1/driver/uart.h

27 lines
No EOL
574 B
C

#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