30#define DEFAULT_WIRE &Wire
32#define DEFAULT_WIRE nullptr
47#define INPUT_PULLUP 0x2
50#define INPUT_PULLDOWN 0x3
62#ifndef LYRAT_MINI_RANGE
63#define LYRAT_MINI_RANGE 5
66#ifndef LYRAT_MINI_DELAY_MS
67#define LYRAT_MINI_DELAY_MS 5
76#define ERROR_INVALID_ARG 1
91#include <zephyr/device.h>
92#include <zephyr/drivers/adc.h>
93#include <zephyr/drivers/gpio.h>
94#include <zephyr/kernel.h>
98#define IS_GPIO(pin) (pin.port != nullptr)
102#define GPIO_TO_INT(pin) pin.pin
109using ADCPin = ::adc_dt_spec;
115 return (a.port == b.port) && (a.pin == b.pin);
130#ifndef GPIO_UNDEFINED
131#define GPIO_UNDEFINED -1
135#define IS_GPIO(pin) ((pin) != GPIO_UNDEFINED)
139#define GPIO_TO_INT(pin) (pin)
409#if (defined(ARDUINO) && !defined(NO_USING_NAMESPACE_AUDIO_DRIVER)) || \
410 defined(USING_NAMESPACE_AUDIO_DRIVER)
#define GPIO_UNDEFINED
Definition DriverCommon.h:131
Namespace for audio driver components.
Definition AudioBoard.h:5
AudioDriverKey
Definition DriverCommon.h:367
void * spi_bus_handle_t
Definition DriverCommon.h:156
int16_t GpioPin
Definition DriverCommon.h:153
PinLogic
Definition DriverCommon.h:328
input_device_t
Definition DriverCommon.h:170
@ ADC_INPUT_ALL
Definition DriverCommon.h:175
@ ADC_INPUT_NONE
Definition DriverCommon.h:171
@ ADC_INPUT_LINE1
Definition DriverCommon.h:172
@ ADC_INPUT_LINE3
Definition DriverCommon.h:174
@ ADC_INPUT_LINE2
Definition DriverCommon.h:173
@ ADC_INPUT_DIFFERENCE
Definition DriverCommon.h:176
sample_bits_t
Definition DriverCommon.h:235
@ BIT_LENGTH_24BITS
Definition DriverCommon.h:240
@ BIT_LENGTH_18BITS
Definition DriverCommon.h:238
@ BIT_LENGTH_20BITS
Definition DriverCommon.h:239
@ BIT_LENGTH_32BITS
Definition DriverCommon.h:241
@ BIT_LENGTH_MAX
Definition DriverCommon.h:242
@ BIT_LENGTH_MIN
Definition DriverCommon.h:236
@ BIT_LENGTH_16BITS
Definition DriverCommon.h:237
PinFunction
Definition DriverCommon.h:344
int16_t ADCPin
Definition DriverCommon.h:154
codec_mode_t
Definition DriverCommon.h:290
@ CODEC_MODE_MIN
Definition DriverCommon.h:291
@ CODEC_MODE_ENCODE
Definition DriverCommon.h:293
@ CODEC_MODE_NONE
Definition DriverCommon.h:292
@ CODEC_MODE_BOTH
Definition DriverCommon.h:295
@ CODEC_MODE_MAX
Definition DriverCommon.h:297
@ CODEC_MODE_DECODE
Definition DriverCommon.h:294
@ CODEC_MODE_LINE_IN
Definition DriverCommon.h:296
int error_t
Definition DriverCommon.h:150
output_device_t
Definition DriverCommon.h:186
@ DAC_OUTPUT_LINE1
Definition DriverCommon.h:188
@ DAC_OUTPUT_ALL
Definition DriverCommon.h:190
@ DAC_OUTPUT_NONE
Definition DriverCommon.h:187
@ DAC_OUTPUT_LINE2
Definition DriverCommon.h:189
samplerate_t
Definition DriverCommon.h:213
@ RATE_44K
Definition DriverCommon.h:220
@ RATE_24K
Definition DriverCommon.h:218
@ RATE_22K
Definition DriverCommon.h:217
@ RATE_128K
Definition DriverCommon.h:225
@ RATE_8K
Definition DriverCommon.h:214
@ RATE_88K
Definition DriverCommon.h:223
@ RATE_176K
Definition DriverCommon.h:226
@ RATE_32K
Definition DriverCommon.h:219
@ RATE_96K
Definition DriverCommon.h:224
@ RATE_11K
Definition DriverCommon.h:215
@ RATE_64K
Definition DriverCommon.h:222
@ RATE_16K
Definition DriverCommon.h:216
@ RATE_48K
Definition DriverCommon.h:221
@ RATE_192K
Definition DriverCommon.h:227
channels_t
Definition DriverCommon.h:274
@ CHANNELS2
Definition DriverCommon.h:275
@ CHANNELS16
Definition DriverCommon.h:278
@ CHANNELS8
Definition DriverCommon.h:277
@ CHANNELS4
Definition DriverCommon.h:276
es_mic_gain_t
Definition DriverCommon.h:305
@ MIC_GAIN_15DB
Definition DriverCommon.h:312
@ MIC_GAIN_MIN
Definition DriverCommon.h:306
@ MIC_GAIN_6DB
Definition DriverCommon.h:309
@ MIC_GAIN_9DB
Definition DriverCommon.h:310
@ MIC_GAIN_24DB
Definition DriverCommon.h:315
@ MIC_GAIN_MAX
Definition DriverCommon.h:316
@ MIC_GAIN_0DB
Definition DriverCommon.h:307
@ MIC_GAIN_12DB
Definition DriverCommon.h:311
@ MIC_GAIN_18DB
Definition DriverCommon.h:313
@ MIC_GAIN_21DB
Definition DriverCommon.h:314
@ MIC_GAIN_3DB
Definition DriverCommon.h:308
i2s_format_t
Definition DriverCommon.h:250
@ I2S_RIGHT
Definition DriverCommon.h:253
@ I2S_DSP
Definition DriverCommon.h:254
@ I2S_LEFT
Definition DriverCommon.h:252
@ I2S_NORMAL
Definition DriverCommon.h:251
i2s_master_slave_t
Definition DriverCommon.h:203
@ MODE_MASTER
Definition DriverCommon.h:205
@ MODE_SLAVE
Definition DriverCommon.h:204
signal_t
Definition DriverCommon.h:262
@ SIGNAL_DIGITAL
Definition DriverCommon.h:263
@ SIGNAL_TDM
Definition DriverCommon.h:266
@ SIGNAL_PDM
Definition DriverCommon.h:265
@ SIGNAL_AMALOG
Definition DriverCommon.h:264
void * i2c_bus_handle_t
Definition DriverCommon.h:155
I2S interface parameters for the audio codec.
Definition DriverCommon.h:384
i2s_format_t fmt
Definition DriverCommon.h:386
samplerate_t rate
Definition DriverCommon.h:387
i2s_master_slave_t mode
Definition DriverCommon.h:385
channels_t channels
Definition DriverCommon.h:389
signal_t signal_type
Definition DriverCommon.h:390
sample_bits_t bits
Definition DriverCommon.h:388
Top-level codec configuration passed to the audio driver at init.
Definition DriverCommon.h:397
output_device_t output_device
Definition DriverCommon.h:399
I2SDefinition i2s
Definition DriverCommon.h:400
input_device_t input_device
Definition DriverCommon.h:398