parent
83df3d9269
commit
207273236d
Binary file not shown.
@ -1,5 +1,6 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"driver_ds3231.h": "c"
|
||||
"driver_ds3231.h": "c",
|
||||
"board_config.h": "c"
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,177 @@
|
||||
#include "kcd_hp100.h"
|
||||
#include "sw_timer.h"
|
||||
#include "usart11_rs485.h"
|
||||
|
||||
|
||||
#define STX 0x03
|
||||
#define ETX 0x04
|
||||
#define DEFAULT_DEVICE_ID 31
|
||||
#define MEASUREMENT_DATA_SIZE 26
|
||||
#define PACKET_RX_TIMEOUT 300
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PACK_INDEX_STX = 0,
|
||||
PACK_INDEX_SLAVE_ID = 1,
|
||||
PACK_INDEX_SIZE = 2,
|
||||
PACK_INDEX_CHECKSUM = 24,
|
||||
PACK_INDEX_ETX = 25,
|
||||
}PACKET_INDEX;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CMD_GET_MEASUREMENT_RESULT = 0x0A,
|
||||
CMD_SET_DEVICE_ID = 0x3A,
|
||||
CMD_SET_OUTPUT = 0x3B,
|
||||
CMD_SET_BAUDRATE = 0x3C,
|
||||
|
||||
}KCD_HP100_CMD;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef union _kcd_hp100_rx_info
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t Stx;
|
||||
uint8_t Slave_ID;
|
||||
uint8_t PacketSize;
|
||||
uint8_t Command;
|
||||
uint8_t System_Classification_Code;
|
||||
uint8_t System_Name[10];
|
||||
uint16_t Co2;
|
||||
uint16_t Temperature;
|
||||
uint16_t Humidity;
|
||||
uint16_t VOC;
|
||||
uint8_t Firmware_Version;
|
||||
uint8_t CheckSum;
|
||||
uint8_t Etx;
|
||||
}Measurement;
|
||||
uint8_t Rxbuff[26];
|
||||
}KCD_HP100_RX_INFO;
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
static uint8_t KCD_HP100_DeviceID;
|
||||
static uint8_t KCD_HP100_TxCommand;
|
||||
static uint8_t KCD_HP100_RxIndex;
|
||||
static uint8_t KCD_HP100_CheckSum;
|
||||
static uint32_t KCD_HP100_TimeoutCount;
|
||||
static KCD_HP100_STATE KCD_HP100_State;
|
||||
static KCD_HP100_RX_INFO KCD_HP100_Result;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static uint8_t KCD_HP_Calc_Checksum(uint8_t* pChecksumData, uint8_t DataSize);
|
||||
static void KCD_HP_Rx_PacketRecv_Process(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void KCD_HP100_Initialization(void)
|
||||
{
|
||||
KCD_HP100_DeviceID = DEFAULT_DEVICE_ID;
|
||||
KCD_HP100_State = KCD_HP100_IDLE;
|
||||
SW_Timer_Callback_Register(SW_TIMER_RUN_CONTINUE, 0, KCD_HP_Rx_PacketRecv_Process);
|
||||
}
|
||||
|
||||
void KCD_HP100_Tx_Get_MeasurmentData(void)
|
||||
{
|
||||
uint8_t TxIndex = 0;
|
||||
uint8_t TxBuff[10];
|
||||
uint8_t CheckSum;
|
||||
|
||||
KCD_HP100_State = KCD_HP100_TRANSMIT;
|
||||
KCD_HP100_TimeoutCount = millis();
|
||||
KCD_HP100_TxCommand = CMD_GET_MEASUREMENT_RESULT;
|
||||
KCD_HP100_RxIndex = 0;
|
||||
|
||||
|
||||
TxBuff[TxIndex++] = STX;
|
||||
TxBuff[TxIndex++] = KCD_HP100_DeviceID;
|
||||
TxBuff[TxIndex++] = 0x06;
|
||||
|
||||
TxBuff[TxIndex++] = KCD_HP100_TxCommand;
|
||||
CheckSum = KCD_HP_Calc_Checksum(TxBuff, TxIndex);
|
||||
TxBuff[TxIndex++] = CheckSum;
|
||||
TxBuff[TxIndex++] = ETX;
|
||||
|
||||
Usart11_TransmitData(TxBuff, TxIndex);
|
||||
}
|
||||
|
||||
|
||||
KCD_HP100_STATE KCD_HP100_GetState(void)
|
||||
{
|
||||
return KCD_HP100_State;
|
||||
}
|
||||
|
||||
bool KCD_HP100_Get_Co2(uint16_t* pGetCo2)
|
||||
{
|
||||
if(KCD_HP100_State != KCD_HP100_SUCCESS)
|
||||
return false;
|
||||
*pGetCo2 = KCD_HP100_Result.Measurement.Co2;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static uint8_t KCD_HP_Calc_Checksum(uint8_t* pChecksumData, uint8_t DataSize)
|
||||
{
|
||||
uint8_t i;
|
||||
uint8_t checksum = 0;
|
||||
|
||||
for(i = 0 ; i < DataSize ; i++)
|
||||
{
|
||||
checksum += pChecksumData[i];
|
||||
}
|
||||
|
||||
return checksum;
|
||||
}
|
||||
|
||||
static void KCD_HP_Rx_PacketRecv_Process(void)
|
||||
{
|
||||
if(Usart11_Get_RecvDataCount() != 0)
|
||||
{
|
||||
uint8_t rxData = Usart11_Get_RecvData();
|
||||
|
||||
if(KCD_HP100_RxIndex == PACK_INDEX_STX && rxData == STX){
|
||||
KCD_HP100_Result.Rxbuff[KCD_HP100_RxIndex++] = rxData;
|
||||
KCD_HP100_CheckSum = rxData;
|
||||
}
|
||||
else if(KCD_HP100_RxIndex == PACK_INDEX_SLAVE_ID && rxData == KCD_HP100_DeviceID){
|
||||
KCD_HP100_Result.Rxbuff[KCD_HP100_RxIndex++] = rxData;
|
||||
KCD_HP100_CheckSum += rxData;
|
||||
}
|
||||
else if(KCD_HP100_RxIndex == PACK_INDEX_SIZE && rxData == MEASUREMENT_DATA_SIZE){
|
||||
KCD_HP100_Result.Rxbuff[KCD_HP100_RxIndex++] = rxData;
|
||||
KCD_HP100_CheckSum += rxData;
|
||||
}
|
||||
else if(KCD_HP100_RxIndex < PACK_INDEX_CHECKSUM){
|
||||
KCD_HP100_Result.Rxbuff[KCD_HP100_RxIndex++] = rxData;
|
||||
KCD_HP100_CheckSum += rxData;
|
||||
}
|
||||
else if(KCD_HP100_RxIndex == PACK_INDEX_CHECKSUM && rxData == KCD_HP100_CheckSum){
|
||||
KCD_HP100_Result.Rxbuff[KCD_HP100_RxIndex++] = rxData;
|
||||
}
|
||||
else if(KCD_HP100_RxIndex == PACK_INDEX_ETX && rxData == ETX){
|
||||
KCD_HP100_Result.Rxbuff[KCD_HP100_RxIndex++] = rxData;
|
||||
KCD_HP100_RxIndex = 0;
|
||||
//dbg_printf("co2 = %d\r\n", KCD_HP100_Result.Measurement.Co2);
|
||||
KCD_HP100_State = KCD_HP100_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
KCD_HP100_RxIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(KCD_HP100_State == KCD_HP100_TRANSMIT)
|
||||
{
|
||||
if((millis() - KCD_HP100_TimeoutCount) >= PACKET_RX_TIMEOUT)
|
||||
{
|
||||
KCD_HP100_State = KCD_HP100_ERROR_TIMEOUT;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
/** \file kcd_hp100.h */
|
||||
#if !defined(KCD_HP100_H__623A6ED1_F4A3_4BF2_99DE_65E7E10882F3__INCLUDED_)
|
||||
#define KCD_HP100_H__623A6ED1_F4A3_4BF2_99DE_65E7E10882F3__INCLUDED_
|
||||
|
||||
#include "define.h"
|
||||
#include "board_config.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
||||
KCD_HP100_IDLE,
|
||||
KCD_HP100_SUCCESS,
|
||||
KCD_HP100_TRANSMIT,
|
||||
KCD_HP100_ERROR_TIMEOUT,
|
||||
}KCD_HP100_STATE;
|
||||
|
||||
void KCD_HP100_Initialization(void);
|
||||
void KCD_HP100_Tx_Get_MeasurmentData(void);
|
||||
|
||||
KCD_HP100_STATE KCD_HP100_GetState(void);
|
||||
bool KCD_HP100_Get_Co2(uint16_t* pGetCo2);
|
||||
|
||||
#endif
|
@ -1,289 +0,0 @@
|
||||
#include "uart1_rs485.h"
|
||||
#include "sw_timer.h"
|
||||
#include "ring_buffer.h"
|
||||
#include "gpio_uart_led.h"
|
||||
|
||||
|
||||
//#define UARTn_RS485_TX_INTERRUTP_ENABLE
|
||||
|
||||
|
||||
#define UARTn_RS485_PERIPHERAL UART1
|
||||
#define UARTn_RS485_INTERRUPT_HANDLER UART1_IRQn
|
||||
#define UARTn_RS485_INTERRUPT_MASK MSK_UART1
|
||||
#define UARTn_RS485_INTERRUPT_PRIORITY 3
|
||||
#define UARTn_RS485_TX_PORT PB
|
||||
#define UARTn_RS485_TX_PIN_NUM 6
|
||||
#define UARTn_RS485_RX_PORT PB
|
||||
#define UARTn_RS485_RX_PIN_NUM 7
|
||||
|
||||
#define UARTn_RS485_TX_BUFFER_SIZE 100
|
||||
#define UARTn_RS485_RX_BUFFER_SIZE 300
|
||||
|
||||
|
||||
#define UARTn_RS485_REDE_PORT (Pn_Type*)PC
|
||||
#define UARTn_RS485_REDE_NUM 0
|
||||
#define UARTn_RS485_RECEIVE HAL_GPIO_ClearPin(UARTn_RS485_REDE_PORT, _BIT(UARTn_RS485_REDE_NUM))
|
||||
#define UARTn_RS485_TRANSMIT HAL_GPIO_SetPin(UARTn_RS485_REDE_PORT, _BIT(UARTn_RS485_REDE_NUM))
|
||||
|
||||
|
||||
|
||||
static uint8_t Tx_RS485_Buffer[UARTn_RS485_TX_BUFFER_SIZE];
|
||||
static uint8_t Rx_RS485_Buffer[UARTn_RS485_RX_BUFFER_SIZE];
|
||||
static RING_BUFFER RingBuffer_RS485_Tx;
|
||||
static RING_BUFFER RingBuffer_RS485_Rx;
|
||||
|
||||
|
||||
#if defined(UARTn_RS485_TX_INTERRUTP_ENABLE)
|
||||
static volatile uint8_t Uartn_RS485_TxIntEnable = FALSE;
|
||||
static void Uart1_RS485_Init_TransmitSet(void);
|
||||
#else
|
||||
static void Uart1_RS485_Transmit_Process(void);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static void Uart1_RS485_Receive_Handler(void);
|
||||
|
||||
|
||||
void Uart1_RS485_Initialization(uint32_t Baudrate, UARTn_DATA_BIT_Type Databit, UARTn_PARITY_BIT_Type Paritybit, UARTn_STOP_BIT_Type Stopbit)
|
||||
{
|
||||
UARTn_CFG_Type UARTn_Config;
|
||||
|
||||
/*
|
||||
* Initialize UART0 pin connect
|
||||
*/
|
||||
HAL_GPIO_ConfigOutput((Pn_Type*)UARTn_RS485_RX_PORT, UARTn_RS485_RX_PIN_NUM, ALTERN_FUNC );
|
||||
HAL_GPIO_ConfigFunction((Pn_Type*)UARTn_RS485_RX_PORT, UARTn_RS485_RX_PIN_NUM, AFSRx_AF1 );
|
||||
HAL_GPIO_ConfigPullup((Pn_Type*)UARTn_RS485_RX_PORT, UARTn_RS485_RX_PIN_NUM, PUPDx_EnablePU );
|
||||
|
||||
HAL_GPIO_ConfigOutput((Pn_Type*)UARTn_RS485_TX_PORT, UARTn_RS485_TX_PIN_NUM, ALTERN_FUNC );
|
||||
HAL_GPIO_ConfigFunction((Pn_Type*)UARTn_RS485_TX_PORT, UARTn_RS485_TX_PIN_NUM, AFSRx_AF1 );
|
||||
|
||||
// default: 38400-8-N-1
|
||||
HAL_UART_ConfigStructInit(&UARTn_Config);
|
||||
UARTn_Config.Baudrate = Baudrate;
|
||||
UARTn_Config.Databits = Databit;
|
||||
UARTn_Config.Parity = Paritybit;
|
||||
UARTn_Config.Stopbits = Stopbit;
|
||||
|
||||
HAL_UART_Init((UARTn_Type*)UARTn_RS485_PERIPHERAL, &UARTn_Config);
|
||||
|
||||
|
||||
HAL_GPIO_ConfigOutput(UARTn_RS485_REDE_PORT, UARTn_RS485_REDE_NUM, PUSH_PULL_OUTPUT);
|
||||
HAL_GPIO_ConfigPullup(UARTn_RS485_REDE_PORT, UARTn_RS485_REDE_NUM, PUPDx_EnablePU);
|
||||
UARTn_RS485_RECEIVE;
|
||||
|
||||
/* Enable UART Rx interrupt */
|
||||
HAL_UART_ConfigInterrupt((UARTn_Type*)UARTn_RS485_PERIPHERAL, UARTn_INTCFG_RBR, ENABLE );
|
||||
|
||||
#if defined(UARTn_RS485_TX_INTERRUTP_ENABLE)
|
||||
// Reset Tx Interrupt state
|
||||
Uartn_RS485_TxIntEnable = RESET;
|
||||
#else
|
||||
SW_Timer_Callback_Register(SW_TIMER_RUN_CONTINUE, 0, Uart1_RS485_Transmit_Process);
|
||||
#endif
|
||||
|
||||
RingBuffer_Initialization(&RingBuffer_RS485_Rx, false, UARTn_RS485_RX_BUFFER_SIZE, &Rx_RS485_Buffer[0]);
|
||||
RingBuffer_Initialization(&RingBuffer_RS485_Tx, false, UARTn_RS485_TX_BUFFER_SIZE, &Tx_RS485_Buffer[0]);
|
||||
|
||||
NVIC_SetPriority(UARTn_RS485_INTERRUPT_HANDLER, UARTn_RS485_INTERRUPT_PRIORITY);
|
||||
NVIC_EnableIRQ(UARTn_RS485_INTERRUPT_HANDLER );
|
||||
HAL_INT_EInt_MaskDisable(UARTn_RS485_INTERRUPT_MASK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Uart1_RS485_Transmit(uint8_t TxData)
|
||||
{
|
||||
#if defined(UARTn_RS485_TX_INTERRUTP_ENABLE)
|
||||
/* Temporarily lock out UART transmit interrupts during this read so the UART transmit interrupt won't cause problems with the index values */
|
||||
HAL_UART_ConfigInterrupt((UARTn_Type*)UARTn_PERIPHERAL, UARTn_INTCFG_THRE, DISABLE );
|
||||
|
||||
RingBuffer_Enqueue(&RingBuffer_Tx, TxData);
|
||||
|
||||
/*
|
||||
* Check if current Tx interrupt enable is reset,
|
||||
* that means the Tx interrupt must be re-enabled
|
||||
* due to call IntTransmit() function to trigger
|
||||
* this interrupt type
|
||||
*/
|
||||
if(Uartn_RS485_TxIntEnable == RESET)
|
||||
{
|
||||
Uart1_RS485_Init_TransmitSet();
|
||||
}
|
||||
/*
|
||||
* Otherwise, re-enables Tx Interrupt
|
||||
*/
|
||||
else
|
||||
{
|
||||
HAL_UART_ConfigInterrupt((UARTn_Type*)UARTn_PERIPHERAL, UARTn_INTCFG_THRE, ENABLE );
|
||||
}
|
||||
#else
|
||||
RingBuffer_Enqueue(&RingBuffer_RS485_Tx, TxData);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Uart1_RS485_TransmitData(uint8_t* pTxData, uint32_t TxLen)
|
||||
{
|
||||
uint32_t i;
|
||||
#if defined(UARTn_RS485_TX_INTERRUTP_ENABLE)
|
||||
HAL_UART_ConfigInterrupt( ( UARTn_Type* )UARTn_RS485_PERIPHERAL, UARTn_INTCFG_THRE, DISABLE );
|
||||
|
||||
for(i = 0 ; i < TxLen ; i++)
|
||||
RingBuffer_Enqueue(&RingBuffer_Tx, pTxData[i]);
|
||||
|
||||
if(Uartn_RS485_TxIntEnable == RESET)
|
||||
{
|
||||
Uart1_RS485_Init_TransmitSet();
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_UART_ConfigInterrupt( ( UARTn_Type* )UARTn_PERIPHERAL, UARTn_INTCFG_THRE, ENABLE );
|
||||
}
|
||||
#else
|
||||
for(i = 0 ; i < TxLen ; i++)
|
||||
RingBuffer_Enqueue(&RingBuffer_RS485_Tx, pTxData[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if defined(UARTn_RS485_TX_INTERRUTP_ENABLE)
|
||||
static void Uart1_RS485_Init_TransmitSet(void)
|
||||
{
|
||||
// Disable THRE interrupt
|
||||
HAL_UART_ConfigInterrupt( ( UARTn_Type* )UARTn_RS485_PERIPHERAL, UARTn_INTCFG_THRE, DISABLE );
|
||||
|
||||
/* Wait until THR empty */
|
||||
while( HAL_UART_CheckBusy( ( UARTn_Type* )UARTn_RS485_PERIPHERAL ) == SET );
|
||||
|
||||
while(RingBuffer_Get_DataSize(&RingBuffer_Tx) != 0)
|
||||
{
|
||||
uint8_t TxData;
|
||||
RingBuffer_GetData(&RingBuffer_RS485_Tx, &TxData);
|
||||
|
||||
if(HAL_UART_Transmit( ( UARTn_Type* )UARTn_RS485_PERIPHERAL, &TxData, 1, NONE_BLOCKING ) )
|
||||
{
|
||||
/* Update transmit ring FIFO tail pointer */
|
||||
RingBuffer_PopData(&RingBuffer_RS485_Tx);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If there is no more data to send, disable the transmit interrupt - else enable it or keep it enabled */
|
||||
if(RingBuffer_Get_DataSize(&RingBuffer_RS485_Tx) == 0)
|
||||
{
|
||||
HAL_UART_ConfigInterrupt((RingBuffer_RS485_Tx*)UARTn_RS485_PERIPHERAL, UARTn_INTCFG_THRE, DISABLE );
|
||||
// Reset Tx Interrupt state
|
||||
Uartn_TxIntEnable = RESET;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set Tx Interrupt state
|
||||
Uartn_TxIntEnable = SET;
|
||||
HAL_UART_ConfigInterrupt((UARTn_Type*)UARTn_RS485_PERIPHERAL, UARTn_INTCFG_THRE, ENABLE );
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void Uart1_RS485_Transmit_Process(void)
|
||||
{
|
||||
if(RingBuffer_Get_DataSize(&RingBuffer_RS485_Tx) != 0)
|
||||
{
|
||||
uint8_t TxData;
|
||||
UARTn_RS485_TRANSMIT;
|
||||
GPIO_UART_RS485_TX_LED_ON;
|
||||
|
||||
RingBuffer_GetData(&RingBuffer_RS485_Tx, &TxData);
|
||||
|
||||
if(HAL_UART_Transmit((UARTn_Type*)UARTn_RS485_PERIPHERAL, &TxData, 1, NONE_BLOCKING))
|
||||
{
|
||||
/* Update transmit ring FIFO tail pointer */
|
||||
RingBuffer_PopData(&RingBuffer_RS485_Tx);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(HAL_UART_CheckBusy((UARTn_Type *)UARTn_RS485_PERIPHERAL) == RESET)
|
||||
{
|
||||
UARTn_RS485_RECEIVE;
|
||||
GPIO_UART_RS485_TX_LED_OFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void Uart1_RS485_Receive_Handler(void)
|
||||
{
|
||||
uint8_t tmpc;
|
||||
uint32_t rLen;
|
||||
|
||||
while(1)
|
||||
{
|
||||
rLen = HAL_UART_Receive((UARTn_Type*)UARTn_RS485_PERIPHERAL, &tmpc, 1, NONE_BLOCKING );
|
||||
if (rLen)
|
||||
{
|
||||
RingBuffer_Enqueue(&RingBuffer_RS485_Rx, tmpc);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
* @brief UART1 interrupt handler sub-routine
|
||||
* @param[in] None
|
||||
* @return None
|
||||
**********************************************************************/
|
||||
void UART1_Handler(void)
|
||||
{
|
||||
uint32_t intsrc, tmp;
|
||||
|
||||
/* Determine the interrupt source */
|
||||
intsrc = UARTn_RS485_PERIPHERAL->IIR;
|
||||
tmp = intsrc & UARTn_IIR_INTID_MASK;
|
||||
|
||||
|
||||
// Receiver Line Status
|
||||
if(tmp == UARTn_IIR_INTID_RLS) // error(Overrun, Parity, Framing or Break Error)
|
||||
{
|
||||
}
|
||||
else if(tmp == UARTn_IIR_INTID_RDA) // Receiver Data Available
|
||||
{
|
||||
Uart1_RS485_Receive_Handler();
|
||||
}
|
||||
else if(tmp == UARTn_IIR_INTID_THRE) // Transmitter Holding Register Empty
|
||||
{
|
||||
#if defined(UARTn_RS485_TX_INTERRUTP_ENABLE)
|
||||
Uart1_RS485_Init_TransmitSet();
|
||||
#endif
|
||||
}
|
||||
else if(tmp == UARTn_IIR_INTID_TXE) // Transmitter Register Empty
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Uart1_RS485_Push_Data(uint8_t RxData)
|
||||
{
|
||||
RingBuffer_Enqueue(&RingBuffer_RS485_Rx, RxData);
|
||||
}
|
||||
|
||||
uint32_t Uart1_RS485_Get_RecvDataCount(void)
|
||||
{
|
||||
return RingBuffer_Get_DataSize(&RingBuffer_RS485_Rx);
|
||||
}
|
||||
|
||||
uint8_t Uart1_RS485_Get_RecvData(void)
|
||||
{
|
||||
uint8_t retData;
|
||||
RingBuffer_Dequeue(&RingBuffer_RS485_Rx, &retData);
|
||||
return retData;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/** \file uart1_rs485.h */
|
||||
#if !defined(UART1_RS485_H__43E41896_F8DF_4ED4_B934_92ED846B67D5__INCLUDED_)
|
||||
#define UART1_RS485_H__43E41896_F8DF_4ED4_B934_92ED846B67D5__INCLUDED_
|
||||
|
||||
#include "define.h"
|
||||
|
||||
void Uart1_RS485_Initialization(uint32_t Baudrate, UARTn_DATA_BIT_Type Databit, UARTn_PARITY_BIT_Type Paritybit, UARTn_STOP_BIT_Type Stopbit);
|
||||
void Uart1_RS485_Transmit(uint8_t TxData);
|
||||
void Uart1_RS485_TransmitData(uint8_t* pTxData, uint32_t TxLen);
|
||||
uint32_t Uart1_RS485_Get_RecvDataCount(void);
|
||||
uint8_t Uart1_RS485_Get_RecvData(void);
|
||||
void Uart1_RS485_Push_Data(uint8_t RxData);
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue