ZL38063 Driver

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

API Reference

Header File

Functions

esp_err_t zl38063_codec_init(audio_hal_codec_config_t *cfg)

Initialize ZL38063 chip.

参数

cfg – configuration of ZL38063

返回

  • ESP_OK

  • ESP_FAIL

esp_err_t zl38063_codec_deinit(void)

Deinitialize ZL38063 chip.

返回

  • 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.

参数
  • mode – codec mode

  • ctrl_state – start or stop decode or encode progress

返回

  • ESP_FAIL Parameter error

  • ESP_OK Success

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.

参数
  • mode – codec mode

  • iface – I2S config

返回

  • ESP_FAIL Parameter error

  • ESP_OK Success

esp_err_t zl38063_codec_set_voice_mute(bool mute)

mute or unmute the codec

参数

mute – true, false

返回

  • ESP_OK

  • ESP_FAIL

esp_err_t zl38063_codec_set_voice_volume(int volume)

Set voice volume.

参数

volume – voice volume (0~100)

返回

  • ESP_OK

  • ESP_FAIL

esp_err_t zl38063_codec_get_voice_volume(int *volume)

Get voice volume.

参数

*volume[out] voice volume (0~100)

返回

  • ESP_OK

  • ESP_FAIL