summaryrefslogtreecommitdiff
path: root/src/drivers/include
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-02-14 14:30:53 +1100
committerjacqueline <me@jacqueline.id.au>2023-02-14 14:30:53 +1100
commita65d996583c72e0d77805bcbc36da580aacb2848 (patch)
treeee64bb43ff2f44f495942e50e77176476b71f7b5 /src/drivers/include
parentfa1f1cd9aba914882b95e93cdf64ad01309aa633 (diff)
downloadtangara-fw-a65d996583c72e0d77805bcbc36da580aacb2848.tar.gz
Use the sync apis for I2S output
Diffstat (limited to 'src/drivers/include')
-rw-r--r--src/drivers/include/dac.hpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/drivers/include/dac.hpp b/src/drivers/include/dac.hpp
index 698019b7..e682d8d7 100644
--- a/src/drivers/include/dac.hpp
+++ b/src/drivers/include/dac.hpp
@@ -10,6 +10,7 @@
#include "driver/i2s_std.h"
#include "driver/i2s_types.h"
#include "esp_err.h"
+#include "freertos/FreeRTOS.h"
#include "freertos/portmacro.h"
#include "result.hpp"
#include "span.hpp"
@@ -67,10 +68,9 @@ class AudioDac {
};
// TODO(jacqueline): worth supporting channels here as well?
- auto Reconfigure(BitsPerSample bps, SampleRate rate, QueueHandle_t dma_queue)
- -> std::size_t;
+ auto Reconfigure(BitsPerSample bps, SampleRate rate) -> void;
- auto WriteDataFromISR(std::byte* data, std::size_t size) -> bool;
+ auto WriteData(cpp::span<std::byte> data) -> std::size_t;
// Not copyable or movable.
AudioDac(const AudioDac&) = delete;
@@ -83,9 +83,6 @@ 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.