From 24d60a11e34203f7b1c2f0634735216a50b2e3c0 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 14 Dec 2015 12:09:01 -0800 Subject: [PATCH] Add WM8731.read() for cached values. --- firmware/common/wm8731.cpp | 4 ++++ firmware/common/wm8731.hpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/firmware/common/wm8731.cpp b/firmware/common/wm8731.cpp index 6ecd0665..15e7e6da 100644 --- a/firmware/common/wm8731.cpp +++ b/firmware/common/wm8731.cpp @@ -36,5 +36,9 @@ void WM8731::write(const address_t reg_address, const reg_t value) { bus.transmit(bus_address, values.data(), values.size()); } +reg_t WM8731::read(const address_t reg_address) { + return map.w[reg_address]; +} + } /* namespace wm8731 */ } /* namespace wolfson */ diff --git a/firmware/common/wm8731.hpp b/firmware/common/wm8731.hpp index 4a0e1f98..ab083390 100644 --- a/firmware/common/wm8731.hpp +++ b/firmware/common/wm8731.hpp @@ -394,6 +394,8 @@ public: // write(Register::AnalogAudioPathControl); // } + reg_t read(const address_t reg_address); + private: I2C& bus; const I2C::address_t bus_address;