mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-14 12:08:40 +00:00
WM8731: Add method to detect codec is present.
Used to determine PortaPack hardware version.
This commit is contained in:
parent
8f5555b052
commit
37c058354e
@ -87,6 +87,10 @@ void WM8731::init() {
|
|||||||
headphone_mute();
|
headphone_mute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WM8731::detected() {
|
||||||
|
return reset();
|
||||||
|
}
|
||||||
|
|
||||||
bool WM8731::reset() {
|
bool WM8731::reset() {
|
||||||
return write(0x0f, 0);
|
return write(0x0f, 0);
|
||||||
}
|
}
|
||||||
|
@ -292,6 +292,8 @@ public:
|
|||||||
|
|
||||||
bool reset();
|
bool reset();
|
||||||
|
|
||||||
|
bool detected();
|
||||||
|
|
||||||
void set_line_in_volume(const volume_t volume) {
|
void set_line_in_volume(const volume_t volume) {
|
||||||
const auto normalized = line_in_gain_range.normalize(volume);
|
const auto normalized = line_in_gain_range.normalize(volume);
|
||||||
auto n = normalized.centibel() / 15;
|
auto n = normalized.centibel() / 15;
|
||||||
|
Loading…
Reference in New Issue
Block a user