Skip to content

Commit b92c58d

Browse files
authored
M5Stack's product offering includes various ESP32-based camera devices. (#4030)
They are all broadly similar, all being based on the ESP32-D0WD core, but have some subtle differences between variants around PSRAM inclusion and camera pin mappings. The ESP32CAM "unit" product (SKU: U007) has no PSRAM and maps the "Pixel Data 0" (Y2 GPIO/OV2640 D2) camera pin to IO17 rather than IO32 as is the case with most other M5Stack ESP32 camera devices. The ESP32CAM also requires the "hmirror" and "vflip" camera configuration bits setting in order to capture a true image. The relevant M5Stack pin configuration documentation can be found here: https://docs.m5stack.com/#/en/unit/esp32cam?id=pinmap
1 parent 35d9759 commit b92c58d

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ tools/mkspiffs/mkspiffs.exe
1212
.vs/
1313
__vm/
1414
*.vcxproj*
15+
.vscode/

Diff for: libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
//#define CAMERA_MODEL_ESP_EYE // Has PSRAM
1313
//#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM
1414
//#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM
15-
//#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM
15+
//#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM
16+
//#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM
1617
//#define CAMERA_MODEL_AI_THINKER // Has PSRAM
1718
//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM
1819

@@ -84,7 +85,7 @@ void setup() {
8485
// drop down frame size for higher initial frame rate
8586
s->set_framesize(s, FRAMESIZE_QVGA);
8687

87-
#if defined(CAMERA_MODEL_M5STACK_WIDE)
88+
#if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)
8889
s->set_vflip(s, 1);
8990
s->set_hmirror(s, 1);
9091
#endif

Diff for: libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h

+19
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,25 @@
9494
#define HREF_GPIO_NUM 26
9595
#define PCLK_GPIO_NUM 21
9696

97+
#elif defined(CAMERA_MODEL_M5STACK_ESP32CAM)
98+
#define PWDN_GPIO_NUM -1
99+
#define RESET_GPIO_NUM 15
100+
#define XCLK_GPIO_NUM 27
101+
#define SIOD_GPIO_NUM 25
102+
#define SIOC_GPIO_NUM 23
103+
104+
#define Y9_GPIO_NUM 19
105+
#define Y8_GPIO_NUM 36
106+
#define Y7_GPIO_NUM 18
107+
#define Y6_GPIO_NUM 39
108+
#define Y5_GPIO_NUM 5
109+
#define Y4_GPIO_NUM 34
110+
#define Y3_GPIO_NUM 35
111+
#define Y2_GPIO_NUM 17
112+
#define VSYNC_GPIO_NUM 22
113+
#define HREF_GPIO_NUM 26
114+
#define PCLK_GPIO_NUM 21
115+
97116
#elif defined(CAMERA_MODEL_AI_THINKER)
98117
#define PWDN_GPIO_NUM 32
99118
#define RESET_GPIO_NUM -1

0 commit comments

Comments
 (0)