generated from hulk/gd32e23x_template_cmake_vscode
feature(rs485):添加RS485驱动支持
This commit is contained in:
@@ -51,6 +51,8 @@
|
||||
#define RTT_PutChar(ch, c)
|
||||
#endif
|
||||
|
||||
#define RS485_MODE CFG_ENABLE // CFG_DISABLE: RS485 off; CFG_ENABLE: RS485 on
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/* Dynamic USART Configuration Structure */
|
||||
@@ -129,6 +131,12 @@ typedef enum {
|
||||
#define UART_RX_PIN GPIO_PIN_3
|
||||
#define UART_BAUDRATE 115200U
|
||||
|
||||
#if RS485_MODE == CFG_ENABLE
|
||||
#define RS485_DE_RCU RCU_GPIOA
|
||||
#define RS485_DE_PORT GPIOA
|
||||
#define RS485_DE_PIN GPIO_PIN_1
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define DEBUG_UART USART0
|
||||
|
||||
Reference in New Issue
Block a user