From 8ed3d7e31f8b16a24593c01a480b19b14a513b48 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Sat, 21 Jan 2023 19:01:54 +1100 Subject: Re-enable the parts of the audio pipeline that are working --- src/drivers/include/dac.hpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/drivers/include/dac.hpp') diff --git a/src/drivers/include/dac.hpp b/src/drivers/include/dac.hpp index 2d4e812f..8c49ce17 100644 --- a/src/drivers/include/dac.hpp +++ b/src/drivers/include/dac.hpp @@ -3,13 +3,15 @@ #include #include +#include +#include +#include "driver/i2s_types.h" #include "esp_err.h" #include "freertos/portmacro.h" -#include "hal/i2s_types.h" #include "result.hpp" #include "span.hpp" -#include "driver/i2s_types_legacy.h" +#include "driver/i2s_std.h" #include "gpio_expander.hpp" @@ -29,7 +31,7 @@ class AudioDac { static auto create(GpioExpander* expander) -> cpp::result, Error>; - AudioDac(GpioExpander* gpio); + AudioDac(GpioExpander* gpio, i2s_chan_handle_t i2s_handle); ~AudioDac(); /** @@ -54,9 +56,9 @@ class AudioDac { std::pair ReadPowerState(); enum BitsPerSample { - BPS_16 = I2S_BITS_PER_SAMPLE_16BIT, - BPS_24 = I2S_BITS_PER_SAMPLE_24BIT, - BPS_32 = I2S_BITS_PER_SAMPLE_32BIT + BPS_16 = I2S_DATA_BIT_WIDTH_16BIT, + BPS_24 = I2S_DATA_BIT_WIDTH_24BIT, + BPS_32 = I2S_DATA_BIT_WIDTH_32BIT, }; enum SampleRate { SAMPLE_RATE_44_1 = 44100, @@ -75,6 +77,10 @@ class AudioDac { private: GpioExpander* gpio_; + i2s_chan_handle_t i2s_handle_; + + i2s_std_clk_config_t clock_config_; + i2s_std_slot_config_t slot_config_; /* * Pools the power state for up to 10ms, waiting for the given predicate to -- cgit v1.2.3