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:
@@ -9,23 +9,13 @@ extern volatile bool g_ultrasonic_measure_done;
|
||||
/**************************************************************************************************/
|
||||
|
||||
#define ULTRASONIC_TX_CYCLES 5U /* 发送5个PWM周期驱动换能器 */
|
||||
#define ULTRASONIC_TX_TIME 498U // ms
|
||||
#define ULTRASONIC_MAX_TOF_RELOAD 1000U //us
|
||||
#define ULTRASONIC_TX_RINGDOWN_RELOAD 240U // 240us
|
||||
#define ULTRASONIC_MAX_TOF_RELOAD 1000U // 1000us
|
||||
|
||||
/**************************************************************************************************/
|
||||
|
||||
void ultrasonic_tx_init(void);
|
||||
|
||||
void ultrasonic_pwm_out_cycles(void);
|
||||
|
||||
// void ultrasonic_transmit_delay(const uint16_t micro_second);
|
||||
|
||||
// void ultrasonic_rece_exti_config(void);
|
||||
|
||||
void ultrasonic_echo_timer_config(void);
|
||||
|
||||
void ultrasonic_config(void);
|
||||
|
||||
// uint16_t ultrasonic_calc_distance(void);
|
||||
|
||||
#endif // UART_H
|
||||
#endif // ULTRASONIC_ANALOG_H
|
||||
|
Reference in New Issue
Block a user