From 19e42196dbe22e707129ad48f45f9346bdaf1277 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 1 May 2017 10:37:49 +0100 Subject: [PATCH] Fn for control of audio codec reset signal. --- firmware/common/portapack_io.cpp | 11 +++++++++++ firmware/common/portapack_io.hpp | 1 + 2 files changed, 12 insertions(+) diff --git a/firmware/common/portapack_io.cpp b/firmware/common/portapack_io.cpp index aa053129..5668ad28 100644 --- a/firmware/common/portapack_io.cpp +++ b/firmware/common/portapack_io.cpp @@ -64,6 +64,17 @@ void IO::lcd_reset_state(const bool active) { io_write(1, io_reg); } +void IO::audio_reset_state(const bool active) { + /* Reset signal for audio codec. Some audio codecs (e.g. WM8731) do not + * implement reset signal, only soft reset via I2C. + */ + /* NOTE: This overwrites the contents of the IO register, which for now + * have no significance. But someday...? + */ + io_reg = (io_reg & 0xfd) | ((active ? 1 : 0) << 1); + io_write(1, io_reg); +} + uint32_t IO::io_update(const TouchPinsConfig write_value) { /* Very touchy code to save context of PortaPack data bus while the * resistive touch pin drive is changed. Order of operations is diff --git a/firmware/common/portapack_io.hpp b/firmware/common/portapack_io.hpp index ed1c82fb..9ae46485 100644 --- a/firmware/common/portapack_io.hpp +++ b/firmware/common/portapack_io.hpp @@ -100,6 +100,7 @@ public: void lcd_backlight(const bool value); void lcd_reset_state(const bool active); + void audio_reset_state(const bool active); void lcd_data_write_command_and_data( const uint_fast8_t command,