| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #ifndef __USARTSETUP_H__
- #define __USARTSETUP_H__
- /*--------------------------------------------------------------------------------------
- * @file USARTSetup.h
- * @author ZhangJing
- * @version base on stm32f0x
- * @date 2015.09.11
- * @brief 串口驱动
- ---------------------------------------------------------------------------------------*/
- #include "stdint.h"
- #define USART1_RECV_LEN 32 //串口1接收缓冲长度
- #define USART1_XMIT_LEN 64 //串口1发送缓冲长度
- #define USART2_RECV_LEN 80 //串口2接收缓冲长度
- #define USART2_XMIT_LEN 34 //串口2发送缓冲长度
- #define USART3_RECV_LEN 32 //串口3接收缓冲长度
- #define USART3_XMIT_LEN 64 //串口3发送缓冲长度
- extern uint8_t usart1XmitBuffer[USART1_XMIT_LEN]; //USART1发送缓冲
- extern uint8_t usart1RecvBuffer[USART1_RECV_LEN]; //USART1接收缓冲
- extern uint8_t usart1RecvCnt; //USART1接收计数
- extern uint8_t usart2XmitBuffer[USART2_XMIT_LEN]; //USART2发送缓冲
- extern uint8_t usart2RecvBuffer[USART2_RECV_LEN]; //USART2接收缓冲
- extern uint8_t usart2RecvCnt; //USART2接收计数
- extern uint8_t usart3XmitBuffer[USART3_XMIT_LEN]; //USART3发送缓冲
- extern uint8_t usart3RecvBuffer[USART3_RECV_LEN]; //USART3接收缓冲
- extern uint8_t usart3RecvCnt; //USART3接收计数
- void USART1_Init(uint32_t BaudRate);
- void USART2_Init(uint32_t BaudRate);
- void USART3_Init(uint32_t BaudRate);
- void USART1Send( uint8_t *xmitDataBuf, uint32_t xmitLen );
- void USART2Send( uint8_t *xmitDataBuf, uint32_t xmitLen );
- void USART3Send( uint8_t *xmitDataBuf, uint32_t xmitLen );
- void UART1_TRxOver_Interrupt(void);
- void UART2_TRxOver_Interrupt(void);
- #endif
|