From 4b82389a810f3b36f2a65d92f895d91d0cb7c9ce Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 8 Aug 2022 22:40:28 +0200 Subject: [PATCH 1/2] support `CONFIG_CAMERA_CONVERTER_ENABLED` --- .../esp32-camera/driver/include/esp_camera.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/libesp32/esp32-camera/driver/include/esp_camera.h b/lib/libesp32/esp32-camera/driver/include/esp_camera.h index e9981671f..14fdd2378 100644 --- a/lib/libesp32/esp32-camera/driver/include/esp_camera.h +++ b/lib/libesp32/esp32-camera/driver/include/esp_camera.h @@ -70,6 +70,7 @@ #include "driver/ledc.h" #include "sensor.h" #include "sys/time.h" +#include "sdkconfig.h" #ifdef __cplusplus extern "C" { @@ -91,6 +92,19 @@ typedef enum { CAMERA_FB_IN_DRAM /*!< Frame buffer is placed in internal DRAM */ } camera_fb_location_t; +#if CONFIG_CAMERA_CONVERTER_ENABLED +/** + * @brief Camera RGB\YUV conversion mode + */ +typedef enum { + CONV_DISABLE, + RGB565_TO_YUV422, + + YUV422_TO_RGB565, + YUV422_TO_YUV420 +} camera_conv_mode_t; +#endif + /** * @brief Configuration structure for camera initialization */ @@ -124,6 +138,9 @@ typedef struct { size_t fb_count; /*!< Number of frame buffers to be allocated. If more than one, then each frame will be acquired (double speed) */ camera_fb_location_t fb_location; /*!< The location where the frame buffer will be allocated */ camera_grab_mode_t grab_mode; /*!< When buffers should be filled */ +#if CONFIG_CAMERA_CONVERTER_ENABLED + camera_conv_mode_t conv_mode; /*!< RGB<->YUV Conversion mode */ +#endif } camera_config_t; /** From ceed6525ec0114f7bcdd4e6f253f7567c9d66622 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 8 Aug 2022 22:42:15 +0200 Subject: [PATCH 2/2] add cameras --- lib/libesp32/esp32-camera/driver/include/sensor.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/libesp32/esp32-camera/driver/include/sensor.h b/lib/libesp32/esp32-camera/driver/include/sensor.h index 1f99c1541..d5ec7463f 100644 --- a/lib/libesp32/esp32-camera/driver/include/sensor.h +++ b/lib/libesp32/esp32-camera/driver/include/sensor.h @@ -26,6 +26,10 @@ typedef enum { GC2145_PID = 0x2145, GC032A_PID = 0x232a, GC0308_PID = 0x9b, + BF3005_PID = 0x30, + BF20A6_PID = 0x20a6, + SC101IOT_PID = 0xda4a, + SC030IOT_PID = 0x9a46, } camera_pid_t; typedef enum { @@ -38,6 +42,10 @@ typedef enum { CAMERA_GC2145, CAMERA_GC032A, CAMERA_GC0308, + CAMERA_BF3005, + CAMERA_BF20A6, + CAMERA_SC101IOT, + CAMERA_SC030IOT, CAMERA_MODEL_MAX, CAMERA_NONE, } camera_model_t; @@ -52,11 +60,16 @@ typedef enum { GC2145_SCCB_ADDR = 0x3C,// 0x78 >> 1 GC032A_SCCB_ADDR = 0x21,// 0x42 >> 1 GC0308_SCCB_ADDR = 0x21,// 0x42 >> 1 + BF3005_SCCB_ADDR = 0x6E, + BF20A6_SCCB_ADDR = 0x6E, + SC101IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 + SC030IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 } camera_sccb_addr_t; typedef enum { PIXFORMAT_RGB565, // 2BPP/RGB565 PIXFORMAT_YUV422, // 2BPP/YUV422 + PIXFORMAT_YUV420, // 1.5BPP/YUV420 PIXFORMAT_GRAYSCALE, // 1BPP/GRAYSCALE PIXFORMAT_JPEG, // JPEG/COMPRESSED PIXFORMAT_RGB888, // 3BPP/RGB888