diff options
Diffstat (limited to 'src/drivers/include/dac.hpp')
| -rw-r--r-- | src/drivers/include/dac.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
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 <functional> #include <memory> +#include <optional> #include <utility> #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<std::byte>& 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. |
