From b85b0661f5805493495c9cbd89f5a7f938cd7b0c Mon Sep 17 00:00:00 2001 From: Joshua Edward McLaughlin Cox Date: Sat, 11 Oct 2025 15:38:51 -0500 Subject: [PATCH 1/3] Adding esp32s3 XIAO pinout, and placing the pinouts in a separate header file in the hopes that someone else can utilize the same pinout header file in their project Signed-off-by: Joshua Edward McLaughlin Cox --- examples/camera_example/main/CMakeLists.txt | 2 +- examples/camera_example/main/camera_pinout.h | 102 +++++++++++++++++++ examples/camera_example/main/take_picture.c | 86 +--------------- 3 files changed, 106 insertions(+), 84 deletions(-) create mode 100644 examples/camera_example/main/camera_pinout.h diff --git a/examples/camera_example/main/CMakeLists.txt b/examples/camera_example/main/CMakeLists.txt index b3b4892124..0e387bc40a 100644 --- a/examples/camera_example/main/CMakeLists.txt +++ b/examples/camera_example/main/CMakeLists.txt @@ -1,3 +1,3 @@ -idf_component_register(SRCS take_picture.c +idf_component_register(SRCS take_picture.c camera_pinout.h PRIV_INCLUDE_DIRS . PRIV_REQUIRES nvs_flash esp_psram) diff --git a/examples/camera_example/main/camera_pinout.h b/examples/camera_example/main/camera_pinout.h new file mode 100644 index 0000000000..977466cbd2 --- /dev/null +++ b/examples/camera_example/main/camera_pinout.h @@ -0,0 +1,102 @@ +// WROVER-KIT PIN Map +#ifdef BOARD_WROVER_KIT + +#define CAM_PIN_PWDN -1 //power down is not used +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_XCLK 21 +#define CAM_PIN_SIOD 26 +#define CAM_PIN_SIOC 27 + +#define CAM_PIN_D7 35 +#define CAM_PIN_D6 34 +#define CAM_PIN_D5 39 +#define CAM_PIN_D4 36 +#define CAM_PIN_D3 19 +#define CAM_PIN_D2 18 +#define CAM_PIN_D1 5 +#define CAM_PIN_D0 4 +#define CAM_PIN_VSYNC 25 +#define CAM_PIN_HREF 23 +#define CAM_PIN_PCLK 22 + +#endif + +// ESP32Cam (AiThinker) PIN Map +#ifdef BOARD_ESP32CAM_AITHINKER + +#define CAM_PIN_PWDN 32 +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_XCLK 0 +#define CAM_PIN_SIOD 26 +#define CAM_PIN_SIOC 27 + +#define CAM_PIN_D7 35 +#define CAM_PIN_D6 34 +#define CAM_PIN_D5 39 +#define CAM_PIN_D4 36 +#define CAM_PIN_D3 21 +#define CAM_PIN_D2 19 +#define CAM_PIN_D1 18 +#define CAM_PIN_D0 5 +#define CAM_PIN_VSYNC 25 +#define CAM_PIN_HREF 23 +#define CAM_PIN_PCLK 22 + +#endif +// ESP32S3 (WROOM) PIN Map +#ifdef BOARD_ESP32S3_WROOM +#define CAM_PIN_PWDN 38 +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_VSYNC 6 +#define CAM_PIN_HREF 7 +#define CAM_PIN_PCLK 13 +#define CAM_PIN_XCLK 15 +#define CAM_PIN_SIOD 4 +#define CAM_PIN_SIOC 5 +#define CAM_PIN_D0 11 +#define CAM_PIN_D1 9 +#define CAM_PIN_D2 8 +#define CAM_PIN_D3 10 +#define CAM_PIN_D4 12 +#define CAM_PIN_D5 18 +#define CAM_PIN_D6 17 +#define CAM_PIN_D7 16 +#endif +// ESP32S3 (GOOUU TECH) +#ifdef BOARD_ESP32S3_GOOUUU +#define CAM_PIN_PWDN -1 +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_VSYNC 6 +#define CAM_PIN_HREF 7 +#define CAM_PIN_PCLK 13 +#define CAM_PIN_XCLK 15 +#define CAM_PIN_SIOD 4 +#define CAM_PIN_SIOC 5 +#define CAM_PIN_D0 11 +#define CAM_PIN_D1 9 +#define CAM_PIN_D2 8 +#define CAM_PIN_D3 10 +#define CAM_PIN_D4 12 +#define CAM_PIN_D5 18 +#define CAM_PIN_D6 17 +#define CAM_PIN_D7 16 +#endif +// ESP32S3 (GOOUU TECH) +#ifdef BOARD_ESP32S3_XIAO +#define CAM_PIN_PWDN -1 +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_VSYNC 38 +#define CAM_PIN_HREF 47 +#define CAM_PIN_PCLK 13 +#define CAM_PIN_XCLK 10 +#define CAM_PIN_SIOD 40 +#define CAM_PIN_SIOC 39 +#define CAM_PIN_D0 15 +#define CAM_PIN_D1 17 +#define CAM_PIN_D2 18 +#define CAM_PIN_D3 16 +#define CAM_PIN_D4 14 +#define CAM_PIN_D5 12 +#define CAM_PIN_D6 11 +#define CAM_PIN_D7 48 +#endif diff --git a/examples/camera_example/main/take_picture.c b/examples/camera_example/main/take_picture.c index f9df7f7b1a..1afa01d899 100644 --- a/examples/camera_example/main/take_picture.c +++ b/examples/camera_example/main/take_picture.c @@ -7,7 +7,8 @@ // 1. Board setup (Uncomment): // #define BOARD_WROVER_KIT // #define BOARD_ESP32CAM_AITHINKER -// #define BOARD_ESP32S3_WROOM +//#define BOARD_ESP32S3_WROOM +#define BOARD_ESP32S3_XIAO // #define BOARD_ESP32S3_GOOUUU /** @@ -49,89 +50,8 @@ #define BOARD_WROVER_KIT 1 -// WROVER-KIT PIN Map -#ifdef BOARD_WROVER_KIT - -#define CAM_PIN_PWDN -1 //power down is not used -#define CAM_PIN_RESET -1 //software reset will be performed -#define CAM_PIN_XCLK 21 -#define CAM_PIN_SIOD 26 -#define CAM_PIN_SIOC 27 - -#define CAM_PIN_D7 35 -#define CAM_PIN_D6 34 -#define CAM_PIN_D5 39 -#define CAM_PIN_D4 36 -#define CAM_PIN_D3 19 -#define CAM_PIN_D2 18 -#define CAM_PIN_D1 5 -#define CAM_PIN_D0 4 -#define CAM_PIN_VSYNC 25 -#define CAM_PIN_HREF 23 -#define CAM_PIN_PCLK 22 +#include "camera_pinout.h" -#endif - -// ESP32Cam (AiThinker) PIN Map -#ifdef BOARD_ESP32CAM_AITHINKER - -#define CAM_PIN_PWDN 32 -#define CAM_PIN_RESET -1 //software reset will be performed -#define CAM_PIN_XCLK 0 -#define CAM_PIN_SIOD 26 -#define CAM_PIN_SIOC 27 - -#define CAM_PIN_D7 35 -#define CAM_PIN_D6 34 -#define CAM_PIN_D5 39 -#define CAM_PIN_D4 36 -#define CAM_PIN_D3 21 -#define CAM_PIN_D2 19 -#define CAM_PIN_D1 18 -#define CAM_PIN_D0 5 -#define CAM_PIN_VSYNC 25 -#define CAM_PIN_HREF 23 -#define CAM_PIN_PCLK 22 - -#endif -// ESP32S3 (WROOM) PIN Map -#ifdef BOARD_ESP32S3_WROOM -#define CAM_PIN_PWDN 38 -#define CAM_PIN_RESET -1 //software reset will be performed -#define CAM_PIN_VSYNC 6 -#define CAM_PIN_HREF 7 -#define CAM_PIN_PCLK 13 -#define CAM_PIN_XCLK 15 -#define CAM_PIN_SIOD 4 -#define CAM_PIN_SIOC 5 -#define CAM_PIN_D0 11 -#define CAM_PIN_D1 9 -#define CAM_PIN_D2 8 -#define CAM_PIN_D3 10 -#define CAM_PIN_D4 12 -#define CAM_PIN_D5 18 -#define CAM_PIN_D6 17 -#define CAM_PIN_D7 16 -#endif -// ESP32S3 (GOOUU TECH) -#ifdef BOARD_ESP32S3_GOOUUU -#define CAM_PIN_PWDN -1 -#define CAM_PIN_RESET -1 //software reset will be performed -#define CAM_PIN_VSYNC 6 -#define CAM_PIN_HREF 7 -#define CAM_PIN_PCLK 13 -#define CAM_PIN_XCLK 15 -#define CAM_PIN_SIOD 4 -#define CAM_PIN_SIOC 5 -#define CAM_PIN_D0 11 -#define CAM_PIN_D1 9 -#define CAM_PIN_D2 8 -#define CAM_PIN_D3 10 -#define CAM_PIN_D4 12 -#define CAM_PIN_D5 18 -#define CAM_PIN_D6 17 -#define CAM_PIN_D7 16 -#endif static const char *TAG = "example:take_picture"; #if ESP_CAMERA_SUPPORTED From 019bdbeb0c83623e3839ed9d0d69525a8f4107a7 Mon Sep 17 00:00:00 2001 From: Joshua Edward McLaughlin Cox Date: Sat, 11 Oct 2025 15:53:12 -0500 Subject: [PATCH 2/3] Correcting comment above the XIAO block Signed-off-by: Joshua Edward McLaughlin Cox --- examples/camera_example/main/camera_pinout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/camera_example/main/camera_pinout.h b/examples/camera_example/main/camera_pinout.h index 977466cbd2..97b5d2fd36 100644 --- a/examples/camera_example/main/camera_pinout.h +++ b/examples/camera_example/main/camera_pinout.h @@ -81,7 +81,7 @@ #define CAM_PIN_D6 17 #define CAM_PIN_D7 16 #endif -// ESP32S3 (GOOUU TECH) +// ESP32S3 (XIAO) #ifdef BOARD_ESP32S3_XIAO #define CAM_PIN_PWDN -1 #define CAM_PIN_RESET -1 //software reset will be performed From 57c3282594e5821963545a13b518ed1fc555e456 Mon Sep 17 00:00:00 2001 From: Joshua Edward McLaughlin Cox Date: Thu, 23 Oct 2025 18:12:53 -0500 Subject: [PATCH 3/3] review changes Signed-off-by: Joshua Edward McLaughlin Cox --- examples/camera_example/main/CMakeLists.txt | 2 +- examples/camera_example/main/take_picture.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/camera_example/main/CMakeLists.txt b/examples/camera_example/main/CMakeLists.txt index 0e387bc40a..b3b4892124 100644 --- a/examples/camera_example/main/CMakeLists.txt +++ b/examples/camera_example/main/CMakeLists.txt @@ -1,3 +1,3 @@ -idf_component_register(SRCS take_picture.c camera_pinout.h +idf_component_register(SRCS take_picture.c PRIV_INCLUDE_DIRS . PRIV_REQUIRES nvs_flash esp_psram) diff --git a/examples/camera_example/main/take_picture.c b/examples/camera_example/main/take_picture.c index 1afa01d899..fa4ff82250 100644 --- a/examples/camera_example/main/take_picture.c +++ b/examples/camera_example/main/take_picture.c @@ -7,8 +7,8 @@ // 1. Board setup (Uncomment): // #define BOARD_WROVER_KIT // #define BOARD_ESP32CAM_AITHINKER -//#define BOARD_ESP32S3_WROOM -#define BOARD_ESP32S3_XIAO +// #define BOARD_ESP32S3_WROOM +// #define BOARD_ESP32S3_XIAO // #define BOARD_ESP32S3_GOOUUU /**