From 61c91b3cdb2c9dd655f3adf0f461f5cefb3b2e9b Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 10 Feb 2023 15:32:21 +1100 Subject: Mostly working pipeline, including proper EOF signalling --- src/drivers/include/dac.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/drivers/include/dac.hpp') diff --git a/src/drivers/include/dac.hpp b/src/drivers/include/dac.hpp index aec89c72..698019b7 100644 --- a/src/drivers/include/dac.hpp +++ b/src/drivers/include/dac.hpp @@ -4,6 +4,7 @@ #include #include +#include #include #include "driver/i2s_std.h" @@ -66,11 +67,11 @@ class AudioDac { }; // TODO(jacqueline): worth supporting channels here as well? - auto Reconfigure(BitsPerSample bps, SampleRate rate) -> bool; - - auto WriteData(const cpp::span& data, TickType_t max_wait) + auto Reconfigure(BitsPerSample bps, SampleRate rate, QueueHandle_t dma_queue) -> std::size_t; + auto WriteDataFromISR(std::byte* data, std::size_t size) -> bool; + // Not copyable or movable. AudioDac(const AudioDac&) = delete; AudioDac& operator=(const AudioDac&) = delete; @@ -82,6 +83,9 @@ class AudioDac { i2s_std_clk_config_t clock_config_; i2s_std_slot_config_t slot_config_; + // TODO: volatile? + volatile QueueHandle_t dma_queue_; + /* * Pools the power state for up to 10ms, waiting for the given predicate to * be true. -- cgit v1.2.3