generated from hulk/gd32e23x_template
有问题版本,暂存
This commit is contained in:
@@ -9,6 +9,24 @@
|
||||
|
||||
// #define DEBUG_VERBOES
|
||||
|
||||
#define POWER_SUPPLY_12V
|
||||
// #define POWER_SUPPLY_24V
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#ifdef POWER_SUPPLY_12V
|
||||
#define POWER_VOLTAGE "12V"
|
||||
#define TIME_CORRECTION_US 250
|
||||
#define CAPTURE_VALUE_MAX 515
|
||||
#elif defined(POWER_SUPPLY_24V)
|
||||
#define POWER_VOLTAGE "24V"
|
||||
#define TIME_CORRECTION_US 230
|
||||
#define CAPTURE_VALUE_MAX 550
|
||||
#else
|
||||
#error "Please define either POWER_SUPPLY_12V or POWER_SUPPLY_24V"
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define I2C_GPIO_RCU RCU_GPIOF
|
||||
@@ -38,9 +56,41 @@
|
||||
#define LED_PORT GPIOA
|
||||
#define LED_PIN GPIO_PIN_9
|
||||
#define LED_RCU RCU_GPIOA
|
||||
#define LED_BLINK_TIMER_RCU RCU_TIMER16
|
||||
#define LED_BLINK_TIMER TIMER16
|
||||
#define LED_BLINK_IRQ TIMER16_IRQn
|
||||
#define LED_BLINK_TIMER_RCU RCU_TIMER5
|
||||
#define LED_BLINK_TIMER TIMER5
|
||||
#define LED_BLINK_IRQ TIMER5_IRQn
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
#define US_TX_GPIO_RCU RCU_GPIOB
|
||||
#define US_TX_GPIO_PORT GPIOB
|
||||
#define US_TX_PIN GPIO_PIN_1
|
||||
#define US_TX_GPIO_AF GPIO_AF_0
|
||||
#define US_TX_RCU RCU_TIMER13
|
||||
#define US_TX_TIMER TIMER13
|
||||
#define US_TX_CH TIMER_CH_0
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define US_TX_DELAY_RCU RCU_TIMER15
|
||||
#define US_TX_DELAY_TIMER TIMER15
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define US_RX_GPIO_RCU RCU_GPIOA
|
||||
#define US_RX_EXTI_RCU RCU_CFGCMP
|
||||
#define US_RX_GPIO_PORT GPIOA
|
||||
#define US_RX_GPIO_PIN GPIO_PIN_0
|
||||
#define US_RX_EXTI_IRQ EXTI0_1_IRQn
|
||||
#define US_RX_GPIO_EXTI EXTI_0
|
||||
#define US_RX_EXTI_LINE EXTI_SOURCE_PIN0
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define US_ECHO_RCU RCU_TIMER16
|
||||
#define US_ECHO_TIMER TIMER16
|
||||
#define US_ECHO_CH TIMER_CH_0
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user