/* * rs485.h * * Created on: 2024年6月20日 * Author: psx */ #ifndef HARDWARE_INC_RS485_H_ #define HARDWARE_INC_RS485_H_ #include "ch32l103.h" #define BAT_485 USART3 #define GW_485 USART4 /* 485读写控制引脚 */ #define Pin_GW_485_RDE GPIO_Pin_4 #define GPIO_GW_485_RDE GPIOB #define Pin_BAT_485_RDE GPIO_Pin_5 #define GPIO_BAT_485_RDE GPIOB #define write Bit_SET #define read Bit_RESET void GW_485_Init(int baud); void BAT_485_Init(int baud); void USARTx_SendByte(USART_TypeDef* pUSARTx, uint8_t data); //void USARTx_SendStr(USART_TypeDef* pUSARTx, char *str); //void USARTx_SendStr_Len(USART_TypeDef* pUSARTx, char *str, int len); void USARTx_ITSendstr(USART_TypeDef* pUSARTx, char *str, int len); //extern uint8_t USART_Rbuffer[100]; //extern uint8_t USART_RbufferLen; #endif /* HARDWARE_INC_RS485_H_ */