2021-12-05 22:02:41 +08:00

44 lines
1.4 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __USART_H
#define __USART_H
#include "stdio.h"
#include "sys.h"
//////////////////////////////////////////////////////////////////////////////////
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>ѧϰʹ<CFB0>ã<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><CEBA><EFBFBD>;
//ALIENTEK STM32<33><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD>1<EFBFBD><31>ʼ<EFBFBD><CABC>
//<2F><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>@ALIENTEK
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳:www.openedv.com
//<2F>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>:2012/8/18
//<2F><EFBFBD><E6B1BE>V1.5
//<2F><>Ȩ<EFBFBD><C8A8><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
//Copyright(C) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿƼ<D3BF><C6BC><EFBFBD><EFBFBD>޹<EFBFBD>˾ 2009-2019
//All rights reserved
//********************************************************************************
//V1.3<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD>
//֧<><D6A7><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>ͬƵ<CDAC><C6B5><EFBFBD>µĴ<C2B5><C4B4>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
//<2F><><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>printf<74><66>֧<EFBFBD><D6A7>
//<2F><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB9A6>.
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>printf<74><66>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ʧ<EFBFBD><CAA7>bug
//V1.4<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD>
//1,<2C>޸Ĵ<DEB8><C4B4>ڳ<EFBFBD>ʼ<EFBFBD><CABC>IO<49><4F>bug
//2,<2C>޸<EFBFBD><DEB8><EFBFBD>USART_RX_STA,ʹ<>ô<EFBFBD><C3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>Ϊ2<CEAA><32>14<31>η<EFBFBD>
//3,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>USART_REC_LEN,<2C><><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD><E5B4AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5>ֽ<EFBFBD><D6BD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32>14<31>η<EFBFBD>)
//4,<2C>޸<EFBFBD><DEB8><EFBFBD>EN_USART1_RX<52><58>ʹ<EFBFBD>ܷ<EFBFBD>ʽ
//V1.5<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD>
//1,<2C><><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>UCOSII<49><49>֧<EFBFBD><D6A7>
#define USART_REC_LEN 200 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD> 200
#define EN_USART1_RX 1 //ʹ<>ܣ<EFBFBD>1<EFBFBD><31>/<2F><>ֹ<EFBFBD><D6B9>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>
extern u8 USART_RX_BUF[USART_REC_LEN]; //<2F><><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD>,<2C><><EFBFBD><EFBFBD>USART_REC_LEN<45><4E><EFBFBD>ֽ<EFBFBD><>ֽ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>з<EFBFBD>
extern u16 USART_RX_STA; //<2F><><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>
extern UART_HandleTypeDef UART1_Handler; //UART<52><54><EFBFBD><EFBFBD>
#define RXBUFFERSIZE 1 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
extern u8 aRxBuffer[RXBUFFERSIZE]; //HAL<41><4C>USART<52><54><EFBFBD><EFBFBD>Buffer
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB4AE><EFBFBD>жϽ<D0B6><CFBD>գ<EFBFBD><D5A3>벻Ҫע<D2AA><D7A2><EFBFBD><EFBFBD><EFBFBD>º궨<C2BA><EAB6A8>
void uart_init(u32 bound);
#endif