47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
/*
|
|
* UART.h
|
|
*
|
|
* Created on: 2022年03月12日
|
|
* Author: User
|
|
*/
|
|
|
|
|
|
#ifndef __UART_H_
|
|
#define __UART_H_
|
|
|
|
#include <Public.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//定义异步串口结构体类型
|
|
typedef struct
|
|
{
|
|
|
|
uint8_t volatile ucTX_Busy_Flag; //发送忙碌标志
|
|
uint8_t volatile ucRec_Flag; //接收标志位
|
|
uint8_t volatile ucRec_Cnt; //接收计数
|
|
|
|
uint8_t* pucSend_Buffer; //发送缓存指针
|
|
uint8_t* pucRec_Buffer; //接收缓存指针
|
|
|
|
void (*UART_Init)(void); //串口初始化
|
|
void (*UART_SendData)(uint8_t); //串口发送字符
|
|
void (*UART_SendArray)(uint8_t*,uint16_t); //串口发送数组
|
|
void (*UART_SendString)(uint8_t*); //串口发送字符串
|
|
void (*Protocol_Analy)(void); //接口协议
|
|
|
|
} UART_t;
|
|
|
|
/* extern variables-----------------------------------------------------------*/
|
|
|
|
extern UART_t idata UART1;
|
|
|
|
/* extern function prototypes-------------------------------------------------*/
|
|
|
|
#endif
|
|
/********************************************************
|
|
End Of File
|
|
********************************************************/ |