26 lines
933 B
C
26 lines
933 B
C
#ifndef _HART_H_
|
||
#define _HART_H_
|
||
#include "usart.h"
|
||
#include "data_type_def.h"
|
||
|
||
#define RTS_ON GPIO_PIN_RESET
|
||
#define RTS_OFF GPIO_PIN_SET
|
||
|
||
#define HART_24V_ENABLE HAL_GPIO_WritePin(RS_EN_GPIO_Port, RS_EN_Pin, GPIO_PIN_RESET)
|
||
#define HART_24V_DISABLE HAL_GPIO_WritePin(RS_EN_GPIO_Port, RS_EN_Pin, GPIO_PIN_SET)
|
||
|
||
#define HART_250OHM_ENABLE HAL_GPIO_WritePin(RP_EN_GPIO_Port, RP_EN_Pin, GPIO_PIN_RESET)
|
||
#define HART_250OHM_DISABLE HAL_GPIO_WritePin(RP_EN_GPIO_Port, RP_EN_Pin, GPIO_PIN_SET)
|
||
|
||
#define HART_VOUT_ENABLE HAL_GPIO_WritePin(Vout_EN_GPIO_Port, Vout_EN_Pin, GPIO_PIN_SET)
|
||
#define HART_VOUT_DISABLE HAL_GPIO_WritePin(Vout_EN_GPIO_Port, Vout_EN_Pin, GPIO_PIN_RESET)
|
||
|
||
void hart_send(UART_HandleTypeDef *huart, uint8_t *data);
|
||
void hart_communicate(st_scom *scom);
|
||
|
||
//DEVICE <---SIG---> PC
|
||
//将来自设备的HART数据装载至com485_tx,将comhart_tx的HART数据发送至设备
|
||
void transparent_hart(st_scom *scom);
|
||
|
||
#endif
|