From bd7e6197f4c88ce2551a7250335e0b92be936b4e Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Mon, 13 Oct 2025 21:53:43 +0200 Subject: [PATCH] Add StickC Plus implementation --- Boards/M5stackStickCPlus/CMakeLists.txt | 2 +- Boards/M5stackStickCPlus/README.md | 9 +- Boards/M5stackStickCPlus/Source/InitBoot.cpp | 51 --------- Boards/M5stackStickCPlus/Source/InitBoot.h | 3 - ...M5stackCore2.cpp => M5StackStickCPlus.cpp} | 43 ++++--- .../Source/M5StackStickCPlus.h | 5 + .../M5stackStickCPlus/Source/M5stackCore2.h | 5 - .../Source/devices/Core2Power.cpp | 108 ------------------ .../Source/devices/Core2Power.h | 26 ----- .../Source/devices/Display.cpp | 71 ++++++++---- .../Source/devices/Display.h | 15 +-- .../Source/devices/Power.cpp | 38 ++++++ .../M5stackStickCPlus/Source/devices/Power.h | 9 ++ .../Source/devices/SdCard.cpp | 27 ----- .../M5stackStickCPlus/Source/devices/SdCard.h | 7 -- Buildscripts/board.cmake | 2 + Firmware/Kconfig | 2 + Firmware/Source/Boards.h | 3 + 18 files changed, 146 insertions(+), 280 deletions(-) delete mode 100644 Boards/M5stackStickCPlus/Source/InitBoot.cpp delete mode 100644 Boards/M5stackStickCPlus/Source/InitBoot.h rename Boards/M5stackStickCPlus/Source/{M5stackCore2.cpp => M5StackStickCPlus.cpp} (75%) create mode 100644 Boards/M5stackStickCPlus/Source/M5StackStickCPlus.h delete mode 100644 Boards/M5stackStickCPlus/Source/M5stackCore2.h delete mode 100644 Boards/M5stackStickCPlus/Source/devices/Core2Power.cpp delete mode 100644 Boards/M5stackStickCPlus/Source/devices/Core2Power.h create mode 100644 Boards/M5stackStickCPlus/Source/devices/Power.cpp create mode 100644 Boards/M5stackStickCPlus/Source/devices/Power.h delete mode 100644 Boards/M5stackStickCPlus/Source/devices/SdCard.cpp delete mode 100644 Boards/M5stackStickCPlus/Source/devices/SdCard.h diff --git a/Boards/M5stackStickCPlus/CMakeLists.txt b/Boards/M5stackStickCPlus/CMakeLists.txt index a332ac41..b103142f 100644 --- a/Boards/M5stackStickCPlus/CMakeLists.txt +++ b/Boards/M5stackStickCPlus/CMakeLists.txt @@ -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 ILI934x FT6x36 driver vfs fatfs + REQUIRES Tactility esp_lvgl_port esp_lcd AXP192 ST7789 ButtonControl ) diff --git a/Boards/M5stackStickCPlus/README.md b/Boards/M5stackStickCPlus/README.md index 6160285b..265aa496 100644 --- a/Boards/M5stackStickCPlus/README.md +++ b/Boards/M5stackStickCPlus/README.md @@ -1,9 +1,4 @@ -# M5Stack Core2 - -This board implementation concerns the original Core2 hardware and **not** the v1.1 variant. - -Reference implementations: -- [ESP-BSP](https://github.com/espressif/esp-bsp/tree/master/bsp/m5stack_core_2) +# M5Stack StickC Plus Docs: -- [M5Stack.com](https://docs.m5stack.com/en/core/Core2) + - [M5Stack.com](https://docs.m5stack.com/en/core/m5stickc_plus) diff --git a/Boards/M5stackStickCPlus/Source/InitBoot.cpp b/Boards/M5stackStickCPlus/Source/InitBoot.cpp deleted file mode 100644 index a4e7871c..00000000 --- a/Boards/M5stackStickCPlus/Source/InitBoot.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "axp192/axp192.h" - -#include -#include -#include - -#include -#include - -constexpr auto* TAG = "Core2"; - -axp192_t axpDevice; - -static int32_t axpI2cRead(TT_UNUSED void* handle, uint8_t address, uint8_t reg, uint8_t* buffer, uint16_t size) { - if (tt::hal::i2c::masterReadRegister(I2C_NUM_0, address, reg, buffer, size, 50 / portTICK_PERIOD_MS)) { - return AXP192_OK; - } else { - return 1; - } -} - -static int32_t axpI2cWrite(TT_UNUSED void* handle, uint8_t address, uint8_t reg, const uint8_t* buffer, uint16_t size) { - if (tt::hal::i2c::masterWriteRegister(I2C_NUM_0, address, reg, buffer, size, 50 / portTICK_PERIOD_MS)) { - return AXP192_OK; - } else { - return 1; - } -} - -void initAxp() { - axpDevice.read = axpI2cRead; - axpDevice.write = axpI2cWrite; - - axp192_ioctl(&axpDevice, AXP192_LDO2_SET_VOLTAGE, 3300); // LCD + SD - axp192_ioctl(&axpDevice, AXP192_LDO3_SET_VOLTAGE, 0); // VIB_MOTOR STOP - axp192_ioctl(&axpDevice, AXP192_DCDC3_SET_VOLTAGE, 3300); - - axp192_ioctl(&axpDevice, AXP192_LDO2_ENABLE); - axp192_ioctl(&axpDevice, AXP192_LDO3_DISABLE); - axp192_ioctl(&axpDevice, AXP192_DCDC3_ENABLE); - - axp192_write(&axpDevice, AXP192_PWM1_DUTY_CYCLE_2, 255); // PWM 255 (LED OFF) - axp192_write(&axpDevice, AXP192_GPIO1_CONTROL, 0x02); // GPIO1 PWM - // TODO: We could charge at 390mA according to the M5Unified code, but the AXP driver in M5Unified limits to 132mA, so it's unclear what the AXP supports. -} - -bool initBoot() { - TT_LOG_I(TAG, "initBoot"); - initAxp(); - return true; -} \ No newline at end of file diff --git a/Boards/M5stackStickCPlus/Source/InitBoot.h b/Boards/M5stackStickCPlus/Source/InitBoot.h deleted file mode 100644 index f3e5bf89..00000000 --- a/Boards/M5stackStickCPlus/Source/InitBoot.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -bool initBoot(); diff --git a/Boards/M5stackStickCPlus/Source/M5stackCore2.cpp b/Boards/M5stackStickCPlus/Source/M5StackStickCPlus.cpp similarity index 75% rename from Boards/M5stackStickCPlus/Source/M5stackCore2.cpp rename to Boards/M5stackStickCPlus/Source/M5StackStickCPlus.cpp index 0f187e77..e6995a73 100644 --- a/Boards/M5stackStickCPlus/Source/M5stackCore2.cpp +++ b/Boards/M5stackStickCPlus/Source/M5StackStickCPlus.cpp @@ -1,25 +1,36 @@ -#include "M5stackCore2.h" -#include "InitBoot.h" +#include "M5StackStickCPlus.h" #include "devices/Display.h" -#include "devices/Core2Power.h" -#include "devices/SdCard.h" +#include "devices/Power.h" +#include -#include #include -#define CORE2_SPI_TRANSFER_SIZE_LIMIT (CORE2_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8) +#define SPI_TRANSFER_SIZE_LIMIT (LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8) using namespace tt::hal; +constexpr auto* TAG = "StickCPlus"; + +bool initBoot() { + TT_LOG_I(TAG, "initBoot"); + + // CH552 applies 4 V to GPIO 0, which reduces Wi-Fi sensitivity + // Setting output to high adds a bias of 3.3 V and suppresses over-voltage: + gpio::configure(0, gpio::Mode::Output, false, false); + gpio::setLevel(0, true); + + return initAxp(); +} + static DeviceVector createDevices() { return { - createPower(), - createSdCard(), + getAxp192(), + // ButtonControl::createTwoButtonControl(37, 39), createDisplay() }; } -extern const Configuration m5stack_core2 = { +extern const Configuration m5stack_stickc_plus = { .initBoot = initBoot, .createDevices = createDevices, .i2c = { @@ -41,7 +52,7 @@ extern const Configuration m5stack_core2 = { } }, i2c::Configuration { - .name = "External", // (Grove) + .name = "Grove", .port = I2C_NUM_1, .initMode = i2c::InitMode::ByTactility, .isMutable = true, @@ -63,17 +74,17 @@ extern const Configuration m5stack_core2 = { .device = SPI2_HOST, .dma = SPI_DMA_CH_AUTO, .config = { - .mosi_io_num = GPIO_NUM_23, - .miso_io_num = GPIO_NUM_38, - .sclk_io_num = GPIO_NUM_18, - .quadwp_io_num = GPIO_NUM_NC, // Quad SPI LCD driver is not yet supported - .quadhd_io_num = GPIO_NUM_NC, // Quad SPI LCD driver is not yet supported + .mosi_io_num = GPIO_NUM_15, + .miso_io_num = GPIO_NUM_NC, + .sclk_io_num = GPIO_NUM_13, + .quadwp_io_num = GPIO_NUM_NC, + .quadhd_io_num = GPIO_NUM_NC, .data4_io_num = GPIO_NUM_NC, .data5_io_num = GPIO_NUM_NC, .data6_io_num = GPIO_NUM_NC, .data7_io_num = GPIO_NUM_NC, .data_io_default_level = false, - .max_transfer_sz = CORE2_SPI_TRANSFER_SIZE_LIMIT, + .max_transfer_sz = SPI_TRANSFER_SIZE_LIMIT, .flags = 0, .isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO, .intr_flags = 0 diff --git a/Boards/M5stackStickCPlus/Source/M5StackStickCPlus.h b/Boards/M5stackStickCPlus/Source/M5StackStickCPlus.h new file mode 100644 index 00000000..6a4d767e --- /dev/null +++ b/Boards/M5stackStickCPlus/Source/M5StackStickCPlus.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +extern const tt::hal::Configuration m5stack_stickc_plus; diff --git a/Boards/M5stackStickCPlus/Source/M5stackCore2.h b/Boards/M5stackStickCPlus/Source/M5stackCore2.h deleted file mode 100644 index 45b8a82b..00000000 --- a/Boards/M5stackStickCPlus/Source/M5stackCore2.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include - -extern const tt::hal::Configuration m5stack_core2; diff --git a/Boards/M5stackStickCPlus/Source/devices/Core2Power.cpp b/Boards/M5stackStickCPlus/Source/devices/Core2Power.cpp deleted file mode 100644 index 3d5a5c3d..00000000 --- a/Boards/M5stackStickCPlus/Source/devices/Core2Power.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include "Core2Power.h" -#include -#include "axp192/axp192.h" - -constexpr auto TAG = "Core2Power"; - -extern axp192_t axpDevice; - -bool Core2Power::supportsMetric(MetricType type) const { - switch (type) { - using enum MetricType; - case BatteryVoltage: - case ChargeLevel: - case IsCharging: - return true; - default: - return false; - } -} - -bool Core2Power::getMetric(MetricType type, MetricData& data) { - switch (type) { - using enum MetricType; - case BatteryVoltage: { - float voltage; - if (axp192_read(&axpDevice, AXP192_BATTERY_VOLTAGE, &voltage) == ESP_OK) { - data.valueAsUint32 = (uint32_t)std::max((voltage * 1000.f), 0.0f); - return true; - } else { - return false; - } - } - case ChargeLevel: { - float vbat, charge_current; - if ( - axp192_read(&axpDevice, AXP192_BATTERY_VOLTAGE, &vbat) == ESP_OK && - axp192_read(&axpDevice, AXP192_CHARGE_CURRENT, &charge_current) == ESP_OK - ) { - float max_voltage = 4.20f; - float min_voltage = 2.69f; // From M5Unified - float voltage_correction = (charge_current > 0.01f) ? -0.1f : 0.f; // Roughly 0.1V drop when ccharging - float corrected_voltage = vbat + voltage_correction; - if (corrected_voltage > 2.69f) { - float charge_factor = (corrected_voltage - min_voltage) / (max_voltage - min_voltage); - data.valueAsUint8 = (uint8_t)(charge_factor * 100.f); - } else { - data.valueAsUint8 = 0; - } - return true; - } else { - return false; - } - } - case IsCharging: { - float charge_current; - if (axp192_read(&axpDevice, AXP192_CHARGE_CURRENT, &charge_current) == ESP_OK) { - data.valueAsBool = charge_current > 0.001f; - return true; - } else { - return false; - } - } - case Current: { - float charge_current, discharge_current; - if ( - axp192_read(&axpDevice, AXP192_CHARGE_CURRENT, &charge_current) == ESP_OK && - axp192_read(&axpDevice, AXP192_DISCHARGE_CURRENT, &discharge_current) == ESP_OK - ) { - if (charge_current > 0.0f) { - data.valueAsInt32 = (int32_t) (charge_current * 1000.0f); - } else { - data.valueAsInt32 = -(int32_t) (discharge_current * 1000.0f); - } - return true; - } else { - return false; - } - } - default: - return false; - } -} - -bool Core2Power::isAllowedToCharge() const { - uint8_t buffer; - if (axp192_read(&axpDevice, AXP192_CHARGE_CONTROL_1, &buffer) == ESP_OK) { - return buffer & 0x80; - } else { - return false; - } -} - -void Core2Power::setAllowedToCharge(bool canCharge) { - uint8_t buffer; - if (axp192_read(&axpDevice, AXP192_CHARGE_CONTROL_1, &buffer) == ESP_OK) { - buffer = (buffer & 0x7F) + (canCharge ? 0x80 : 0x00); - axp192_write(&axpDevice, AXP192_CHARGE_CONTROL_1, buffer); - } -} - -static std::shared_ptr power; - -std::shared_ptr createPower() { - if (power == nullptr) { - power = std::make_shared(); - } - return power; -} diff --git a/Boards/M5stackStickCPlus/Source/devices/Core2Power.h b/Boards/M5stackStickCPlus/Source/devices/Core2Power.h deleted file mode 100644 index c1e29b15..00000000 --- a/Boards/M5stackStickCPlus/Source/devices/Core2Power.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "Tactility/hal/power/PowerDevice.h" -#include - -using tt::hal::power::PowerDevice; - -class Core2Power : public PowerDevice { - -public: - - Core2Power() = default; - ~Core2Power() override = default; - - std::string getName() const final { return "AXP192 Power"; } - std::string getDescription() const final { return "Power management via I2C"; } - - bool supportsMetric(MetricType type) const override; - bool getMetric(MetricType type, MetricData& data) override; - - bool supportsChargeControl() const override { return true; } - bool isAllowedToCharge() const override; - void setAllowedToCharge(bool canCharge) override; -}; - -std::shared_ptr createPower(); diff --git a/Boards/M5stackStickCPlus/Source/devices/Display.cpp b/Boards/M5stackStickCPlus/Source/devices/Display.cpp index 58152553..82c45907 100644 --- a/Boards/M5stackStickCPlus/Source/devices/Display.cpp +++ b/Boards/M5stackStickCPlus/Source/devices/Display.cpp @@ -1,36 +1,63 @@ #include "Display.h" -#include -#include +#include "Power.h" -std::shared_ptr createTouch() { - auto configuration = std::make_unique( - I2C_NUM_0, - GPIO_NUM_39, - CORE2_LCD_HORIZONTAL_RESOLUTION, - CORE2_LCD_VERTICAL_RESOLUTION - ); +#include +#include - auto touch = std::make_shared(std::move(configuration)); - return std::reinterpret_pointer_cast(touch); +constexpr auto* TAG = "StickCPlus"; + +static void setBacklightOn(bool on) { + const auto axp = getAxp192(); + const auto* driver = axp->getAxp192(); + uint8_t state; + if (axp192_read(driver, AXP192_DCDC13_LDO23_CONTROL, &state) != AXP192_OK) { + TT_LOG_I(TAG, "Failed to read LCD brightness state"); + return; + } + std::bitset<8> new_state = state; + if (new_state[2] != on) { + new_state[2] = on; + const auto new_state_long = new_state.to_ulong(); + axp192_write(driver, AXP192_DCDC13_LDO23_CONTROL, static_cast(new_state_long)); // Display on/off + } +} + +static void setBrightness(uint8_t brightness) { + const auto axp = getAxp192(); + if (brightness) + { + brightness = (((brightness >> 1) + 8) / 13) + 5; + setBacklightOn(true); + axp192_write(axp->getAxp192(), AXP192_LDO23_VOLTAGE, brightness << 4); // Display brightness + } + else + { + setBacklightOn(false); + } } std::shared_ptr createDisplay() { - auto touch = createTouch(); - - auto configuration = std::make_unique( - CORE2_LCD_SPI_HOST, - CORE2_LCD_PIN_CS, - CORE2_LCD_PIN_DC, - CORE2_LCD_HORIZONTAL_RESOLUTION, - CORE2_LCD_VERTICAL_RESOLUTION, - touch, + auto configuration = std::make_unique( + LCD_SPI_HOST, + LCD_PIN_CS, + LCD_PIN_DC, + LCD_HORIZONTAL_RESOLUTION, + LCD_VERTICAL_RESOLUTION, + nullptr, false, false, false, - true + true, + LCD_DRAW_BUFFER_SIZE, + 52, + 40 ); - auto display = std::make_shared(std::move(configuration)); + configuration->pixelClockFrequency = 40'000'000; + configuration->resetPin = LCD_PIN_RESET; + + configuration->backlightDutyFunction = setBrightness; + const auto display = std::make_shared(std::move(configuration)); return std::reinterpret_pointer_cast(display); } diff --git a/Boards/M5stackStickCPlus/Source/devices/Display.h b/Boards/M5stackStickCPlus/Source/devices/Display.h index 75c13107..2cacfee8 100644 --- a/Boards/M5stackStickCPlus/Source/devices/Display.h +++ b/Boards/M5stackStickCPlus/Source/devices/Display.h @@ -3,12 +3,13 @@ #include "Tactility/hal/display/DisplayDevice.h" #include -#define CORE2_LCD_SPI_HOST SPI2_HOST -#define CORE2_LCD_PIN_CS GPIO_NUM_5 -#define CORE2_LCD_PIN_DC GPIO_NUM_15 -#define CORE2_LCD_HORIZONTAL_RESOLUTION 320 -#define CORE2_LCD_VERTICAL_RESOLUTION 240 -#define CORE2_LCD_DRAW_BUFFER_HEIGHT (CORE2_LCD_VERTICAL_RESOLUTION / 10) -#define CORE2_LCD_DRAW_BUFFER_SIZE (CORE2_LCD_HORIZONTAL_RESOLUTION * CORE2_LCD_DRAW_BUFFER_HEIGHT) +#define LCD_SPI_HOST SPI2_HOST +#define LCD_PIN_CS GPIO_NUM_5 +#define LCD_PIN_DC GPIO_NUM_23 +#define LCD_PIN_RESET GPIO_NUM_18 +#define LCD_HORIZONTAL_RESOLUTION 135 +#define LCD_VERTICAL_RESOLUTION 240 +#define LCD_DRAW_BUFFER_HEIGHT (LCD_VERTICAL_RESOLUTION / 3) +#define LCD_DRAW_BUFFER_SIZE (LCD_HORIZONTAL_RESOLUTION * LCD_DRAW_BUFFER_HEIGHT) std::shared_ptr createDisplay(); diff --git a/Boards/M5stackStickCPlus/Source/devices/Power.cpp b/Boards/M5stackStickCPlus/Source/devices/Power.cpp new file mode 100644 index 00000000..40dc1137 --- /dev/null +++ b/Boards/M5stackStickCPlus/Source/devices/Power.cpp @@ -0,0 +1,38 @@ +#include + +static std::shared_ptr axp192 = nullptr; + +std::shared_ptr createAxp192() { + assert(axp192 == nullptr); + auto configuration = std::make_unique(I2C_NUM_0); + axp192 = std::make_shared(std::move(configuration)); + return axp192; +} + +std::shared_ptr getAxp192() { + assert(axp192 != nullptr); + return axp192; +} + +bool initAxp() { + const auto axp = createAxp192(); + return axp->init([](auto* driver) { + // Reference: https://github.com/pr3y/Bruce/blob/main/lib/utility/AXP192.cpp + axp192_ioctl(driver, AXP192_LDO23_VOLTAGE, 3300); // LCD backlight + axp192_ioctl(driver, AXP192_ADC_ENABLE_1, 0xff); // Set all ADC enabled + axp192_ioctl(driver, AXP192_CHARGE_CONTROL_1, 0xc0); // Battery charging at 4.2 V and 100 mA + axp192_ioctl(driver, AXP192_ADC_ENABLE_1, 0xff); // Enable battery, AC in, Vbus, APS ADC + uint8_t buffer; + axp192_read(driver, AXP192_DCDC13_LDO23_CONTROL, &buffer); + axp192_ioctl(driver, AXP192_DCDC13_LDO23_CONTROL, buffer | 0x4D); // Enable Ext, LDO2, LDO3, DCDC1 + axp192_ioctl(driver, AXP192_PEK, 0x0C); // 128 ms power on, 4 s power off + axp192_ioctl(driver, AXP192_GPIO0_LDOIO0_VOLTAGE, 0xF0); // 3.3 V RTC voltage + axp192_ioctl(driver, AXP192_GPIO0_CONTROL, 0x02); // Set GPIO0 to LDO + axp192_ioctl(driver, AXP192_VBUS_IPSOUT_CHANNEL, 0x80); // Disable Vbus hold limit + axp192_ioctl(driver, AXP192_BATTERY_CHARGE_HIGH_TEMP, 0xFC); // Set temperature protection + axp192_ioctl(driver, AXP192_BATTERY_CHARGE_CONTROL, 0xA2); // Enable RTC BAT charge + axp192_ioctl(driver, AXP192_SHUTDOWN_BATTERY_CHGLED_CONTROL, 0x46); // Enable bat detection + return true; + }); + +} diff --git a/Boards/M5stackStickCPlus/Source/devices/Power.h b/Boards/M5stackStickCPlus/Source/devices/Power.h new file mode 100644 index 00000000..14a00889 --- /dev/null +++ b/Boards/M5stackStickCPlus/Source/devices/Power.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +bool initAxp(); + +// Must call initAxp() first before this returns a non-nullptr response +std::shared_ptr getAxp192(); + diff --git a/Boards/M5stackStickCPlus/Source/devices/SdCard.cpp b/Boards/M5stackStickCPlus/Source/devices/SdCard.cpp deleted file mode 100644 index 9d0f12b9..00000000 --- a/Boards/M5stackStickCPlus/Source/devices/SdCard.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "SdCard.h" - -#include -#include - -constexpr auto CORE2_SDCARD_PIN_CS = GPIO_NUM_4; -constexpr auto CORE2_LCD_PIN_CS = GPIO_NUM_5; - -using tt::hal::sdcard::SpiSdCardDevice; - -std::shared_ptr createSdCard() { - auto configuration = std::make_unique( - CORE2_SDCARD_PIN_CS, - GPIO_NUM_NC, - GPIO_NUM_NC, - GPIO_NUM_NC, - SdCardDevice::MountBehaviour::AtBoot, - tt::lvgl::getSyncLock(), - std::vector { - CORE2_LCD_PIN_CS - } - ); - - return std::make_shared( - std::move(configuration) - ); -} diff --git a/Boards/M5stackStickCPlus/Source/devices/SdCard.h b/Boards/M5stackStickCPlus/Source/devices/SdCard.h deleted file mode 100644 index 5cb65a73..00000000 --- a/Boards/M5stackStickCPlus/Source/devices/SdCard.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include "Tactility/hal/sdcard/SdCardDevice.h" - -using tt::hal::sdcard::SdCardDevice; - -std::shared_ptr createSdCard(); diff --git a/Buildscripts/board.cmake b/Buildscripts/board.cmake index 377b550c..2002ab38 100644 --- a/Buildscripts/board.cmake +++ b/Buildscripts/board.cmake @@ -61,6 +61,8 @@ function(INIT_TACTILITY_GLOBALS SDKCONFIG_FILE) set(TACTILITY_BOARD_PROJECT M5stackCore2) elseif (board_id STREQUAL "m5stack-cores3") set(TACTILITY_BOARD_PROJECT M5stackCoreS3) + elseif (board_id STREQUAL "m5stack-stickc-plus") + set(TACTILITY_BOARD_PROJECT M5stackStickCPlus) elseif (board_id STREQUAL "unphone") set(TACTILITY_BOARD_PROJECT UnPhone) elseif (board_id STREQUAL "waveshare-s3-touch-43") diff --git a/Firmware/Kconfig b/Firmware/Kconfig index 5649acc0..26316734 100644 --- a/Firmware/Kconfig +++ b/Firmware/Kconfig @@ -51,6 +51,8 @@ menu "Tactility App" bool "M5Stack Core2" config TT_BOARD_M5STACK_CORES3 bool "M5Stack CoreS3" + config TT_BOARD_M5STACK_STICKC_PLUS + bool "M5Stack StickC Plus" config TT_BOARD_UNPHONE bool "unPhone" config TT_BOARD_WAVESHARE_S3_TOUCH_43 diff --git a/Firmware/Source/Boards.h b/Firmware/Source/Boards.h index 2af902f4..74283d48 100644 --- a/Firmware/Source/Boards.h +++ b/Firmware/Source/Boards.h @@ -53,6 +53,9 @@ #elif defined(CONFIG_TT_BOARD_M5STACK_CORES3) #include "M5stackCoreS3.h" #define TT_BOARD_HARDWARE &m5stack_cores3 +#elif defined(CONFIG_TT_BOARD_M5STACK_STICKC_PLUS) +#include "M5StackStickCPlus.h" +#define TT_BOARD_HARDWARE &m5stack_stickc_plus #elif defined(CONFIG_TT_BOARD_UNPHONE) #include "UnPhone.h" #define TT_BOARD_HARDWARE &unPhone