From 5811bcb0a62010a10be364caafad0e2b0a26e17a Mon Sep 17 00:00:00 2001 From: Ihor Nehrutsa Date: Wed, 24 May 2023 21:00:40 +0300 Subject: [PATCH 1/2] Add esp32dev and esp32-s3-devkitc-1 boards --- platformio.ini | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/config.h | 16 ++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/platformio.ini b/platformio.ini index 80aa00b..259a04c 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 +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 +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 + +## https://github.com/espressif/arduino-esp32/issues/7165#issuecomment-1222912986 +platform = https://github.com/Jason2866/platform-espressif32.git + +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 From 049b0cbb8825a3befd6b71b4a2b79344e5a30c40 Mon Sep 17 00:00:00 2001 From: Ihor Nehrutsa Date: Thu, 25 May 2023 11:43:38 +0300 Subject: [PATCH 2/2] Update platformio.ini --- platformio.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index 259a04c..b214474 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,7 +10,7 @@ [platformio] default_envs = tinypico, lolin32 -;default_envs = esp32-s3-devkitc-1_DIY1, esp32dev_DIY1 +; default_envs = esp32-s3-devkitc-1_DIY1, esp32dev_DIY1 extra_configs = platformio_override.ini @@ -36,6 +36,7 @@ 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 @@ -55,6 +56,8 @@ 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 @@ -68,9 +71,6 @@ build_flags = -Ofast -D GPIO_TRANSMIT_BUTTON=GPIO_NUM_15 lib_ignore = indicator_led_pico -## https://github.com/espressif/arduino-esp32/issues/7165#issuecomment-1222912986 -platform = https://github.com/Jason2866/platform-espressif32.git - monitor_port = COM20 ; COM work upload_port = COM20 ; COM ;monitor_port = COM26 ; USB home