13 #ifndef CONFIG_CHECK_ESP32_H
14 #define CONFIG_CHECK_ESP32_H
105 #error This header should be included for ESP32 architecture, only
108 #include "disable_2pinmode_on_github_workflow.h"
109 #if !defined(MOZZI_AUDIO_MODE)
110 # if CONFIG_IDF_TARGET_ESP32
111 # define MOZZI_AUDIO_MODE MOZZI_OUTPUT_INTERNAL_DAC
113 # define MOZZI_AUDIO_MODE MOZZI_OUTPUT_PWM
116 MOZZI_CHECK_SUPPORTED(
MOZZI_AUDIO_MODE, MOZZI_OUTPUT_EXTERNAL_TIMED, MOZZI_OUTPUT_EXTERNAL_CUSTOM, MOZZI_OUTPUT_PDM_VIA_I2S, MOZZI_OUTPUT_I2S_DAC, MOZZI_OUTPUT_INTERNAL_DAC, MOZZI_OUTPUT_PWM)
118 #if !defined(MOZZI_AUDIO_RATE)
119 #define MOZZI_AUDIO_RATE 32768
122 #if defined(MOZZI_PWM_RATE)
123 #error Configuration of MOZZI_PWM_RATE is not currently supported on this platform (always same as MOZZI_AUDIO_RATE)
126 #if !defined(MOZZI_ANALOG_READ)
127 # define MOZZI_ANALOG_READ MOZZI_ANALOG_READ_NONE
133 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_I2S_DAC)
134 # if !defined(MOZZI_I2S_FORMAT)
135 # define MOZZI_I2S_FORMAT MOZZI_I2S_FORMAT_PLAIN
137 # if !defined(MOZZI_I2S_PIN_BCK)
138 # define MOZZI_I2S_PIN_BCK 26
140 # if !defined(MOZZI_I2S_PIN_WS)
141 # define MOZZI_I2S_PIN_WS 25
143 # if !defined(MOZZI_I2S_PIN_DATA)
144 # define MOZZI_I2S_PIN_DATA 33
146 # if !defined(MOZZI_I2S_PIN_MCLK)
147 # define MOZZI_I2S_PIN_MCLK I2S_GPIO_UNUSED
149 # if !defined(MOZZI_I2S_BCK_INV)
150 # define MOZZI_I2S_BCK_INV 0
152 # if !defined(MOZZI_I2S_WS_INV)
153 # if MOZZI_IS(MOZZI_I2S_FORMAT, MOZZI_I2S_FORMAT_PLAIN)
154 # define MOZZI_I2S_WS_INV 0
155 # elif MOZZI_IS(MOZZI_I2S_FORMAT, MOZZI_I2S_FORMAT_LSBJ)
156 # define MOZZI_I2S_WS_INV 1
159 # if !defined(MOZZI_I2S_MBCK_INV)
160 # define MOZZI_I2S_MBCK_INV 0
164 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_I2S_DAC, MOZZI_OUTPUT_PDM_VIA_I2S)
165 # if !defined(MOZZI_I2S_FORMAT)
166 # define MOZZI_I2S_FORMAT MOZZI_I2S_FORMAT_PLAIN
168 # if !defined(MOZZI_I2S_PIN_BCK)
169 # define MOZZI_I2S_PIN_BCK I2S_GPIO_UNUSED
171 # if !defined(MOZZI_I2S_PIN_WS)
172 # define MOZZI_I2S_PIN_WS I2S_GPIO_UNUSED
174 # if !defined(MOZZI_I2S_PIN_DATA)
175 # define MOZZI_I2S_PIN_DATA 33
177 # if !defined(MOZZI_I2S_PIN_MCLK)
178 # define MOZZI_I2S_PIN_MCLK I2S_GPIO_UNUSED
180 # define MOZZI_I2S_WS_INV 0
181 # define MOZZI_I2S_BCK_INV 0
182 # define MOZZI_I2S_MBCK_INV 0
185 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_I2S_DAC, MOZZI_OUTPUT_PDM_VIA_I2S)
187 # if !defined(MOZZI_IS2_PORT)
188 # define MOZZI_I2S_PORT I2S_NUM_0
192 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PWM)
193 # define MOZZI_AUDIO_BITS 10
194 # if !defined(MOZZI_AUDIO_PIN_1)
195 # define MOZZI_AUDIO_PIN_1 15
197 # if !defined(MOZZI_AUDIO_PIN_2)
198 # define MOZZI_AUDIO_PIN_2 16
202 #if !defined(MOZZI_AUDIO_BITS)
203 # if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_INTERNAL_DAC)
204 # define MOZZI_AUDIO_BITS 8
206 # define MOZZI_AUDIO_BITS 16
210 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PDM_VIA_I2S)
211 # define MOZZI_I2S_FORMAT MOZZI_I2S_FORMAT_LSBJ
212 # if !defined(MOZZI_PDM_RESOLUTION)
213 # define MOZZI_PDM_RESOLUTION 8
216 # define MOZZI_PDM_RESOLUTION 1
221 #if !MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_EXTERNAL_TIMED, MOZZI_OUTPUT_INTERNAL_DAC, MOZZI_OUTPUT_PWM)
222 # define BYPASS_MOZZI_OUTPUT_BUFFER true
225 #define MOZZI__INTERNAL_ANALOG_READ_RESOLUTION 12
#define MOZZI_AUDIO_INPUT
Whether to enable built in audio input feature.
#define MOZZI_AUDIO_MODE
Configure how Mozzi outputs generated sounds.
#define MOZZI_ANALOG_READ
Whether to compile in support for non-blocking analog reads.