mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-22 15:49:57 -05:00
AK4951: Separate/rename codec interface mode config methods.
This commit is contained in:
parent
f0fb4cb369
commit
f0947a4917
@ -29,7 +29,7 @@ using namespace portapack;
|
||||
namespace asahi_kasei {
|
||||
namespace ak4951 {
|
||||
|
||||
void AK4951::configure_digital_interface() {
|
||||
void AK4951::configure_digital_interface_i2s() {
|
||||
// Configure for external slave mode.
|
||||
map.r.mode_control_1.DIF = 0b11; // I2S compatible
|
||||
map.r.mode_control_1.BCKO = 0; // BICK = 32fs
|
||||
@ -38,10 +38,9 @@ void AK4951::configure_digital_interface() {
|
||||
map.r.mode_control_2.CM = 0b00; // MCKI = 256fs
|
||||
map.r.mode_control_2.FS = 0b1011; // fs = 48kHz
|
||||
update(Register::ModeControl2);
|
||||
}
|
||||
|
||||
// map.r.mode_control_3.DVOLC = 1; // Control L/R channels with DVL (LchDigitalVolumeControl)
|
||||
// update(Register::ModeControl3);
|
||||
|
||||
void AK4951::configure_digital_interface_external_slave() {
|
||||
map.r.power_management_2.MS = 0; // Slave mode
|
||||
map.r.power_management_2.PMPLL = 0; // EXT mode
|
||||
update(Register::PowerManagement2);
|
||||
@ -53,7 +52,8 @@ void AK4951::init() {
|
||||
// Write dummy address to "release" the reset.
|
||||
write(0x00, 0x00);
|
||||
|
||||
configure_digital_interface();
|
||||
configure_digital_interface_i2s();
|
||||
configure_digital_interface_external_slave();
|
||||
|
||||
map.r.power_management_1.PMVCM = 1;
|
||||
update(Register::PowerManagement1);
|
||||
|
@ -864,7 +864,8 @@ private:
|
||||
Line,
|
||||
};
|
||||
|
||||
void configure_digital_interface();
|
||||
void configure_digital_interface_i2s();
|
||||
void configure_digital_interface_external_slave();
|
||||
void set_digtal_volume_control(const reg_t value);
|
||||
void set_dac_power(const bool enable);
|
||||
void set_headphone_power(const bool enable);
|
||||
|
Loading…
x
Reference in New Issue
Block a user