You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
incubator_embeded/HARDWARE/rs485.h

35 lines
975 B

#ifndef _rs485_H
#define _rs485_H
#include "stm32f10x.h" // Device header
extern u8 RS485_RX_BUF[128]; //接收缓冲,最大64个字节
extern u8 RS485_RX_CNT; //接收到的数据长度
extern u8 RS485_RX_Flag_Num;
extern u8 RS485_RX_Flag;
//模式控制
#define RS485_1_TX_EN PBout(11) //485模式控制.0,接收;1,发送.
#define RS485_2_TX_EN PBout(10) //485模式控制.0,接收;1,发送.
#define RS485_3_TX_EN PBout(4) //485模式控制.0,接收;1,发送.
void RS485_1_Init(u32 bound);
void RS485_2_Init(u32 bound);
void RS485_3_Init(u32 bound);
void RS485_1_Send_Data(u8 *buf,u8 len);
void RS485_1_Send_Data_1(u8 *buf,u8 len);
//void RS485_3_Send_Data_1(void);
void RS485_1_Send_Data_2(void);
void RS485_1_Send_Data_3(void);
//void RS485_3_Send_Data(u8 *buf,u8 len);
void RS485_Receive_Data(u8 *buf,u8 *len);
void SN74CB3Q3253_Init(void);
u8 CRC16_check(u8 *puchMsg, u16 usDataLen);
void GetCRC16(u8 *puchMsg, u16 usDataLen,u8 *uchCRCHi,u8 *uchCRCLo) ;
#endif