diff --git a/platformio.ini b/platformio.ini index 80aa00b..b214474 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,6 +10,7 @@ [platformio] default_envs = tinypico, lolin32 +; default_envs = esp32-s3-devkitc-1_DIY1, esp32dev_DIY1 extra_configs = platformio_override.ini @@ -32,3 +33,46 @@ board = lolin32 platform = espressif32@3.4.0 build_flags = -Ofast -D USE_I2S_MIC_INPUT -D USE_ESP_NOW lib_ignore = indicator_led_pico + +[env:esp32dev_DIY1] +board = esp32dev +platform = espressif32@3.4.0 +build_flags = -Ofast + -D USE_I2S_MIC_INPUT + -D USE_ESP_NOW + -D I2S_MIC_SERIAL_CLOCK=GPIO_NUM_22 + -D I2S_MIC_LEFT_RIGHT_CLOCK=GPIO_NUM_21 + -D I2S_MIC_SERIAL_DATA=GPIO_NUM_23 + -D I2S_SPEAKER_SERIAL_CLOCK=GPIO_NUM_22 + -D I2S_SPEAKER_LEFT_RIGHT_CLOCK=GPIO_NUM_21 + -D I2S_SPEAKER_SERIAL_DATA=GPIO_NUM_4 + -D I2S_SPEAKER_SD_PIN=-1 + -D GPIO_TRANSMIT_BUTTON=GPIO_NUM_33 +lib_ignore = indicator_led_pico + +monitor_port = COM3 +upload_port = COM3 +upload_speed = 921600 + +[env:esp32-s3-devkitc-1_DIY1] +board = esp32-s3-devkitc-1 +## https://github.com/espressif/arduino-esp32/issues/7165#issuecomment-1222912986 +platform = https://github.com/Jason2866/platform-espressif32.git +build_flags = -Ofast + -D USE_I2S_MIC_INPUT + -D USE_ESP_NOW + -D I2S_MIC_SERIAL_CLOCK=GPIO_NUM_7 + -D I2S_MIC_LEFT_RIGHT_CLOCK=GPIO_NUM_6 + -D I2S_MIC_SERIAL_DATA=GPIO_NUM_4 + -D I2S_SPEAKER_SERIAL_CLOCK=GPIO_NUM_7 + -D I2S_SPEAKER_LEFT_RIGHT_CLOCK=GPIO_NUM_6 + -D I2S_SPEAKER_SERIAL_DATA=GPIO_NUM_5 + -D I2S_SPEAKER_SD_PIN=-1 + -D GPIO_TRANSMIT_BUTTON=GPIO_NUM_15 +lib_ignore = indicator_led_pico + +monitor_port = COM20 ; COM work +upload_port = COM20 ; COM +;monitor_port = COM26 ; USB home +;upload_port = COM26 ; USB +upload_speed = 921600 diff --git a/src/config.h b/src/config.h index 7b6d047..eb731a2 100644 --- a/src/config.h +++ b/src/config.h @@ -18,23 +18,39 @@ // Generally they will default to LEFT - but you may need to attach the L/R pin to GND #define I2S_MIC_CHANNEL I2S_CHANNEL_FMT_ONLY_LEFT // #define I2S_MIC_CHANNEL I2S_CHANNEL_FMT_ONLY_RIGHT +#ifndef I2S_MIC_SERIAL_CLOCK #define I2S_MIC_SERIAL_CLOCK GPIO_NUM_18 +#endif +#ifndef I2S_MIC_LEFT_RIGHT_CLOCK #define I2S_MIC_LEFT_RIGHT_CLOCK GPIO_NUM_19 +#endif +#ifndef I2S_MIC_SERIAL_DATA #define I2S_MIC_SERIAL_DATA GPIO_NUM_21 +#endif // Analog Microphone Settings - ADC1_CHANNEL_7 is GPIO35 #define ADC_MIC_CHANNEL ADC1_CHANNEL_7 // speaker settings #define USE_I2S_SPEAKER_OUTPUT +#ifndef I2S_SPEAKER_SERIAL_CLOCK #define I2S_SPEAKER_SERIAL_CLOCK GPIO_NUM_18 +#endif +#ifndef I2S_SPEAKER_LEFT_RIGHT_CLOCK #define I2S_SPEAKER_LEFT_RIGHT_CLOCK GPIO_NUM_19 +#endif +#ifndef I2S_SPEAKER_SERIAL_DATA #define I2S_SPEAKER_SERIAL_DATA GPIO_NUM_5 +#endif // Shutdown line if you have this wired up or -1 if you don't +#ifndef I2S_SPEAKER_SD_PIN #define I2S_SPEAKER_SD_PIN GPIO_NUM_22 +#endif // transmit button +#ifndef GPIO_TRANSMIT_BUTTON #define GPIO_TRANSMIT_BUTTON 23 +#endif // Which LED pin do you want to use? TinyPico LED or the builtin LED of a generic ESP32 board? // Comment out this line to use the builtin LED of a generic ESP32 board