|
|
|
@ -31,7 +31,7 @@ BASE_CONFIG = [ |
|
|
|
|
AmpConfig("Enable PLL2", 0b1, 0x1A, 7, 0b10000000), |
|
|
|
|
AmpConfig("DAI1: I2S mode", 0b00100, 0x14, 2, 0b01111100), |
|
|
|
|
AmpConfig("DAI2: I2S mode", 0b00100, 0x1C, 2, 0b01111100), |
|
|
|
|
AmpConfig("Right speaker output volume", 0x1F, 0x3E, 0, 0b00011111), |
|
|
|
|
AmpConfig("Right speaker output volume", 0x1a, 0x3E, 0, 0b00011111), |
|
|
|
|
AmpConfig("DAI1 Passband filtering: music mode", 0b1, 0x18, 7, 0b10000000), |
|
|
|
|
AmpConfig("DAI1 voice mode gain (DV1G)", 0b00, 0x2F, 4, 0b00110000), |
|
|
|
|
AmpConfig("DAI1 attenuation (DV1)", 0x0, 0x2F, 0, 0b00001111), |
|
|
|
@ -41,8 +41,8 @@ BASE_CONFIG = [ |
|
|
|
|
AmpConfig("ALC enable", 0b0, 0x43, 7, 0b10000000), |
|
|
|
|
AmpConfig("ALC/excursion limiter release time", 0b101, 0x43, 4, 0b01110000), |
|
|
|
|
AmpConfig("DAI1 EQ enable", 0b0, 0x49, 0, 0b00000001), |
|
|
|
|
AmpConfig("DAI2 EQ enable", 0b1, 0x49, 1, 0b00000010), |
|
|
|
|
AmpConfig("DAI2 EQ clip detection disabled", 0b0, 0x32, 4, 0b00010000), |
|
|
|
|
AmpConfig("DAI2 EQ enable", 0b0, 0x49, 1, 0b00000010), |
|
|
|
|
AmpConfig("DAI2 EQ clip detection disabled", 0b1, 0x32, 4, 0b00010000), |
|
|
|
|
AmpConfig("DAI2 EQ attenuation", 0x5, 0x32, 0, 0b00001111), |
|
|
|
|
AmpConfig("Excursion limiter upper corner freq", 0b100, 0x41, 4, 0b01110000), |
|
|
|
|
AmpConfig("Excursion limiter lower corner freq", 0b00, 0x41, 0, 0b00000011), |
|
|
|
@ -57,6 +57,9 @@ BASE_CONFIG = [ |
|
|
|
|
AmpConfig("DAI2 audio port selector", 0b01, 0x1E, 6, 0b11000000), |
|
|
|
|
AmpConfig("Enable left digital microphone", 0b1, 0x48, 5, 0b00100000), |
|
|
|
|
AmpConfig("Enable right digital microphone", 0b1, 0x48, 4, 0b00010000), |
|
|
|
|
AmpConfig("Enhanced volume smoothing disabled", 0b0, 0x49, 7, 0b10000000), |
|
|
|
|
AmpConfig("Volume adjustment smoothing disabled", 0b0, 0x49, 6, 0b01000000), |
|
|
|
|
AmpConfig("Zero-crossing detection disabled", 0b0, 0x49, 5, 0b00100000), |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
BASE_CONFIG += configs_from_eq_params(0x84, EQParams(0x65C4, 0xC07C, 0x3D66, 0x07D9, 0x120F)) |
|
|
|
@ -88,11 +91,11 @@ class Amplifier: |
|
|
|
|
self.set_config(AmpConfig("Global shutdown", 0b0 if amp_disabled else 0b1, 0x51, 7, 0b10000000)) |
|
|
|
|
|
|
|
|
|
def initialize_configuration(self): |
|
|
|
|
self.set_global_shutdown(amp_disabled=True) |
|
|
|
|
|
|
|
|
|
for config in BASE_CONFIG: |
|
|
|
|
self.set_config(config) |
|
|
|
|
|
|
|
|
|
# Re-init amp |
|
|
|
|
self.set_global_shutdown(amp_disabled=True) |
|
|
|
|
self.set_global_shutdown(amp_disabled=False) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|