feat: KT mBMS 펌웨어 3종(HW1/2/3) 및 통합 빌드 환경 초기 커밋 (V4.0.0.1)
This commit is contained in:
55
mBMS_APP_V3117/SYSTEM/usart/usart.h
Normal file
55
mBMS_APP_V3117/SYSTEM/usart/usart.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef __USART_H
|
||||
#define __USART_H
|
||||
#include "stdio.h"
|
||||
#include "stm32f4xx_conf.h"
|
||||
#include "sys.h"
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//This program is for educational purposes only, without the author's permission, may not be used for any other purpose
|
||||
//ALIENTEK STM32F4 Explorer Board
|
||||
//Initialize serial port 1
|
||||
//Hot Atomic @ALIENTEK
|
||||
//Forum: www.openedv.com
|
||||
//Date modified: 2014/6/10
|
||||
//Version: V1.4
|
||||
//All rights reserved pirated reserved.
|
||||
//Copyright(C) Guangzhou wing electronic technology limited company 2009-2019
|
||||
//All rights reserved
|
||||
//********************************************************************************
|
||||
//V1.3 changes description
|
||||
// Supports serial port baud rate setting at different frequencies.
|
||||
// Added support for printf
|
||||
// Serial port receive command features have been added.
|
||||
// Fixed printf first character missing bug
|
||||
//V1.4 amended description
|
||||
// 1, modify the initialize serial IO bug
|
||||
// 2, modify the USART_RX_STA makes serial port maximum bytes received 2 of 14
|
||||
// 3, USART_REC_LEN, defines the serial port the maximum allowable number of bytes received (not more than 2 of 14)
|
||||
// 4, the modified EN_USART1_RX method
|
||||
//V1.5 modify the description
|
||||
// 1, added support for UCOSII
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
#define DEBUG_PORT USART1
|
||||
|
||||
/* Defines -------------------------------------------------------------------*/
|
||||
#define UART1_TX_BUFFER_SIZE 1024
|
||||
#define UART1_RX_BUFFER_SIZE 128
|
||||
|
||||
/* Type declarations ---------------------------------------------------------*/
|
||||
typedef struct{
|
||||
u16 RxInPos, RxOutPos;
|
||||
u16 TxInPos, TxOutPos;
|
||||
u8 RxBuf[UART1_RX_BUFFER_SIZE];
|
||||
u8 TxBuf[UART1_TX_BUFFER_SIZE];
|
||||
} UART1_Info;
|
||||
|
||||
void uart1_init(u32 bound);
|
||||
ErrorStatus UART1_GetChar(u8 *data);
|
||||
void UART1_PutChar(const u8 ascii);
|
||||
void UART1_PutStr(u8 *str, u16 len);
|
||||
void UART1_printf(const char *fmt,...);
|
||||
|
||||
u8 UART1_GC(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user