/**
* @file HW_UART_ATY.h
*
* @param Project DEVICE_GENERAL_ATY_LIB
*
* @author ATY
*
* @copyright
* - Copyright 2017 - 2023 MZ-ATY
* - This code follows:
* - MZ-ATY Various Contents Joint Statement -
*
* https://mengze.top/MZ-ATY_VCJS
* - CC 4.0 BY-NC-SA -
*
* https://creativecommons.org/licenses/by-nc-sa/4.0/
* - Your use will be deemed to have accepted the terms of this statement.
*
* @brief Familiar functions of uart for STC51
*
* @version
* - 1_01_221231 > ATY
* -# Preliminary version, first Release
********************************************************************************
*/
#ifndef __HW_UART_ATY_H
#define __HW_UART_ATY_H
#include "INCLUDE_ATY.h"
/******************************* For user *************************************/
/******************************************************************************/
#define UART_RX_MAX_LEN (9 + (15 * 4))
// #define UART_RX_MAX_LEN 16
typedef struct _uartMsgStruct{
uint8_t rx[UART_RX_MAX_LEN];
uint8_t tx;
uint8_t rxCount;
uint8_t txCount;
uint8_t busyFlag;
uint32_t overCount;
} uartMsgStruct;
extern struct _uartMsgStruct uartMsgStruct_t;
void UartInit(void);
void UartSendByte(uint8_t byte);
void UartSendBytes(uint8_t* bytes, uint16_t len);
void UartSendStr(uint8_t* buf);
void UartSendFloat(float dataFloat);
void UartSendFloatStr(float dataFloat);
void UartReceiveProcess(void);
void UartReceiveProcess_User(struct _uartMsgStruct* ptr);
#endif /* __HW_UART_ATY_H */
/******************************** End Of File *********************************/