diff --git a/examples/motion_detection/main/Kconfig b/examples/motion_detection/main/Kconfig index 90f3769..0cfc94c 100644 --- a/examples/motion_detection/main/Kconfig +++ b/examples/motion_detection/main/Kconfig @@ -11,5 +11,13 @@ bool "ESP-S3-EYE DevKit" config CAMERA_MODULE_AI_THINKER bool "ESP32-CAM by AI-Thinker" + config CAMERA_WROVER_KIT + bool "WROVER_KIT" + config CAMERA_ESP32S3_WROOM + bool "ESP32S3_WROOM" + config CAMERA_ESP32S3_GOOUUU + bool "ESP32S3_GOOUUU" + config CAMERA_ESP32S3_XIAO + bool "ESP32S3_XIAO" endchoice endmenu diff --git a/examples/motion_detection/main/camera_pinout.h b/examples/motion_detection/main/camera_pinout.h new file mode 100644 index 0000000..e24ee7b --- /dev/null +++ b/examples/motion_detection/main/camera_pinout.h @@ -0,0 +1,134 @@ +// ESP-EYE +#ifdef CONFIG_CAMERA_MODULE_ESP_EYE +#define CAMERA_MODULE_NAME "ESP-EYE" +#define CAM_PIN_PWDN -1 //power down is not used +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_XCLK 4 +#define CAM_PIN_SIOD 18 +#define CAM_PIN_SIOC 23 +#define CAM_PIN_D7 36 +#define CAM_PIN_D6 37 +#define CAM_PIN_D5 38 +#define CAM_PIN_D4 39 +#define CAM_PIN_D3 35 +#define CAM_PIN_D2 14 +#define CAM_PIN_D1 13 +#define CAM_PIN_D0 34 +#define CAM_PIN_VSYNC 5 +#define CAM_PIN_HREF 27 +#define CAM_PIN_PCLK 25 +// ESP-S3-EYE +#elif CONFIG_CAMERA_MODULE_ESP_S3_EYE +#define CAMERA_MODULE_NAME "ESP-S3-EYE" +#define CAM_PIN_PWDN -1 //power down is not used +#define CAM_PIN_RESET -1 //software reset will be performed +#define CAM_PIN_XCLK 15 +#define CAM_PIN_SIOD 4 +#define CAM_PIN_SIOC 5 +#define CAM_PIN_D7 16 +#define CAM_PIN_D6 17 +#define CAM_PIN_D5 18 +#define CAM_PIN_D4 12 +#define CAM_PIN_D3 10 +#define CAM_PIN_D2 8 +#define CAM_PIN_D1 9 +#define CAM_PIN_D0 11 +#define CAM_PIN_VSYNC 6 +#define CAM_PIN_HREF 7 +#define CAM_PIN_PCLK 13 +// WROVER-KIT PIN Map +#elif CONFIG_CAMERA_WROVER_KIT +#define CAMERA_MODULE_NAME "ESP-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 +// ESP32S3 (WROOM) PIN Map +#elif CONFIG_CAMERA_ESP32S3_WROOM +#define CAMERA_MODULE_NAME "ESP-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 +// AI Thinker +#elif CONFIG_CAMERA_MODULE_AI_THINKER +#define CAMERA_MODULE_NAME "AI-THINKER" +#define CAM_PIN_PWDN 32 //power down is not used +#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 +// ESP32S3 (GOOUU TECH) +#elif CONFIG_CAMERA_ESP32S3_GOOUUU +#define CAMERA_MODULE_NAME "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 +// ESP32S3 (XIAO) +#elif CONFIG_CAMERA_ESP32S3_XIAO +#define CAMERA_MODULE_NAME "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/motion_detection/main/main.c b/examples/motion_detection/main/main.c index 7aef5f6..259b001 100644 --- a/examples/motion_detection/main/main.c +++ b/examples/motion_detection/main/main.c @@ -16,72 +16,7 @@ #include "esp_timer.h" #include "esp_camera.h" - -#ifdef CONFIG_CAMERA_MODULE_ESP_EYE -#define CAMERA_MODULE_NAME "ESP-EYE" - -#define CAM_PIN_PWDN -1 //power down is not used -#define CAM_PIN_RESET -1 //software reset will be performed -#define CAM_PIN_XCLK 4 -#define CAM_PIN_SIOD 18 -#define CAM_PIN_SIOC 23 - -#define CAM_PIN_D7 36 -#define CAM_PIN_D6 37 -#define CAM_PIN_D5 38 -#define CAM_PIN_D4 39 -#define CAM_PIN_D3 35 -#define CAM_PIN_D2 14 -#define CAM_PIN_D1 13 -#define CAM_PIN_D0 34 -#define CAM_PIN_VSYNC 5 -#define CAM_PIN_HREF 27 -#define CAM_PIN_PCLK 25 - -#elif CONFIG_CAMERA_MODULE_ESP_S3_EYE -#define CAMERA_MODULE_NAME "ESP-S3-EYE" - -#define CAM_PIN_PWDN -1 //power down is not used -#define CAM_PIN_RESET -1 //software reset will be performed -#define CAM_PIN_XCLK 15 -#define CAM_PIN_SIOD 4 -#define CAM_PIN_SIOC 5 - -#define CAM_PIN_D7 16 -#define CAM_PIN_D6 17 -#define CAM_PIN_D5 18 -#define CAM_PIN_D4 12 -#define CAM_PIN_D3 10 -#define CAM_PIN_D2 8 -#define CAM_PIN_D1 9 -#define CAM_PIN_D0 11 -#define CAM_PIN_VSYNC 6 -#define CAM_PIN_HREF 7 -#define CAM_PIN_PCLK 13 - -#elif CONFIG_CAMERA_MODULE_AI_THINKER - -#define CAMERA_MODULE_NAME "AI-THINKER" - -#define CAM_PIN_PWDN 32 //power down is not used -#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 // +#include "camera_pinout.h" #ifdef CONFIG_IDF_TARGET_ARCH_XTENSA