generated from hulk/gd32e23x_template_cmake_vscode
Simplify the use of timers, timer13 sends ultrasonic waves, timer16 counts (debounce time and flight time)
The ultrasonic transducer is driven only after each command is issued.
This commit is contained in:
@@ -36,15 +36,15 @@
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define RS485_RCU RCU_USART1
|
||||
#define RS485_RCU RCU_USART0
|
||||
#define RS485_GPIO_RCU RCU_GPIOA
|
||||
#define RS485_GPIO_PORT GPIOA
|
||||
#define RS485_TX_PIN GPIO_PIN_2
|
||||
#define RS485_RX_PIN GPIO_PIN_3
|
||||
#define RS485_PHY USART1
|
||||
#define RS485_PHY USART0
|
||||
#define RS485_BAUDRATE 115200U
|
||||
#define RS485_EN_PIN GPIO_PIN_1
|
||||
#define RS485_IRQ USART1_IRQn
|
||||
#define RS485_IRQ USART0_IRQn
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
@@ -58,6 +58,11 @@
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define US_TX_DELAY_RCU RCU_TIMER15
|
||||
#define US_TX_DELAY_TIMER TIMER15
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define US_RX_GPIO_RCU RCU_GPIOB
|
||||
#define US_RX_EXTI_RCU RCU_CFGCMP
|
||||
#define US_RX_GPIO_PORT GPIOA
|
||||
@@ -68,6 +73,7 @@
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
// 修改为TIMER15相关定义
|
||||
#define US_ECHO_RCU RCU_TIMER16
|
||||
#define US_ECHO_TIMER TIMER16
|
||||
#define US_ECHO_CH TIMER_CH_0
|
||||
@@ -75,9 +81,4 @@
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define TIME_CORRECTION_US 230U
|
||||
#define CAPTURE_VALUE_MAX 550U
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#endif //BOARD_CONFIG_H
|
||||
|
Reference in New Issue
Block a user