MCPcopy Create free account
hub / github.com/BruceDevices/firmware / _setup_codec_speaker

Function _setup_codec_speaker

boards/m5stack-cardputer/interface.cpp:468–485  ·  view source on GitHub ↗

** Function: _setup_codec_speaker ** location: modules/others/audio.cpp ** Handles audio CODEC to enable/disable speaker **********************************************************************/

Source from the content-addressed store, hash-verified

466** Handles audio CODEC to enable/disable speaker
467**********************************************************************/
468void _setup_codec_speaker(bool enable) {
469 if (!UseTCA8418) return;
470
471 static constexpr const uint8_t enabled_bulk_data[] = {
472 2, 0x00, 0x80, // 0x00 RESET/ CSM POWER ON
473 2, 0x01, 0xB5, // 0x01 CLOCK_MANAGER/ MCLK=BCLK
474 2, 0x02, 0x18, // 0x02 CLOCK_MANAGER/ MULT_PRE=3
475 2, 0x0D, 0x01, // 0x0D SYSTEM/ Power up analog circuitry
476 2, 0x12, 0x00, // 0x12 SYSTEM/ power-up DAC - NOT default
477 2, 0x13, 0x10, // 0x13 SYSTEM/ Enable output to HP drive - NOT default
478 2, 0x32, 0xBF, // 0x32 DAC/ DAC volume (0xBF == ±0 dB )
479 2, 0x37, 0x08, // 0x37 DAC/ Bypass DAC equalizer - NOT default
480 0
481 };
482 static constexpr const uint8_t disabled_bulk_data[] = {0};
483
484 i2c_bulk_write(&Wire1, ES8311_ADDR, enable ? enabled_bulk_data : disabled_bulk_data);
485}
486
487/*********************************************************************
488** Function: _setup_codec_mic

Callers

nothing calls this directly

Calls 1

i2c_bulk_writeFunction · 0.85

Tested by

no test coverage detected