29 lines
586 B
C
29 lines
586 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;
|
|
|
|
typedef enum {
|
|
//DIV_Fraction ->
|
|
//1D4C
|
|
}MyUART_BRR
|
|
|
|
#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);
|
|
char MyUART_Read(MyUART_Struct_Typedef * UARTStructPtr);
|
|
#endif
|