Skip to content

Commit

Permalink
Added M5Stack UnitCamS3
Browse files Browse the repository at this point in the history
  • Loading branch information
rzeldent committed Jan 28, 2024
1 parent 51c5bf0 commit d0ef68b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install PlatformIO
run: python -m pip install platformio
- name: Build firmware
run: platformio run
- name: Archive
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: firmwares.zip
path: .pio/build/*/firmware.bin
32 changes: 29 additions & 3 deletions include/camera_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ constexpr camera_config_t ttgo_t_camera_settings = {
.grab_mode = CAMERA_GRAB_LATEST};

constexpr camera_config_t m5stack_camera_settings = {
.pin_pwdn = -1,
.pin_reset = -1,
.pin_reset = -1,
.pin_xclk = 10,
.pin_sscb_sda = 40,
.pin_sscb_scl = 39,
Expand All @@ -134,7 +133,7 @@ constexpr camera_config_t m5stack_camera_settings = {
.frame_size = FRAMESIZE_SVGA,
.jpeg_quality = 12,
.fb_count = 1,
.fb_location = CAMERA_FB_IN_PSRAM,
.fb_location = CAMERA_FB_IN_DRAM,
.grab_mode = CAMERA_GRAB_LATEST};

constexpr camera_config_t wrover_kit_camera_settings = {
Expand Down Expand Up @@ -189,4 +188,31 @@ constexpr camera_config_t xiao_esp32s3_camera_settings = {
.jpeg_quality = 12,
.fb_count = 2,
.fb_location = CAMERA_FB_IN_PSRAM,
.grab_mode = CAMERA_GRAB_LATEST};

constexpr camera_config_t m5stack_unitcams3_camera_settings = {
.pin_pwdn = -1,
.pin_reset = 15,
.pin_xclk = 27,
.pin_sscb_sda = 25,
.pin_sscb_scl = 23,
.pin_d7 = 19,
.pin_d6 = 36,
.pin_d5 = 18,
.pin_d4 = 39,
.pin_d3 = 5,
.pin_d2 = 34,
.pin_d1 = 35,
.pin_d0 = 32,
.pin_vsync = 22,
.pin_href = 26,
.pin_pclk = 21,
.xclk_freq_hz = 20000000,
.ledc_timer = LEDC_TIMER_0,
.ledc_channel = LEDC_CHANNEL_0,
.pixel_format = PIXFORMAT_JPEG,
.frame_size = FRAMESIZE_SVGA,
.jpeg_quality = 12,
.fb_count = 1,
.fb_location = CAMERA_FB_IN_PSRAM,
.grab_mode = CAMERA_GRAB_LATEST};
3 changes: 3 additions & 0 deletions include/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ constexpr camera_config_t default_camera_config = wrover_kit_camera_settings;
#elif defined(BOARD_SEEED_XIAO_ESP32S3_SENSE)
constexpr const char *board_name = "Seed Xiao ESP32S3 Sense";
constexpr camera_config_t default_camera_config = xiao_esp32s3_camera_settings;
#elif defined(BOARD_M5STACK_UNITCAMS3)
constexpr const char *board_name = "M5Stack UnitCamS3";
constexpr camera_config_t default_camera_config = m5stack_unitcams3_camera_settings;
#else
#error No board defined
#endif
Expand Down
12 changes: 10 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#default_envs = ttgo-t-beam
#default_envs = m5stack_esp32cam
#default_envs = esp32_wrover_cam
default_envs = seeed_xiao_esp32s3
#default_envs = seeed_xiao_esp32s3
#default_envs = m5stack_unitcams3

[env]
platform = espressif32
Expand Down Expand Up @@ -85,4 +86,11 @@ build_flags =
[env:seeed_xiao_esp32s3]
board = seeed_xiao_esp32s3
build_flags =
-D BOARD_SEEED_XIAO_ESP32S3_SENSE
-D BOARD_SEEED_XIAO_ESP32S3_SENSE
-D BOARD_HAS_PSRAM

[env:m5stack_unitcams3]
board = esp32s3box
build_flags =
-D BOARD_M5STACK_UNITCAMS3
-D BOARD_HAS_PSRAM
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,10 @@ void setup()
// Disable brownout
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);
// LED_BUILTIN (GPIO33) has inverted logic false => LED on
#ifdef LED_BUILTIN
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, false);
#endif

Serial.begin(115200);
Serial.setDebugOutput(true);
Expand Down Expand Up @@ -348,7 +350,9 @@ void setup()
iotWebConf.getApTimeoutParameter()->visible = true;
iotWebConf.setConfigSavedCallback(on_config_saved);
iotWebConf.setWifiConnectionCallback(on_connected);
#ifdef LED_BUILTIN
iotWebConf.setStatusPin(LED_BUILTIN, LOW);
#endif
iotWebConf.init();

camera_init_result = initialize_camera();
Expand Down

0 comments on commit d0ef68b

Please sign in to comment.