61 lines
2.0 KiB
C
61 lines
2.0 KiB
C
/**
|
|
******************************************************************************
|
|
* @file usart.h
|
|
* @author AMG Energy Solution Team
|
|
* @version V1.0.0
|
|
* @date 07-Feb-2022
|
|
* @brief This file provides all the headers of the usart comm. functions.
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
|
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
|
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
|
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
|
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
|
*
|
|
* <h2><center>© COPYRIGHT 2022 AMG</center></h2>
|
|
******************************************************************************
|
|
*/
|
|
|
|
/** @addtogroup mBMS2
|
|
* @{
|
|
*/
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __USART_H
|
|
#define __USART_H
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "hc32_ddl.h"
|
|
|
|
#ifdef CONSOLE_DEBUG
|
|
/* Defines -------------------------------------------------------------------*/
|
|
#define UART1_TX_BUFFER_SIZE 1024
|
|
#define UART1_RX_BUFFER_SIZE 128
|
|
|
|
/* Type declarations ---------------------------------------------------------*/
|
|
typedef struct{
|
|
uint16_t RxInPos, RxOutPos;
|
|
uint16_t TxInPos, TxOutPos;
|
|
uint8_t RxBuf[UART1_RX_BUFFER_SIZE];
|
|
uint8_t TxBuf[UART1_TX_BUFFER_SIZE];
|
|
} UART1_Info;
|
|
|
|
void debug_usart_init(void);
|
|
|
|
//void uart1_init(uint32_t bound);
|
|
int Debug_GetChar(uint8_t *data);
|
|
void Debug_PutChar(const uint8_t ascii);
|
|
//void UART1_PutStr(uint8_t *str, uint16_t len);
|
|
//void UART1_printf(const char *fmt,...);
|
|
|
|
uint8_t UART1_GC(void);
|
|
|
|
#endif /* CONSOLE_DEBUG */
|
|
|
|
#endif
|
|
|
|
/*******************(C)COPYRIGHT 2022 AMG ********************END OF FILE******/
|