ZL38063 Driver

Driver for ZL38063 codec chip used in ESP32-LyraTD-MSC audio board.

API Reference

Functions

esp_err_t zl38063_codec_init(audio_hal_codec_config_t *cfg)

Initialize ZL38063 chip.

Return
  • ESP_OK
  • ESP_FAIL
Parameters
  • cfg: configuration of ZL38063

esp_err_t zl38063_codec_deinit(void)

Deinitialize ZL38063 chip.

Return
  • ESP_OK
  • ESP_FAIL

esp_err_t zl38063_codec_ctrl_state(audio_hal_codec_mode_t mode, audio_hal_ctrl_t ctrl_state)

Control ZL38063 chip.

The functions zl38063_ctrl_state and zl38063_config_i2s are not used by this driver. They are kept here to maintain the uniformity and convenience of the interface of the ADF project. These settings for zl38063 are burned in firmware and configuration files. Default i2s configuration: 48000Hz, 16bit, Left-Right channels. Use resampling to be compatible with different file types.

Return
  • ESP_FAIL Parameter error
  • ESP_OK Success
Parameters
  • mode: codec mode
  • ctrl_state: start or stop decode or encode progress

esp_err_t zl38063_codec_config_i2s(audio_hal_codec_mode_t mode, audio_hal_codec_i2s_iface_t *iface)

Configure ZL38063 codec mode and I2S interface.

Return
  • ESP_FAIL Parameter error
  • ESP_OK Success
Parameters
  • mode: codec mode
  • iface: I2S config

esp_err_t zl38063_codec_set_voice_mute(bool mute)

mute or unmute the codec

Return
  • ESP_OK
  • ESP_FAIL
Parameters
  • mute: true, false

esp_err_t zl38063_codec_set_voice_volume(int volume)

Set voice volume.

Return
  • ESP_OK
  • ESP_FAIL
Parameters
  • volume: voice volume (0~100)

esp_err_t zl38063_codec_get_voice_volume(int *volume)

Get voice volume.

Return
  • ESP_OK
  • ESP_FAIL
Parameters
  • *volume: voice volume (0~100)