mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 19:54:39 +00:00
Audio: Introduce Codec abstraction.
Now that we have two hardware variants with different audio codecs.
This commit is contained in:
parent
5da64ab069
commit
da4bee6cc6
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user