mppt/App/inc/uart_send.h

62 lines
2.5 KiB
C
Raw Normal View History

2024-11-20 06:12:33 +00:00
/*
* uart_send.h
*
* Created on: 2024<EFBFBD><EFBFBD>11<EFBFBD><EFBFBD>19<EFBFBD><EFBFBD>
* Author: psx
*/
#ifndef APP_INC_UART_SEND_H_
#define APP_INC_UART_SEND_H_
#include "uart_dev.h"
#define RS485_MAX_PACK_DATA_LEN 60
/* ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD>ʽΪ1<CEAA>ֽ<EFBFBD> */
#pragma pack(push,1)
typedef struct _send_data_info{
device_handle device;
uint8_t dataState; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>״̬<D7B4><CCAC>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t dataLen; //<2F><><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
uint8_t Counter; //<2F>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>͵ij<CDB5><C4B3><EFBFBD>
uint8_t *data; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD>
}send_data_info;
typedef struct _uart_send_info {
uint8_t insertState; //<2F>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD>
uint8_t sendStateGw:1; //<2F>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>1<EFBFBD><31><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>ͣ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>
uint8_t sendStateBat:1; //<2F>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>ָʾ
uint8_t sendOverStateGw:1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
uint8_t sendOverStateBat:1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָʾ
uint8_t GwState:1; //<2F><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>485<38><35><EFBFBD>߿<EFBFBD><DFBF><EFBFBD>״̬<D7B4><CCAC>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>æ
uint8_t idleStateGw:1; //<2F><><EFBFBD><EFBFBD>ͨ<EFBFBD>ſ<EFBFBD><C5BF><EFBFBD>״̬<D7B4><CCAC>1<EFBFBD><31>û<EFBFBD><C3BB><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD>
uint8_t BatState:1; //<2F><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>485<38><35><EFBFBD>߿<EFBFBD><DFBF><EFBFBD>״̬
uint8_t idleStateBat:1; //<2F><><EFBFBD><EFBFBD>ͨ<EFBFBD>ſ<EFBFBD><C5BF><EFBFBD>״̬
// uint8_t sendStateGw; //<2F>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>1<EFBFBD><31><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>ͣ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>
// uint8_t sendStateBat; //<2F>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>ָʾ
// uint8_t sendOverStateGw; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// uint8_t sendOverStateBat; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָʾ
// uint8_t GwState; //<2F><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>485<38><35><EFBFBD>߿<EFBFBD><DFBF><EFBFBD>״̬<D7B4><CCAC>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>æ
// uint8_t idleStateGw; //<2F><><EFBFBD><EFBFBD>ͨ<EFBFBD>ſ<EFBFBD><C5BF><EFBFBD>״̬<D7B4><CCAC>1<EFBFBD><31>û<EFBFBD><C3BB><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD>
// uint8_t BatState; //<2F><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>485<38><35><EFBFBD>߿<EFBFBD><DFBF><EFBFBD>״̬
// uint8_t idleStateBat; //<2F><><EFBFBD><EFBFBD>ͨ<EFBFBD>ſ<EFBFBD><C5BF><EFBFBD>״̬
send_data_info *insertData; //ͨ<><CDA8><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
send_data_info *sendDataGw; //ͨ<><CDA8><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EBB7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
send_data_info *sendDataBat; //ͨ<><CDA8><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EBB7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
send_data_info data1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĵ<DDB5>1<EFBFBD><31>λ<EFBFBD><CEBB>
send_data_info data2; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĵ<DDB5>2<EFBFBD><32>λ<EFBFBD><CEBB>
send_data_info data3; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĵ<DDB5>3<EFBFBD><33>λ<EFBFBD><CEBB>
}uart_send_info;
/* <20>ָ<EFBFBD>Ĭ<EFBFBD>ϵĶ<CFB5><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#pragma pack(pop)
extern uart_send_info uart_send;
void send_init(void);
void check_sendState(void);
void uart_interruptSend(device_handle device, uint8_t buff[], uint8_t len);
void uartDMA_Init(device_handle device, uint8_t buff[], uint8_t len);
#endif /* APP_INC_UART_SEND_H_ */