Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add camera drivers for hm0360 and hm1055 #707

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
sensors/sc101iot.c
sensors/sc030iot.c
sensors/sc031gs.c
sensors/hm1055.c
sensors/hm0360.c
)

list(APPEND priv_include_dirs
Expand Down
16 changes: 16 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ menu "Camera configuration"
SC031GS is a global shutter CMOS sensor with high frame rate and single-frame HDR.
Enable this option if you want to use the SC031GS.
Disable this option to save memory.

config HM1055_SUPPORT
bool "Support HM1055 VGA"
default y
help
Enable this option if you want to use the HM1055.
Disable this option to save memory.

config HM0360_SUPPORT
bool "Support HM0360 VGA"
default y
help
Enable this option if you want to use the HM0360.
Disable this option to save memory.

config SCCB_I2C_PORT

choice SCCB_HARDWARE_I2C_PORT
bool "I2C peripheral to use for SCCB"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ This repository hosts ESP32 series Soc compatible driver for image sensors. Addi
| SC101IOT| 1280 x 720 | color | YUV/YCbCr422<br/>Raw RGB | 1/4.2" |
| SC030IOT| 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer | 1/6.5" |
| SC031GS | 640 x 480 | monochrome | RAW MONO<br/>Grayscale | 1/6" |
| HM0360 | 656 x 496 | monochrome | RAW MONO<br/>Grayscale | 1/6" |
| HM1055 | 1280 x 720 | color | 8/10-bit Raw<br/>YUV/YCbCr422<br/>RGB565/555/444 | 1/6" |

## Important to Remember

Expand Down
12 changes: 12 additions & 0 deletions driver/esp_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
#if CONFIG_SC031GS_SUPPORT
#include "sc031gs.h"
#endif
#if CONFIG_HM1055_SUPPORT
#include "hm1055.h"
#endif
#if CONFIG_HM0360_SUPPORT
#include "hm0360.h"
#endif

#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG)
#include "esp32-hal-log.h"
Expand Down Expand Up @@ -143,6 +149,12 @@ static const sensor_func_t g_sensors[] = {
#if CONFIG_SC031GS_SUPPORT
{sc031gs_detect, sc031gs_init},
#endif
#if CONFIG_HM1055_SUPPORT
{hm1055_detect, hm1055_init},
#endif
#if CONFIG_HM0360_SUPPORT
{hm0360_detect, hm0360_init},
#endif
};

static esp_err_t camera_probe(const camera_config_t *config, camera_model_t *out_camera_model)
Expand Down
7 changes: 7 additions & 0 deletions driver/include/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ typedef enum {
SC101IOT_PID = 0xda4a,
SC030IOT_PID = 0x9a46,
SC031GS_PID = 0x0031,
HM1055_PID = 0x0955,
HM0360_PID = 0x0360
} camera_pid_t;

typedef enum {
Expand All @@ -48,6 +50,8 @@ typedef enum {
CAMERA_SC101IOT,
CAMERA_SC030IOT,
CAMERA_SC031GS,
CAMERA_HM1055,
CAMERA_HM0360,
CAMERA_MODEL_MAX,
CAMERA_NONE,
} camera_model_t;
Expand All @@ -67,6 +71,8 @@ typedef enum {
SC101IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1
SC030IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1
SC031GS_SCCB_ADDR = 0x30,
HM1055_SCCB_ADDR = 0x24,
HM0360_SCCB_ADDR = 0x12,
} camera_sccb_addr_t;

typedef enum {
Expand All @@ -79,6 +85,7 @@ typedef enum {
PIXFORMAT_RAW, // RAW
PIXFORMAT_RGB444, // 3BP2P/RGB444
PIXFORMAT_RGB555, // 3BP2P/RGB555
PIXFORMAT_RAW8, // RAW 8-bit
} pixformat_t;

typedef enum {
Expand Down
2 changes: 2 additions & 0 deletions driver/sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const camera_sensor_info_t camera_sensor[CAMERA_MODEL_MAX] = {
{CAMERA_SC101IOT, "SC101IOT", SC101IOT_SCCB_ADDR, SC101IOT_PID, FRAMESIZE_HD, false},
{CAMERA_SC030IOT, "SC030IOT", SC030IOT_SCCB_ADDR, SC030IOT_PID, FRAMESIZE_VGA, false},
{CAMERA_SC031GS, "SC031GS", SC031GS_SCCB_ADDR, SC031GS_PID, FRAMESIZE_VGA, false},
{CAMERA_HM1055, "HM1055", HM1055_SCCB_ADDR, HM1055_PID, FRAMESIZE_HD, false},
{CAMERA_HM0360, "HM0360", HM0360_SCCB_ADDR, HM0360_PID, FRAMESIZE_VGA, false},
};

const resolution_info_t resolution[FRAMESIZE_INVALID] = {
Expand Down
Loading