|
TB2026-YDS Firmware
|
#include "audio_sink.h"#include "audio_dac.h"#include "sink_i2s_dac.h"#include "gpio_expander.h"#include "board_pins.h"#include "i2s_bus.h"#include "freertos/FreeRTOS.h"#include "freertos/task.h"#include "esp_log.h"Functions | |
| esp_err_t | sink_i2s_dac_output_enable (bool enable) |
| Enable or mute the DAC analog output via the PCM5242 XSMT pin. | |
| esp_err_t | sink_i2s_dac_amp_enable (bool enable) |
| Enable or shut down the MAX97220 headphone amplifier via its SHDN pin. | |
| esp_err_t | sink_i2s_dac_init (void) |
| Bring up the wired path's I2S bus; the sink owns the channel handle. | |
| const audio_sink_t * | sink_i2s_dac_get (void) |
| Get the wired-DAC sink (I2S → PCM5242 → MAX97220 → jack). | |
| esp_err_t sink_i2s_dac_amp_enable | ( | bool | enable | ) |
Enable or shut down the MAX97220 headphone amplifier via its SHDN pin.
SHDN is expander IO1, active-low. Requires gpio_expander_init() to have run first.
| enable | true = drive SHDN high (amp on), false = SHDN low (shutdown). |
| const audio_sink_t * sink_i2s_dac_get | ( | void | ) |
Get the wired-DAC sink (I2S → PCM5242 → MAX97220 → jack).
| esp_err_t sink_i2s_dac_init | ( | void | ) |
Bring up the wired path's I2S bus; the sink owns the channel handle.
Mounts I2S0 (BCK/WS/DOUT, no MCLK) and keeps the TX handle inside the sink, so upper layers never touch it. Call once at startup. The PCM5242 I2C control port and the expander mute/amp lines are initialised by their own drivers (audio_dac_init, gpio_expander_init), not here.
| esp_err_t sink_i2s_dac_output_enable | ( | bool | enable | ) |
Enable or mute the DAC analog output via the PCM5242 XSMT pin.
XSMT is expander IO0, active-low. Requires gpio_expander_init() to have run first.
| enable | true = drive XSMT high (output on), false = XSMT low (muted). |