fix(el18): Audio output should be OFF if no audio playing (#3670)

* Added audio on/off depends whether audio content is present.

* Aligned the mute control with the implementation in the DAC driver.

* Mute Pin should be inverted.

* Removed PCB specific dependencies.

* chore: Formatting and cleanup
This commit is contained in:
richardclli
2023-06-15 10:07:30 +10:00
committed by GitHub
parent 285de8a08e
commit 5288441a82
4 changed files with 74 additions and 28 deletions
+5 -2
View File
@@ -322,8 +322,6 @@
// Audio
#define AUDIO_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOH)
#define AUDIO_RCC_APB2Periph RCC_APB2Periph_SPI1
#define AUDIO_SHUTDOWN_GPIO GPIOH
#define AUDIO_SHUTDOWN_GPIO_PIN GPIO_Pin_8 // PH.08 audio amp control pin
#define AUDIO_XDCS_GPIO GPIOH
#define AUDIO_XDCS_GPIO_PIN GPIO_Pin_14 // PH.14
#define AUDIO_CS_GPIO GPIOH
@@ -343,6 +341,11 @@
#define AUDIO_SPI_MOSI_GPIO GPIOB
#define AUDIO_SPI_MOSI_GPIO_PIN GPIO_Pin_5 // PB.05
#define AUDIO_SPI_MOSI_GPIO_PinSource GPIO_PinSource5
#define AUDIO_MUTE_GPIO GPIOH
#define AUDIO_MUTE_GPIO_PIN GPIO_Pin_8 // PH.08 audio amp control pin
#define AUDIO_UNMUTE_DELAY 120 // ms
#define AUDIO_MUTE_DELAY 500 // ms
#define INVERTED_MUTE_PIN
// I2C Bus
#define I2C_B1 I2C1