sggt/App/MODBUS/Inc/modbus_485.h

47 lines
1.2 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __MODBUS_485_H
#define __MODBUS_485_H
#include "apps_gather.h"
#define TRANSPARENT_WAIT 0
#define TRANSPARENT_RECIEVE_START 1
#define TRANSPARENT_RECIEVE_FINISHED 2
#define TRANSPARENT_TRANSMIT_END 3
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);
uint8_t trans_enable_check(st_scom *scom);
#endif