mppt/Hardware/inc/rs485.h

36 lines
823 B
C
Raw Permalink Normal View History

2024-07-11 06:58:55 +00:00
/*
* rs485.h
*
* Created on: 2024<EFBFBD><EFBFBD>6<EFBFBD><EFBFBD>20<EFBFBD><EFBFBD>
* Author: psx
*/
#ifndef HARDWARE_INC_RS485_H_
#define HARDWARE_INC_RS485_H_
#include "ch32l103.h"
#define BAT_485 USART3
#define GW_485 USART4
/* 485<38><35>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
#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);
2024-11-13 08:44:13 +00:00
//extern uint8_t USART_Rbuffer[100];
//extern uint8_t USART_RbufferLen;
2024-07-11 06:58:55 +00:00
#endif /* HARDWARE_INC_RS485_H_ */