mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 19:54:39 +00:00
Audio: Add codec config methods for external I2S master.
This commit is contained in:
parent
6c3a1384fb
commit
ac423ee769
@ -46,6 +46,12 @@ void AK4951::configure_digital_interface_external_slave() {
|
||||
update(Register::PowerManagement2);
|
||||
}
|
||||
|
||||
void AK4951::configure_digital_interface_external_master() {
|
||||
map.r.power_management_2.MS = 1; // Master mode
|
||||
map.r.power_management_2.PMPLL = 0; // EXT mode
|
||||
update(Register::PowerManagement2);
|
||||
}
|
||||
|
||||
void AK4951::init() {
|
||||
reset();
|
||||
|
||||
|
@ -866,6 +866,7 @@ private:
|
||||
|
||||
void configure_digital_interface_i2s();
|
||||
void configure_digital_interface_external_slave();
|
||||
void configure_digital_interface_external_master();
|
||||
void set_digtal_volume_control(const reg_t value);
|
||||
void set_dac_power(const bool enable);
|
||||
void set_headphone_power(const bool enable);
|
||||
|
@ -37,6 +37,18 @@ void WM8731::configure_interface_i2s_slave() {
|
||||
});
|
||||
}
|
||||
|
||||
void WM8731::configure_interface_i2s_master() {
|
||||
write(DigitalAudioInterfaceFormat {
|
||||
.format = 2,
|
||||
.iwl = 0,
|
||||
.lrp = 0,
|
||||
.lrswap = 0,
|
||||
.ms = 1,
|
||||
.bclkinv = 0,
|
||||
.reserved0 = 0,
|
||||
});
|
||||
}
|
||||
|
||||
void WM8731::init() {
|
||||
reset();
|
||||
|
||||
|
@ -376,6 +376,7 @@ private:
|
||||
volume_t headphone_volume = -60.0_dB;
|
||||
|
||||
void configure_interface_i2s_slave();
|
||||
void configure_interface_i2s_master();
|
||||
|
||||
bool write(const Register reg);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user