diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-02-21 09:28:36 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-02-21 09:28:36 +1100 |
| commit | 12d2ffdab70df573610b81d8a24545da33bb67e3 (patch) | |
| tree | eb082a249eab8647c8450dbbd5c320f83b923d6b /src/drivers/include | |
| parent | 644601b636c28cf82281148a392454cdf9e632f9 (diff) | |
| download | tangara-fw-12d2ffdab70df573610b81d8a24545da33bb67e3.tar.gz | |
Add logging to the DAC
Diffstat (limited to 'src/drivers/include')
| -rw-r--r-- | src/drivers/include/dac.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/drivers/include/dac.hpp b/src/drivers/include/dac.hpp index e682d8d7..06808a78 100644 --- a/src/drivers/include/dac.hpp +++ b/src/drivers/include/dac.hpp @@ -16,6 +16,7 @@ #include "span.hpp" #include "gpio_expander.hpp" +#include "sys/_stdint.h" namespace drivers { @@ -72,6 +73,9 @@ class AudioDac { auto WriteData(cpp::span<std::byte> data) -> std::size_t; + auto Stop() -> void; + auto LogStatus() -> void; + // Not copyable or movable. AudioDac(const AudioDac&) = delete; AudioDac& operator=(const AudioDac&) = delete; @@ -91,13 +95,27 @@ class AudioDac { enum Register { PAGE_SELECT = 0, + RESET = 1, + POWER_MODE = 2, DE_EMPHASIS = 7, + DAC_CLOCK_SOURCE = 14, + CLOCK_ERRORS = 37, + I2S_FORMAT = 40, DIGITAL_VOLUME_L = 61, DIGITAL_VOLUME_R = 62, + + SAMPLE_RATE_DETECTION = 91, + BCK_DETECTION = 93, + CLOCK_ERROR_STATE = 94, + CLOCK_STATUS = 95, + AUTO_MUTE_STATE = 108, + SOFT_MUTE_STATE = 114, + SAMPLE_RATE_STATE = 115, DSP_BOOT_POWER_STATE = 118, }; void WriteRegister(Register reg, uint8_t val); + uint8_t ReadRegister(Register reg); }; } // namespace drivers |
