mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 18:06:39 +08:00
AirBrainH743: configure for active buzzer
We can't use passive buzzers because the timer to drive the PWM would conflict with the motor outputs M7 and M8.
This commit is contained in:
@@ -112,9 +112,16 @@
|
|||||||
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
|
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
|
||||||
|
|
||||||
|
|
||||||
/* Tone alarm output - PA15 */
|
/* Tone alarm output (directly connected to transistor switch of external buzzer)
|
||||||
|
*
|
||||||
|
* GPIO mode only (active buzzer) - passive buzzer with different tones is not
|
||||||
|
* supported because PA15 can only use TIM2, which is also used for motor outputs
|
||||||
|
* M7 (PB10, TIM2_CH3) and M8 (PB11, TIM2_CH4). The PWM tone alarm driver changes
|
||||||
|
* the timer's prescaler and auto-reload registers (shared across all channels),
|
||||||
|
* which would affect M7/M8 PWM frequency during tone playback.
|
||||||
|
*/
|
||||||
#define GPIO_TONE_ALARM_IDLE /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15)
|
#define GPIO_TONE_ALARM_IDLE /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15)
|
||||||
#define GPIO_TONE_ALARM_GPIO /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15)
|
#define GPIO_TONE_ALARM_GPIO /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN15)
|
||||||
|
|
||||||
|
|
||||||
/* ICM42688P FSYNC - directly connected to IMU via GPIO (no timer).
|
/* ICM42688P FSYNC - directly connected to IMU via GPIO (no timer).
|
||||||
|
|||||||
@@ -45,6 +45,10 @@
|
|||||||
* M7: PB10 (TIM2_CH3)
|
* M7: PB10 (TIM2_CH3)
|
||||||
* M8: PB11 (TIM2_CH4)
|
* M8: PB11 (TIM2_CH4)
|
||||||
* M9: PA2 (TIM5_CH3) - LED strip
|
* M9: PA2 (TIM5_CH3) - LED strip
|
||||||
|
*
|
||||||
|
* Note: TIM2 is shared with buzzer pin PA15 (TIM2_CH1). The buzzer is disabled
|
||||||
|
* by default because the tone alarm driver would change the timer prescaler/ARR
|
||||||
|
* which affects M7/M8 PWM frequency. See board_config.h for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
|
constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user