36 lines
823 B
C
36 lines
823 B
C
/*
|
||
* 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_ */
|