Skip to content

Commit 7bd1cb4

Browse files
committed
CS42448
1 parent 4e107ff commit 7bd1cb4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Driver/cs42448/cs42448.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ class CS42448 {
154154
this->i2c_address = i2cAddress;
155155
}
156156

157+
if (is_active){
158+
setMuteADC(true);
159+
setMuteDAC(true);
160+
}
157161
setPowerAll(false);
158162

159163
// slave mode, MCLK 25.6 MHz max
@@ -168,13 +172,15 @@ class CS42448 {
168172
setMuteDAC(true);
169173

170174
// power on requested devices
171-
return setPowerDevices(true);
175+
is_active = setPowerDevices(true);
176+
return is_active;
172177
}
173178

174179
/// Mute ADC and DAC and then power down
175180
bool end() {
176181
setMuteADC(true);
177182
setMuteDAC(true);
183+
is_active = false;
178184
return setPowerDevices(false);
179185
}
180186

@@ -538,6 +544,7 @@ class CS42448 {
538544
codec_config_t codec_config;
539545
i2c_bus_handle_t i2c;
540546
int i2c_address = 0x48;
547+
bool is_active = false;
541548

542549
/// Set I2S format based on codec_config
543550
bool setFormat() {

0 commit comments

Comments
 (0)