Arduino AudioKit HAL
AudioKit.h
Go to the documentation of this file.
1 /**
2  * @file AudioKit.h
3  * @author Phil Schatzmann
4  * @brief Arduino API for AudioKit
5  * @version 0.1
6  * @date 2021-12-12
7  *
8  * @copyright Copyright (c) 2021
9  *
10  */
11 #pragma once
12 #include "AudioKitSettings.h"
13 
14 // include drivers
15 #include "audio_driver/es7148/es7148.h"
16 #include "audio_driver/es7210/es7210.h"
17 #include "audio_driver/es7243/es7243.h"
18 #include "audio_driver/es8311/es8311.h"
19 #include "audio_driver/es8374/es8374.h"
20 #include "audio_driver/es8388/es8388.h"
21 #include "audio_driver/tas5805m/tas5805m.h"
22 #include "audiokit_board.h"
23 #include "audiokit_logger.h"
24 #include "SPI.h"
25 
26 #ifdef ESP32
27 #include "esp_a2dp_api.h"
28 #include "audio_system.h"
29 #include "audio_version.h"
30 #include "driver/i2s.h"
31 #endif
32 
33 // Support for old IDF versions
34 #if ESP_IDF_VERSION_MAJOR < 4 && !defined(I2S_COMM_FORMAT_STAND_I2S)
35 #define I2S_COMM_FORMAT_STAND_I2S \
36  (I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB)
37 #define I2S_COMM_FORMAT_STAND_MSB \
38  (I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB)
39 #define I2S_COMM_FORMAT_STAND_LSB \
40  (I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_LSB)
41 #define I2S_COMM_FORMAT_STAND_PCM_LONG \
42  (I2S_COMM_FORMAT_PCM | I2S_COMM_FORMAT_PCM_LONG)
43 #define I2S_COMM_FORMAT_STAND_PCM_SHORT \
44  (I2S_COMM_FORMAT_PCM | I2S_COMM_FORMAT_PCM_SHORT)
45 typedef int eps32_i2s_audio_sample_rate_type;
46 #else
47 typedef uint32_t eps32_i2s_audio_sample_rate_type;
48 #endif
49 
50 /**
51  * @brief Configuation for AudioKit
52  *
53  */
55  i2s_port_t i2s_num = (i2s_port_t)0;
56  gpio_num_t mclk_gpio = (gpio_num_t)0;
57 
59  AUDIOKIT_DEFAULT_INPUT; /*!< set adc channel with audio_hal_adc_input_t
60  */
62  AUDIOKIT_DEFAULT_OUTPUT; /*!< set dac channel */
63  audio_hal_codec_mode_t codec_mode; /*!< select codec mode: adc, dac or both */
65  AUDIOKIT_DEFAULT_MASTER_SLAVE; /*!< audio codec chip mode */
67  AUDIOKIT_DEFAULT_I2S_FMT; /*!< I2S interface format */
69  AUDIOKIT_DEFAULT_RATE; /*!< I2S interface samples per second */
71  AUDIOKIT_DEFAULT_BITSIZE; /*!< i2s interface number of bits per sample */
72 
73  /// Returns true if the CODEC is the master
75 
76  /// provides the bits per sample
77  int bitsPerSample() {
78  switch (bits_per_sample) {
80  return 16;
82  return 24;
84  return 32;
85  }
86  // KIT_LOGE("bits_per_sample not supported: %d", bits_per_sample);
87  return 0;
88  }
89 
90  /// Provides the sample rate in samples per second
91  int sampleRate() {
92  switch (sample_rate) {
93  case AUDIO_HAL_08K_SAMPLES: /*!< set to 8k samples per second */
94  return 8000;
95  case AUDIO_HAL_11K_SAMPLES: /*!< set to 11.025k samples per second */
96  return 11000;
97  case AUDIO_HAL_16K_SAMPLES: /*!< set to 16k samples in per second */
98  return 16000;
99  case AUDIO_HAL_22K_SAMPLES: /*!< set to 22.050k samples per second */
100  return 22000;
101  case AUDIO_HAL_24K_SAMPLES: /*!< set to 24k samples in per second */
102  return 24000;
103  case AUDIO_HAL_32K_SAMPLES: /*!< set to 32k samples in per second */
104  return 32000;
105  case AUDIO_HAL_44K_SAMPLES: /*!< set to 44.1k samples per second */
106  return 44000;
107  case AUDIO_HAL_48K_SAMPLES: /*!< set to 48k samples per second */
108  return 48000;
109  }
110  // KIT_LOGE("sample rate not supported: %d", sample_rate);
111  return 0;
112  }
113 
114 #ifdef ESP32
115  /// Provides the ESP32 i2s_config_t to configure I2S
116  i2s_config_t i2sConfig() {
117  // use just the oposite of the CODEC setting
118  const i2s_config_t i2s_config = {
119  .mode = i2sMode(),
120  .sample_rate = sampleRate(),
121  .bits_per_sample = (i2s_bits_per_sample_t)bitsPerSample(),
122  .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
123  .communication_format = (i2s_comm_format_t)i2sFormat(),
124  .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2 | ESP_INTR_FLAG_IRAM,
125  .dma_buf_count = 3,
126  .dma_buf_len = 320,
127  .use_apll = true,
128  .tx_desc_auto_clear = true,
129  .fixed_mclk = 0
130  };
131  return i2s_config;
132  }
133 
134  /// Provides the ESP32 i2s_pin_config_t to configure the pins for I2S
135  i2s_pin_config_t i2sPins() {
136  i2s_pin_config_t result;
137  get_i2s_pins(i2s_num, &result);
138  return result;
139  }
140 
141  protected:
142  i2s_comm_format_t i2sFormat(){
143  i2s_comm_format_t its_com_fmt = (i2s_comm_format_t) I2S_COMM_FORMAT_STAND_I2S;
144  if (fmt==AUDIO_HAL_I2S_LEFT){
145  its_com_fmt = (i2s_comm_format_t) I2S_COMM_FORMAT_STAND_MSB;
146  } else if(fmt==AUDIO_HAL_I2S_RIGHT){
147  its_com_fmt = (i2s_comm_format_t) I2S_COMM_FORMAT_STAND_LSB;
148  } else if(fmt==AUDIO_HAL_I2S_DSP){
149  its_com_fmt = (i2s_comm_format_t )I2S_COMM_FORMAT_STAND_PCM_SHORT;
150  }
151  return its_com_fmt;
152  }
153 
154  i2s_mode_t i2sMode() {
155  int mode = isMaster() ? I2S_MODE_SLAVE : I2S_MODE_MASTER;
156  // using ESP32 dac/adc
157  if (fmt == AUDIO_HAL_I2S_DSP){
159  mode = mode | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN;
160  } else if (codec_mode == AUDIO_HAL_CODEC_MODE_ENCODE) {
161  mode = mode | I2S_MODE_RX | I2S_MODE_ADC_BUILT_IN;
162  } else if (codec_mode == AUDIO_HAL_CODEC_MODE_BOTH) {
163  mode = mode | I2S_MODE_RX | I2S_MODE_TX | I2S_MODE_ADC_BUILT_IN | I2S_MODE_DAC_BUILT_IN;
164  }
165  } else {
166  // I2S
168  mode = mode | I2S_MODE_TX;
169  } else if (codec_mode == AUDIO_HAL_CODEC_MODE_ENCODE) {
170  mode = mode | I2S_MODE_RX;
171  } else if (codec_mode == AUDIO_HAL_CODEC_MODE_BOTH) {
172  mode = mode | I2S_MODE_RX | I2S_MODE_TX;
173  }
174  }
175  return (i2s_mode_t) mode;
176  }
177 
178 #endif
179 };
180 
181 /**
182  * @brief Do we read or write audio data - or both
183  *
184  */
185 enum AudioKitInOut {AudioOutput, AudioInput, AudioInputOutput };
186 
187 /**
188  * @brief AudioKit API using the audio_hal
189  *
190  */
191 
192 class AudioKit {
193 
194  public:
195  AudioKit() {
196  // setup SPI for SD drives
197  setupSPI();
198  }
199 
200  /// Provides the default configuration for input or output
201  AudioKitConfig defaultConfig(AudioKitInOut inout=AudioInputOutput) {
202  AudioKitConfig result;
203  switch(inout){
204  case AudioOutput:
205  result.codec_mode = AUDIO_HAL_CODEC_MODE_DECODE; // dac
206  case AudioInput:
207  result.codec_mode = AUDIO_HAL_CODEC_MODE_ENCODE; // adc
208  default:
210  }
211  return result;
212  }
213 
214  /// Starts the codec
215  bool begin(AudioKitConfig cnfg) {
216  KIT_LOGI(LOG_METHOD);
217  KIT_LOGI("Selected board: %d", AUDIOKIT_BOARD);
218 
219  audio_hal_conf.adc_input = cfg.adc_input;
220  audio_hal_conf.dac_output = cfg.dac_output;
221  audio_hal_conf.codec_mode = cfg.codec_mode;
222  audio_hal_conf.i2s_iface.mode = cfg.master_slave_mode;
223  audio_hal_conf.i2s_iface.fmt = cfg.fmt;
224  audio_hal_conf.i2s_iface.samples = cfg.sample_rate;
225  audio_hal_conf.i2s_iface.bits = cfg.bits_per_sample;
226 
227  hal_handle = audio_hal_init(&audio_hal_conf, &AUDIO_DRIVER);
228  if (hal_handle == 0) {
229  KIT_LOGE("audio_hal_init");
230  return false;
231  }
232 
233  cfg = cnfg;
234 
235 #ifdef ESP32
236 
237  // setup i2s driver - with no queue
238  i2s_config_t i2s_config = cfg.i2sConfig();
239  if (i2s_driver_install(cfg.i2s_num, &i2s_config, 0, NULL) != ESP_OK) {
240  KIT_LOGE("i2s_driver_install");
241  return false;
242  }
243 
244  // define i2s pins
245  i2s_pin_config_t pin_config = cfg.i2sPins();
246  if (i2s_set_pin(cfg.i2s_num, &pin_config) != ESP_OK) {
247  KIT_LOGE("i2s_set_pin");
248  return false;
249  }
250 
251  if (i2s_mclk_gpio_select(cfg.i2s_num, cfg.mclk_gpio) != ESP_OK) {
252  KIT_LOGE("i2s_mclk_gpio_select");
253  return false;
254  }
255 
256 #endif
257 
258  // call start
259  if (!setActive(true)) {
260  KIT_LOGE("setActive");
261  return false;
262  }
263 
264  return true;
265  }
266 
267  /// Stops the CODEC
268  bool end() {
269  KIT_LOGI(LOG_METHOD);
270 
271 #ifdef ESP32
272  // uninstall i2s driver
273  i2s_driver_uninstall(cfg.i2s_num);
274 #endif
275  // stop codec driver
277  // deinit
278  audio_hal_deinit(hal_handle);
279  return true;
280  }
281 
282  /// Provides the actual configuration
283  AudioKitConfig config() { return cfg; }
284 
285  /// Sets the codec active / inactive
286  bool setActive(bool active) {
287  return audio_hal_ctrl_codec(
288  hal_handle, cfg.codec_mode,
289  active ? AUDIO_HAL_CTRL_START : AUDIO_HAL_CTRL_STOP) == ESP_OK;
290  }
291 
292  /// Mutes the output
293  bool setMute(bool mute) {
294  return audio_hal_set_mute(hal_handle, mute) == ESP_OK;
295  }
296 
297  /// Defines the Volume
298  bool setVolume(int vol) {
299  return (vol > 0) ? audio_hal_set_volume(hal_handle, vol) == ESP_OK : false;
300  }
301 
302  /// Determines the volume
303  int volume() {
304  int volume;
305  if (audio_hal_get_volume(hal_handle, &volume) != ESP_OK) {
306  volume = -1;
307  }
308  return volume;
309  }
310 
311 #ifdef ESP32
312 
313  /// Writes the audio data via i2s to the DAC
314  size_t write(const void *src, size_t size,
315  TickType_t ticks_to_wait = portMAX_DELAY) {
316  KIT_LOGD("write: %zu", size);
317  size_t bytes_written = 0;
318  if (i2s_write(cfg.i2s_num, src, size, &bytes_written, ticks_to_wait) !=
319  ESP_OK) {
320  KIT_LOGE("i2s_write");
321  }
322  return bytes_written;
323  }
324 
325  /// Reads the audio data via i2s from the ADC
326  size_t read(void *dest, size_t size,
327  TickType_t ticks_to_wait = portMAX_DELAY) {
328  KIT_LOGD("read: %zu", size);
329  size_t bytes_read = 0;
330  if (i2s_read(cfg.i2s_num, dest, size, &bytes_read, ticks_to_wait) !=
331  ESP_OK) {
332  KIT_LOGE("i2s_read");
333  }
334  return bytes_read;
335  }
336 
337 #endif
338 
339  /**
340  * @brief Get the gpio number for auxin detection
341  *
342  * @return -1 non-existent
343  * Others gpio number
344  */
345  int8_t pinAuxin() { return get_auxin_detect_gpio(); }
346 
347  /**
348  * @brief Get the gpio number for headphone detection
349  *
350  * @return -1 non-existent
351  * Others gpio number
352  */
353  int8_t pinHeadphoneDetect() { return get_headphone_detect_gpio(); }
354 
355  /**
356  * @brief Get the gpio number for PA enable
357  *
358  * @return -1 non-existent
359  * Others gpio number
360  */
361  int8_t pinPaEnable() { return get_pa_enable_gpio(); }
362 
363  /**
364  * @brief Get the gpio number for adc detection
365  *
366  * @return -1 non-existent
367  * Others gpio number
368  */
369  int8_t pinAdcDetect() { return get_adc_detect_gpio(); }
370 
371  /**
372  * @brief Get the mclk gpio number of es7243
373  *
374  * @return -1 non-existent
375  * Others gpio number
376  */
377  int8_t pinEs7243Mclk() { return get_es7243_mclk_gpio(); }
378 
379  /**
380  * @brief Get the record-button id for adc-button
381  *
382  * @return -1 non-existent
383  * Others button id
384  */
385  int8_t pinInputRec() { return get_input_rec_id(); }
386 
387  /**
388  * @brief Get the number for mode-button
389  *
390  * @return -1 non-existent
391  * Others number
392  */
393  int8_t pinInputMode() { return get_input_mode_id(); }
394 
395  /**
396  * @brief Get number for set function
397  *
398  * @return -1 non-existent
399  * Others number
400  */
401  int8_t pinInputSet() { return get_input_set_id(); };
402 
403  /**
404  * @brief Get number for play function
405  *
406  * @return -1 non-existent
407  * Others number
408  */
409  int8_t pinInputPlay() { return get_input_play_id(); }
410 
411  /**
412  * @brief number for volume up function
413  *
414  * @return -1 non-existent
415  * Others number
416  */
417  int8_t pinVolumeUp() { return get_input_volup_id(); }
418 
419  /**
420  * @brief Get number for volume down function
421  *
422  * @return -1 non-existent
423  * Others number
424  */
425  int8_t pinVolumeDown() { return get_input_voldown_id(); }
426 
427  /**
428  * @brief Get green led gpio number
429  *
430  * @return -1 non-existent
431  * Others gpio number
432  */
433  int8_t pinResetCodec() { return get_reset_codec_gpio(); }
434 
435  /**
436  * @brief Get DSP reset gpio number
437  *
438  * @return -1 non-existent
439  * Others gpio number
440  */
441  int8_t pinResetBoard() { return get_reset_board_gpio(); }
442 
443  /**
444  * @brief Get DSP reset gpio number
445  *
446  * @return -1 non-existent
447  * Others gpio number
448  */
449  int8_t pinGreenLed() { return get_green_led_gpio(); }
450 
451  /**
452  * @brief Get green led gpio number
453  *
454  * @return -1 non-existent
455  * Others gpio number
456  */
457  int8_t pinBlueLed() { return get_blue_led_gpio(); }
458 
459  /**
460  * @brief SPI CS Pin for SD Drive
461  *
462  * @return int8_t
463  */
464  int8_t pinSpiCs() {
465  return spi_cs_pin;
466  }
467 
468  protected:
469  AudioKitConfig cfg;
470  audio_hal_codec_config_t audio_hal_conf;
471  audio_hal_handle_t hal_handle;
473  int8_t spi_cs_pin;
474 
475 
476  /**
477  * @brief Setup the SPI so that we can access the SD Drive
478  */
479  void setupSPI() {
480  KIT_LOGD(LOG_METHOD);
481 // I assume this is valid for all AudioKits!
482 #if defined(ESP32) && defined(AUDIOKIT_SETUP_SD)
483  spi_cs_pin = PIN_AUDIO_KIT_SD_CARD_CS;
484  SPI.begin(PIN_AUDIO_KIT_SD_CARD_CLK, PIN_AUDIO_KIT_SD_CARD_MISO, PIN_AUDIO_KIT_SD_CARD_MOSI, PIN_AUDIO_KIT_SD_CARD_CS);
485 #else
486  #warning "SPI initialization for the SD drive not supported - you might need to take care of this yourself"
487 #endif
488  }
489 
490 
491 
492 };
AudioKitInOut
Do we read or write audio data - or both.
Definition: AudioKit.h:185
AUDIOKIT_BOARD selects a specic board: 1) lyrat_v4_3 2) lyrat_v4_2 3) lyrat_mini_v1_1 4) esp32_s2_kal...
gpio_num_t
Definition: audio_gpio.h:39
audio_hal_iface_format_t fmt
Definition: audio_hal.h:145
audio_hal_codec_mode_t
Select media hal codec mode.
Definition: audio_hal.h:65
@ AUDIO_HAL_CODEC_MODE_BOTH
Definition: audio_hal.h:68
@ AUDIO_HAL_CODEC_MODE_ENCODE
Definition: audio_hal.h:66
@ AUDIO_HAL_CODEC_MODE_DECODE
Definition: audio_hal.h:67
esp_err_t audio_hal_deinit(audio_hal_handle_t audio_hal)
Uninitialize media codec driver.
audio_hal_iface_samples_t samples
Definition: audio_hal.h:146
audio_hal_iface_bits_t
Select I2S interface number of bits per sample.
Definition: audio_hal.h:124
@ AUDIO_HAL_BIT_LENGTH_24BITS
Definition: audio_hal.h:126
@ AUDIO_HAL_BIT_LENGTH_16BITS
Definition: audio_hal.h:125
@ AUDIO_HAL_BIT_LENGTH_32BITS
Definition: audio_hal.h:127
audio_hal_codec_mode_t codec_mode
Definition: audio_hal.h:156
audio_hal_iface_mode_t
Select I2S interface operating mode i.e. master or slave for audio codec chip.
Definition: audio_hal.h:102
@ AUDIO_HAL_MODE_MASTER
Definition: audio_hal.h:104
audio_hal_dac_output_t
Select channel for dac output.
Definition: audio_hal.h:85
audio_hal_handle_t audio_hal_init(audio_hal_codec_config_t *audio_hal_conf, audio_hal_func_t *audio_hal_func)
Initialize media codec driver.
audio_hal_adc_input_t
Select adc channel for input mic signal.
Definition: audio_hal.h:75
audio_hal_adc_input_t adc_input
Definition: audio_hal.h:154
esp_err_t audio_hal_set_mute(audio_hal_handle_t audio_hal, bool mute)
Set voice mute. Enables or disables DAC mute of a codec.
audio_hal_iface_mode_t mode
Definition: audio_hal.h:144
audio_hal_iface_samples_t
Select I2S interface samples per second.
Definition: audio_hal.h:110
@ AUDIO_HAL_08K_SAMPLES
Definition: audio_hal.h:111
@ AUDIO_HAL_16K_SAMPLES
Definition: audio_hal.h:113
@ AUDIO_HAL_24K_SAMPLES
Definition: audio_hal.h:115
@ AUDIO_HAL_32K_SAMPLES
Definition: audio_hal.h:116
@ AUDIO_HAL_11K_SAMPLES
Definition: audio_hal.h:112
@ AUDIO_HAL_22K_SAMPLES
Definition: audio_hal.h:114
@ AUDIO_HAL_44K_SAMPLES
Definition: audio_hal.h:117
@ AUDIO_HAL_48K_SAMPLES
Definition: audio_hal.h:118
audio_hal_dac_output_t dac_output
Definition: audio_hal.h:155
esp_err_t audio_hal_ctrl_codec(audio_hal_handle_t audio_hal, audio_hal_codec_mode_t mode, audio_hal_ctrl_t audio_hal_ctrl)
Start/stop codec driver.
audio_hal_iface_format_t
Select I2S interface format for audio codec chip.
Definition: audio_hal.h:133
@ AUDIO_HAL_I2S_LEFT
Definition: audio_hal.h:135
@ AUDIO_HAL_I2S_DSP
Definition: audio_hal.h:137
@ AUDIO_HAL_I2S_RIGHT
Definition: audio_hal.h:136
audio_hal_codec_i2s_iface_t i2s_iface
Definition: audio_hal.h:157
audio_hal_iface_bits_t bits
Definition: audio_hal.h:147
esp_err_t audio_hal_get_volume(audio_hal_handle_t audio_hal, int *volume)
get voice volume.
@ AUDIO_HAL_CTRL_START
Definition: audio_hal.h:96
@ AUDIO_HAL_CTRL_STOP
Definition: audio_hal.h:95
esp_err_t audio_hal_set_volume(audio_hal_handle_t audio_hal, int volume)
Set voice volume.
Configure media hal for initialization of audio codec chip.
Definition: audio_hal.h:153
I2s interface configuration for audio codec chip.
Definition: audio_hal.h:143
esp_system functionality only for ESP32
Select bard.h based on AUDIOKIT_BOARD definition in configuration file.
Simple Logger we need to support both C and C++.
AudioKit API using the audio_hal.
Definition: AudioKit.h:192
int8_t pinHeadphoneDetect()
Get the gpio number for headphone detection.
Definition: AudioKit.h:353
int8_t pinGreenLed()
Get DSP reset gpio number.
Definition: AudioKit.h:449
int8_t pinAdcDetect()
Get the gpio number for adc detection.
Definition: AudioKit.h:369
int8_t pinVolumeUp()
number for volume up function
Definition: AudioKit.h:417
int8_t pinSpiCs()
SPI CS Pin for SD Drive.
Definition: AudioKit.h:464
int8_t pinPaEnable()
Get the gpio number for PA enable.
Definition: AudioKit.h:361
int8_t pinInputRec()
Get the record-button id for adc-button.
Definition: AudioKit.h:385
bool setActive(bool active)
Sets the codec active / inactive.
Definition: AudioKit.h:286
int8_t pinInputMode()
Get the number for mode-button.
Definition: AudioKit.h:393
int8_t pinEs7243Mclk()
Get the mclk gpio number of es7243.
Definition: AudioKit.h:377
int volume()
Determines the volume.
Definition: AudioKit.h:303
int8_t pinAuxin()
Get the gpio number for auxin detection.
Definition: AudioKit.h:345
void setupSPI()
Setup the SPI so that we can access the SD Drive.
Definition: AudioKit.h:479
bool begin(AudioKitConfig cnfg)
Starts the codec.
Definition: AudioKit.h:215
bool setMute(bool mute)
Mutes the output.
Definition: AudioKit.h:293
int8_t pinVolumeDown()
Get number for volume down function.
Definition: AudioKit.h:425
bool end()
Stops the CODEC.
Definition: AudioKit.h:268
int8_t pinResetBoard()
Get DSP reset gpio number.
Definition: AudioKit.h:441
bool setVolume(int vol)
Defines the Volume.
Definition: AudioKit.h:298
int8_t pinResetCodec()
Get green led gpio number.
Definition: AudioKit.h:433
int8_t pinInputSet()
Get number for set function.
Definition: AudioKit.h:401
AudioKitConfig defaultConfig(AudioKitInOut inout=AudioInputOutput)
Provides the default configuration for input or output.
Definition: AudioKit.h:201
int8_t pinBlueLed()
Get green led gpio number.
Definition: AudioKit.h:457
int8_t pinInputPlay()
Get number for play function.
Definition: AudioKit.h:409
AudioKitConfig config()
Provides the actual configuration.
Definition: AudioKit.h:283
Configuation for AudioKit.
Definition: AudioKit.h:54
audio_hal_iface_bits_t bits_per_sample
Definition: AudioKit.h:70
int bitsPerSample()
provides the bits per sample
Definition: AudioKit.h:77
int sampleRate()
Provides the sample rate in samples per second.
Definition: AudioKit.h:91
audio_hal_dac_output_t dac_output
Definition: AudioKit.h:61
bool isMaster()
Returns true if the CODEC is the master.
Definition: AudioKit.h:74
audio_hal_adc_input_t adc_input
Definition: AudioKit.h:58
audio_hal_iface_format_t fmt
Definition: AudioKit.h:66
audio_hal_iface_mode_t master_slave_mode
Definition: AudioKit.h:64
audio_hal_iface_samples_t sample_rate
Definition: AudioKit.h:68
audio_hal_codec_mode_t codec_mode
Definition: AudioKit.h:63
Configuration of functions and variables used to operate audio codec chip.
Definition: audio_hal.h:163