Audio: Introduce Codec abstraction.

Now that we have two hardware variants with different audio codecs.
This commit is contained in:
Jared Boone 2017-05-31 11:21:51 -07:00
parent 5da64ab069
commit da4bee6cc6

View File

@ -25,9 +25,34 @@
#include "volume.hpp"
#include <cstdint>
#include <cstddef>
#include <string>
namespace audio {
class Codec {
public:
virtual ~Codec() { }
virtual std::string name() const = 0;
virtual bool reset() = 0;
virtual void init() = 0;
virtual void headphone_enable() = 0;
virtual void headphone_disable() = 0;
virtual volume_range_t headphone_gain_range() const = 0;
virtual void set_headphone_volume(const volume_t volume) = 0;
virtual void microphone_enable() = 0;
virtual void microphone_disable() = 0;
virtual size_t reg_count() const = 0;
virtual size_t reg_bits() const = 0;
virtual uint32_t reg_read(const size_t register_number) = 0;
};
namespace output {
void start();