From d73a3c01639437ff15ee57f1047f5e4dd54cb41b Mon Sep 17 00:00:00 2001 From: Kevincoooool <33611679+Kevincoooool@users.noreply.github.com> Date: Tue, 7 Dec 2021 16:12:48 +0800 Subject: [PATCH] Add KS-DIY esp32-s3 based camera series pin map --- components/modules/Kconfig | 2 + components/modules/camera/who_camera.h | 20 ++++++++++ .../main/include/app_peripherals.h | 40 ++++++++++++++++++- .../main/include/app_camera.h | 19 +++++++++ 4 files changed, 79 insertions(+), 2 deletions(-) diff --git a/components/modules/Kconfig b/components/modules/Kconfig index 3690c36..c036983 100644 --- a/components/modules/Kconfig +++ b/components/modules/Kconfig @@ -82,6 +82,8 @@ menu "ESP-WHO Configuration" bool "M5Stack Camera F (Wide)" config CAMERA_MODULE_AI_THINKER bool "ESP32-CAM by AI-Thinker" + config CAMERA_MODULE_S3_KS_DIY + bool "ESP32-S3-CAM by S3_KS-DIY" config CAMERA_MODULE_CUSTOM bool "Custom Camera Pinout" endchoice diff --git a/components/modules/camera/who_camera.h b/components/modules/camera/who_camera.h index 2b72ceb..e2c41f8 100644 --- a/components/modules/camera/who_camera.h +++ b/components/modules/camera/who_camera.h @@ -171,6 +171,26 @@ #define CAMERA_PIN_HREF 23 #define CAMERA_PIN_PCLK 22 +#elif CONFIG_CAMERA_MODULE_S3_KS_DIY +#define CAMERA_MODULE_NAME "S3_KS_DIY" +#define CAMERA_PIN_PWDN -4 +#define CAMERA_PIN_RESET -1 +#define CAMERA_PIN_XCLK -1 +#define CAMERA_PIN_SIOD 17 +#define CAMERA_PIN_SIOC 18 + +#define CAMERA_PIN_D7 39 +#define CAMERA_PIN_D6 41 +#define CAMERA_PIN_D5 42 +#define CAMERA_PIN_D4 5 +#define CAMERA_PIN_D3 40 +#define CAMERA_PIN_D2 14 +#define CAMERA_PIN_D1 47 +#define CAMERA_PIN_D0 45 +#define CAMERA_PIN_VSYNC 21 +#define CAMERA_PIN_HREF 38 +#define CAMERA_PIN_PCLK 48 + #elif CONFIG_CAMERA_MODULE_CUSTOM #define CAMERA_MODULE_NAME "CUSTOM" #define CAMERA_PIN_PWDN CONFIG_CAMERA_PIN_PWDN diff --git a/examples/code_recognition/main/include/app_peripherals.h b/examples/code_recognition/main/include/app_peripherals.h index d69f6d0..9d4b0f4 100644 --- a/examples/code_recognition/main/include/app_peripherals.h +++ b/examples/code_recognition/main/include/app_peripherals.h @@ -174,6 +174,25 @@ #define CAMERA_PIN_HREF 23 #define CAMERA_PIN_PCLK 22 +#elif CONFIG_CAMERA_MODULE_S3_KS_DIY +#define CAMERA_MODULE_NAME "S3_KS_DIY" +#define CAMERA_PIN_PWDN -1 +#define CAMERA_PIN_RESET -1 +#define CAMERA_PIN_XCLK -1 +#define CAMERA_PIN_SIOD 17 +#define CAMERA_PIN_SIOC 18 + +#define CAMERA_PIN_D7 39 +#define CAMERA_PIN_D6 41 +#define CAMERA_PIN_D5 42 +#define CAMERA_PIN_D4 5 +#define CAMERA_PIN_D3 40 +#define CAMERA_PIN_D2 14 +#define CAMERA_PIN_D1 47 +#define CAMERA_PIN_D0 45 +#define CAMERA_PIN_VSYNC 21 +#define CAMERA_PIN_HREF 38 +#define CAMERA_PIN_PCLK 48 #elif CONFIG_CAMERA_MODULE_CUSTOM #define CAMERA_MODULE_NAME "CUSTOM" #define CAMERA_PIN_PWDN CONFIG_CAMERA_PIN_PWDN @@ -197,8 +216,8 @@ #define XCLK_FREQ_HZ 20000000 #define CAMERA_PIXFORMAT PIXFORMAT_RGB565 -#define CAMERA_FRAME_SIZE FRAMESIZE_240X240 -#define CAMERA_FB_COUNT 2 +#define CAMERA_FRAME_SIZE FRAMESIZE_QVGA +#define CAMERA_FB_COUNT 1 @@ -232,6 +251,23 @@ #define LCD_WIDTH 240 #define LCD_HEIGHT 320 #define LCD_ROTATE SCR_SWAP_XY|SCR_MIRROR_X + +#elif CAMERA_MODULE_S3_KS_DIY +#define LCD_CONTROLLER SCREEN_CONTROLLER_ST7789 + +#define LCD_MOSI 11 +#define LCD_MISO 13 +#define LCD_SCLK 12 +#define LCD_CS 10 +#define LCD_DC 9 +#define LCD_RST -1 +#define LCD_BCKL -1 + +// LCD display width and height +#define LCD_WIDTH 240 +#define LCD_HEIGHT 320 +#define LCD_ROTATE SCR_SWAP_XY|SCR_MIRROR_X + #endif diff --git a/examples/single_chip/camera_web_server/main/include/app_camera.h b/examples/single_chip/camera_web_server/main/include/app_camera.h index 6a080be..661df8e 100755 --- a/examples/single_chip/camera_web_server/main/include/app_camera.h +++ b/examples/single_chip/camera_web_server/main/include/app_camera.h @@ -155,6 +155,25 @@ #define HREF_GPIO_NUM 23 #define PCLK_GPIO_NUM 22 +#elif CONFIG_CAMERA_MODULE_S3_KS_DIY +#define CAMERA_MODULE_NAME "S3_KS_DIY" +#define CAMERA_PIN_PWDN -4 +#define CAMERA_PIN_RESET -1 +#define CAMERA_PIN_XCLK -1 +#define CAMERA_PIN_SIOD 17 +#define CAMERA_PIN_SIOC 18 + +#define CAMERA_PIN_D7 39 +#define CAMERA_PIN_D6 41 +#define CAMERA_PIN_D5 42 +#define CAMERA_PIN_D4 5 +#define CAMERA_PIN_D3 40 +#define CAMERA_PIN_D2 14 +#define CAMERA_PIN_D1 47 +#define CAMERA_PIN_D0 45 +#define CAMERA_PIN_VSYNC 21 +#define CAMERA_PIN_HREF 38 +#define CAMERA_PIN_PCLK 48 #elif CONFIG_CAMERA_MODEL_CUSTOM #define CAM_BOARD "CUSTOM"