Skip to content

Commit 5fe2266

Browse files
authored
Merge pull request #707 from Lesords/feat/hm1055
feat: add camera drivers for hm0360 and hm1055
2 parents 920996f + 64e8b61 commit 5fe2266

File tree

15 files changed

+2894
-1
lines changed

15 files changed

+2894
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
4141
sensors/sc030iot.c
4242
sensors/sc031gs.c
4343
sensors/mega_ccm.c
44+
sensors/hm1055.c
45+
sensors/hm0360.c
4446
)
4547

4648
list(APPEND priv_include_dirs

Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,22 @@ menu "Camera configuration"
116116
SC031GS is a global shutter CMOS sensor with high frame rate and single-frame HDR.
117117
Enable this option if you want to use the SC031GS.
118118
Disable this option to save memory.
119+
120+
config HM1055_SUPPORT
121+
bool "Support HM1055 VGA"
122+
default y
123+
help
124+
Enable this option if you want to use the HM1055.
125+
Disable this option to save memory.
126+
127+
config HM0360_SUPPORT
128+
bool "Support HM0360 VGA"
129+
default y
130+
help
131+
Enable this option if you want to use the HM0360.
132+
Disable this option to save memory.
133+
134+
config SCCB_I2C_PORT
119135

120136
config MEGA_CCM_SUPPORT
121137
bool "Support MEGA CCM 5MP"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ This repository hosts ESP32 series Soc compatible driver for image sensors. Addi
2929
| SC101IOT| 1280 x 720 | color | YUV/YCbCr422<br/>Raw RGB | 1/4.2" |
3030
| SC030IOT| 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer | 1/6.5" |
3131
| SC031GS | 640 x 480 | monochrome | RAW MONO<br/>Grayscale | 1/6" |
32+
| HM0360 | 656 x 496 | monochrome | RAW MONO<br/>Grayscale | 1/6" |
33+
| HM1055 | 1280 x 720 | color | 8/10-bit Raw<br/>YUV/YCbCr422<br/>RGB565/555/444 | 1/6" |
3234

3335
## Important to Remember
3436

driver/esp_camera.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@
7272
#if CONFIG_MEGA_CCM_SUPPORT
7373
#include "mega_ccm.h"
7474
#endif
75+
#if CONFIG_HM1055_SUPPORT
76+
#include "hm1055.h"
77+
#endif
78+
#if CONFIG_HM0360_SUPPORT
79+
#include "hm0360.h"
80+
#endif
7581

7682
#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG)
7783
#include "esp32-hal-log.h"
@@ -149,6 +155,12 @@ static const sensor_func_t g_sensors[] = {
149155
#if CONFIG_MEGA_CCM_SUPPORT
150156
{mega_ccm_detect, mega_ccm_init},
151157
#endif
158+
#if CONFIG_HM1055_SUPPORT
159+
{hm1055_detect, hm1055_init},
160+
#endif
161+
#if CONFIG_HM0360_SUPPORT
162+
{hm0360_detect, hm0360_init},
163+
#endif
152164
};
153165

154166
static esp_err_t camera_probe(const camera_config_t *config, camera_model_t *out_camera_model)

driver/include/sensor.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ typedef enum {
3232
SC030IOT_PID = 0x9a46,
3333
SC031GS_PID = 0x0031,
3434
MEGA_CCM_PID =0x039E,
35+
HM1055_PID = 0x0955,
36+
HM0360_PID = 0x0360
3537
} camera_pid_t;
3638

3739
typedef enum {
@@ -50,6 +52,8 @@ typedef enum {
5052
CAMERA_SC030IOT,
5153
CAMERA_SC031GS,
5254
CAMERA_MEGA_CCM,
55+
CAMERA_HM1055,
56+
CAMERA_HM0360,
5357
CAMERA_MODEL_MAX,
5458
CAMERA_NONE,
5559
} camera_model_t;
@@ -70,6 +74,8 @@ typedef enum {
7074
SC030IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1
7175
SC031GS_SCCB_ADDR = 0x30,
7276
MEGA_CCM_SCCB_ADDR = 0x1F, // 0x3E >> 1
77+
HM1055_SCCB_ADDR = 0x24,
78+
HM0360_SCCB_ADDR = 0x12,
7379
} camera_sccb_addr_t;
7480

7581
typedef enum {
@@ -82,6 +88,7 @@ typedef enum {
8288
PIXFORMAT_RAW, // RAW
8389
PIXFORMAT_RGB444, // 3BP2P/RGB444
8490
PIXFORMAT_RGB555, // 3BP2P/RGB555
91+
PIXFORMAT_RAW8, // RAW 8-bit
8592
} pixformat_t;
8693

8794
typedef enum {

driver/sensor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const camera_sensor_info_t camera_sensor[CAMERA_MODEL_MAX] = {
1818
{CAMERA_SC030IOT, "SC030IOT", SC030IOT_SCCB_ADDR, SC030IOT_PID, FRAMESIZE_VGA, false},
1919
{CAMERA_SC031GS, "SC031GS", SC031GS_SCCB_ADDR, SC031GS_PID, FRAMESIZE_VGA, false},
2020
{CAMERA_MEGA_CCM, "MEGA_CCM", MEGA_CCM_SCCB_ADDR, MEGA_CCM_PID, FRAMESIZE_5MP, true},
21+
{CAMERA_HM1055, "HM1055", HM1055_SCCB_ADDR, HM1055_PID, FRAMESIZE_HD, false},
22+
{CAMERA_HM0360, "HM0360", HM0360_SCCB_ADDR, HM0360_PID, FRAMESIZE_VGA, false},
2123
};
2224

2325
const resolution_info_t resolution[FRAMESIZE_INVALID] = {

0 commit comments

Comments
 (0)