40 lines
1.0 KiB
C
40 lines
1.0 KiB
C
#ifndef __MODBUS_485_H
|
||
#define __MODBUS_485_H
|
||
|
||
#include "apps_gather.h"
|
||
|
||
extern uint32_t tick_start;
|
||
extern uint32_t tick_middle;
|
||
extern uint32_t tick_end;
|
||
extern uint32_t trans_log_rx;
|
||
extern uint32_t trans_log_tx;
|
||
extern uint8_t st_flag;
|
||
|
||
void parse_scom_485(st_scom *scom);
|
||
|
||
//PC <---SIG---> HART/BLUETOOTH/MODBUS
|
||
//BLE:将接收完成的BLE数据发送至上位机,将来自上位机的BLE数据装载至comhart_tx
|
||
//HART:将接收完成的HART的数据发送至上位机,将来自上位机的HART数据装载至comhart_tx
|
||
void transparent_485(st_scom *scom);
|
||
|
||
//透传,DMA发送,与发送回调组合使用
|
||
void transparent_tim(void);
|
||
|
||
void trans_hart2pc(void);
|
||
|
||
void trans_pc2hart(void);
|
||
|
||
void trans_ble2pc(void);
|
||
|
||
void trans_pc2ble(void);
|
||
|
||
void trans_modbus_pc2sig(void);
|
||
|
||
void trans_modbus_sig2slave(void);
|
||
|
||
//DMA接收只有半满中断、空闲中断和完成(溢出)中断,因此用以下函数尝试进行捕获
|
||
//该函数放置于TIM2的中断内,1ms为周期,尝试捕获前3帧
|
||
void trans_start_capture(void);
|
||
|
||
#endif
|