Tab5 camera + other stuff (#558)

* Tab5 camera + other stuff

Tab5 camera driver - SC2356
Custom SliderBox widget - slider with plus and minus buttons + value label and snapping
Rtc Time service + rtc api
Sdk release - only include drivers built for that specific target, eg: sc2356 driver is mipi / p4 only.
No more hardcoded manual sdk cmakelists
New function to find device by compatible string match. no more static cast bool wildness when trying to match a single device (like M5Stack PaperS3 for example)

* feedback + fixes

Fixed external app user data path.
fix(gui): block app teardown until onHide() completes, preventing ELF unload racing a still-running app
added camera device type and api

* drain the snake sssem

---------

Co-authored-by: Ken Van Hoeylandt <git@kenvanhoeylandt.net>
This commit is contained in:
Shadowtrance
2026-07-10 16:45:03 +10:00
committed by GitHub
parent 16a61a087c
commit 7a7f09be35
47 changed files with 1894 additions and 83 deletions
+1 -1
View File
@@ -3,5 +3,5 @@ file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port esp_lcd EspLcdCompat esp_lcd_ili9881c esp_lcd_st7123 esp_lcd_touch_st7123 GT911 PwmBacklight driver esp_driver_i2c vfs fatfs ina226-module
REQUIRES Tactility esp_lvgl_port esp_lcd EspLcdCompat esp_lcd_ili9881c esp_lcd_st7123 esp_lcd_touch_st7123 GT911 PwmBacklight driver esp_driver_i2c vfs fatfs ina226-module sc2356-module
)
@@ -7,6 +7,8 @@
#include <Tactility/hal/Configuration.h>
#include <esp_clock_output.h>
using namespace tt::hal;
static constexpr auto* TAG = "Tab5";
@@ -249,6 +251,29 @@ static error_t initMicrophone(::Device* i2c_controller) {
return error;
}
static esp_clock_output_mapping_handle_t camera_osc_handle = nullptr;
static void initCameraOsc() {
if (camera_osc_handle != nullptr) {
return;
}
// 24 MHz clock on GPIO 36 for the SC2356 MIPI CSI sensor, required before esp_video_init.
// Uses SPLL (480 MHz) via esp_clock_output with divider 20 = 24 MHz exactly.
// This avoids any LEDC clock source conflict with the display backlight.
if (esp_clock_output_start(CLKOUT_SIG_SPLL, GPIO_NUM_36, &camera_osc_handle) != ESP_OK) {
LOG_E(TAG, "Camera OSC clock output start failed");
return;
}
if (esp_clock_output_set_divider(camera_osc_handle, 20) != ESP_OK) {
LOG_E(TAG, "Camera OSC clock divider set failed");
esp_clock_output_stop(camera_osc_handle);
camera_osc_handle = nullptr;
return;
}
LOG_I(TAG, "Camera OSC 24MHz started on GPIO 36 (SPLL/20)");
}
static bool initBoot() {
auto* i2c0 = device_find_by_name("i2c0");
check(i2c0, "i2c0 not found");
@@ -258,6 +283,7 @@ static bool initBoot() {
auto* io_expander1 = device_find_by_name("io_expander1");
check(io_expander1, "io_expander1 not found");
initCameraOsc();
initExpander0(io_expander0);
initExpander1(io_expander1);
+4
View File
@@ -45,3 +45,7 @@ sdkconfig.CONFIG_CACHE_L2_CACHE_256KB=y
sdkconfig.CONFIG_LVGL_PORT_ENABLE_PPA=y
sdkconfig.CONFIG_LV_DRAW_BUF_ALIGN=64
sdkconfig.CONFIG_LV_DEF_REFR_PERIOD=15
# SC202CS (SC2356) MIPI CSI camera sensor + ISP pipeline (AE/AWB/demosaicing)
sdkconfig.CONFIG_CAMERA_SC202CS=y
sdkconfig.CONFIG_CAMERA_SC202CS_AUTO_DETECT_MIPI_INTERFACE_SENSOR=y
sdkconfig.CONFIG_ESP_VIDEO_ENABLE_ISP_PIPELINE_CONTROLLER=y
+1
View File
@@ -4,4 +4,5 @@ dependencies:
- Drivers/bmi270-module
- Drivers/ina226-module
- Drivers/rx8130ce-module
- Drivers/sc2356-module
dts: m5stack,tab5.dts
+6
View File
@@ -13,6 +13,7 @@
#include <bindings/ina226.h>
#include <bindings/pi4ioe5v6408.h>
#include <bindings/rx8130ce.h>
#include <bindings/sc2356.h>
/ {
compatible = "root";
@@ -60,6 +61,11 @@
reg = <0x41>;
shunt-milliohms = <5>;
};
sc2356 {
compatible = "smartsens,sc2356";
reg = <0x36>;
};
};
port_a: grove0 {