Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions Data/data/webserver/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,12 @@ <h2>Installed Apps</h2>
const psramUsed = data.psram.total - data.psram.free;
const psramPercent = data.psram.total > 0 ? (psramUsed / data.psram.total) * 100 : 0;
const hasPsram = data.psram.total > 0;
const dataUsed = data.storage.data.mounted ? (data.storage.data.total - data.storage.data.free) : 0;
const dataPercent = data.storage.data.mounted && data.storage.data.total > 0 ? (dataUsed / data.storage.data.total) * 100 : 0;
const sdUsed = data.storage.sdcard.mounted ? (data.storage.sdcard.total - data.storage.sdcard.free) : 0;
const sdPercent = data.storage.sdcard.mounted && data.storage.sdcard.total > 0 ? (sdUsed / data.storage.sdcard.total) * 100 : 0;
const dataPartition = data.storage?.data ?? {};
const sdcard = data.storage?.sdcard ?? {};
const dataUsed = dataPartition.mounted ? (dataPartition.total - dataPartition.free) : 0;
const dataPercent = dataPartition.mounted && dataPartition.total > 0 ? (dataUsed / dataPartition.total) * 100 : 0;
const sdUsed = sdcard.mounted ? (sdcard.total - sdcard.free) : 0;
const sdPercent = sdcard.mounted && sdcard.total > 0 ? (sdUsed / sdcard.total) * 100 : 0;

versionEl.textContent = `Tactility v${data.firmware.version} | ESP-IDF v${data.firmware.idf_version}`;

Expand Down Expand Up @@ -711,20 +713,20 @@ <h2>External Memory (PSRAM)</h2>
<h2>Storage</h2>
<div class="stat">
<span class="stat-label">Data Partition</span>
<span class="stat-value ${data.storage.data.mounted ? getUsageClass(dataPercent) : ''}">${
data.storage.data.mounted ? formatBytes(data.storage.data.free) + ' free' : 'Not mounted'
<span class="stat-value ${dataPartition.mounted ? getUsageClass(dataPercent) : ''}">${
dataPartition.mounted ? formatBytes(dataPartition.free) + ' free' : 'Not mounted'
}</span>
</div>
${data.storage.data.mounted ? `<div class="progress-bar">
${dataPartition.mounted ? `<div class="progress-bar">
<div class="progress-fill ${getUsageClass(dataPercent)}" style="width: ${dataPercent}%"></div>
</div>` : ''}
<div class="stat" style="margin-top: 15px">
<span class="stat-label">SD Card</span>
<span class="stat-value ${data.storage.sdcard.mounted ? getUsageClass(sdPercent) : ''}">${
data.storage.sdcard.mounted ? formatBytes(data.storage.sdcard.free) + ' free' : 'Not mounted'
<span class="stat-value ${sdcard.mounted ? getUsageClass(sdPercent) : ''}">${
sdcard.mounted ? formatBytes(sdcard.free) + ' free' : 'Not mounted'
}</span>
</div>
${data.storage.sdcard.mounted ? `<div class="progress-bar">
${sdcard.mounted ? `<div class="progress-bar">
<div class="progress-fill ${getUsageClass(sdPercent)}" style="width: ${sdPercent}%"></div>
</div>` : ''}
</div>
Expand Down
3 changes: 2 additions & 1 deletion Devices/btt-panda-touch/device.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ shape=rectangle
dpi=187

[lvgl]
colorDepth=16
colorDepth=16
fontSize=18
1 change: 1 addition & 0 deletions Devices/cyd-8048s043c/device.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ warningMessage=
[lvgl]
theme=DefaultDark
colorDepth=16
fontSize=18
1 change: 1 addition & 0 deletions Devices/elecrow-crowpanel-advance-50/device.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dpi=187

[lvgl]
colorDepth=16
fontSize=18
1 change: 1 addition & 0 deletions Devices/elecrow-crowpanel-basic-50/device.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dpi=187

[lvgl]
colorDepth=16
fontSize=18
1 change: 1 addition & 0 deletions Devices/guition-jc8048w550c/device.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ dpi=187

[lvgl]
colorDepth=16
fontSize=18
3 changes: 2 additions & 1 deletion Devices/m5stack-cardputer-adv/devicetree.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dependencies:
- Platforms/platform-esp32
- Platforms/platform-esp32
- Drivers/bmi270-module
dts: m5stack,cardputer-adv.dts
6 changes: 6 additions & 0 deletions Devices/m5stack-cardputer-adv/m5stack,cardputer-adv.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <tactility/bindings/esp32_i2s.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <bindings/bmi270.h>

// Reference: https://docs.m5stack.com/en/core/Cardputer-Adv
/ {
Expand All @@ -23,6 +24,11 @@
clock-frequency = <400000>;
pin-sda = <&gpio0 8 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 9 GPIO_FLAG_NONE>;

bmi270 {
compatible = "bosch,bmi270";
reg = <0x68>;
};
};

i2c_port_a {
Expand Down
4 changes: 3 additions & 1 deletion Devices/m5stack-core2/devicetree.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dependencies:
- Platforms/platform-esp32
- Platforms/platform-esp32
- Drivers/mpu6886-module
- Drivers/bm8563-module
dts: m5stack,core2.dts
12 changes: 12 additions & 0 deletions Devices/m5stack-core2/m5stack,core2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <tactility/bindings/esp32_i2s.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <bindings/mpu6886.h>
#include <bindings/bm8563.h>

// Reference: https://docs.m5stack.com/en/core/Core2
/ {
Expand All @@ -23,6 +25,16 @@
clock-frequency = <400000>;
pin-sda = <&gpio0 21 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;

mpu6886 {
compatible = "invensense,mpu6886";
reg = <0x68>;
};

bm8563 {
compatible = "belling,bm8563";
reg = <0x51>;
};
};

i2c_port_a {
Expand Down
4 changes: 3 additions & 1 deletion Devices/m5stack-cores3/devicetree.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dependencies:
- Platforms/platform-esp32
- Platforms/platform-esp32
- Drivers/bmi270-module
- Drivers/bm8563-module
dts: m5stack,cores3.dts
12 changes: 12 additions & 0 deletions Devices/m5stack-cores3/m5stack,cores3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <tactility/bindings/esp32_i2s.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <bindings/bmi270.h>
#include <bindings/bm8563.h>

// Reference: https://docs.m5stack.com/en/core/CoreS3
/ {
Expand All @@ -23,6 +25,16 @@
clock-frequency = <400000>;
pin-sda = <&gpio0 12 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 11 GPIO_FLAG_NONE>;

bmi270 {
compatible = "bosch,bmi270";
reg = <0x68>;
};

bm8563 {
compatible = "belling,bm8563";
reg = <0x51>;
};
};

i2c_port_a {
Expand Down
4 changes: 3 additions & 1 deletion Devices/m5stack-papers3/devicetree.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dependencies:
- Platforms/platform-esp32
- Platforms/platform-esp32
- Drivers/bmi270-module
- Drivers/bm8563-module
dts: m5stack,papers3.dts
12 changes: 12 additions & 0 deletions Devices/m5stack-papers3/m5stack,papers3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <bindings/bmi270.h>
#include <bindings/bm8563.h>

/ {
compatible = "root";
Expand All @@ -20,6 +22,16 @@
clock-frequency = <400000>;
pin-sda = <&gpio0 41 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 42 GPIO_FLAG_NONE>;

bmi270 {
compatible = "bosch,bmi270";
reg = <0x68>;
};

bm8563 {
compatible = "belling,bm8563";
reg = <0x51>;
};
};

spi0 {
Expand Down
4 changes: 3 additions & 1 deletion Devices/m5stack-stickc-plus/devicetree.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dependencies:
- Platforms/platform-esp32
- Platforms/platform-esp32
- Drivers/mpu6886-module
- Drivers/bm8563-module
dts: m5stack,stickc-plus.dts
12 changes: 12 additions & 0 deletions Devices/m5stack-stickc-plus/m5stack,stickc-plus.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <bindings/mpu6886.h>
#include <bindings/bm8563.h>

/ {
compatible = "root";
Expand All @@ -21,6 +23,16 @@
clock-frequency = <400000>;
pin-sda = <&gpio0 21 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;

mpu6886 {
compatible = "invensense,mpu6886";
reg = <0x68>;
};

bm8563 {
compatible = "belling,bm8563";
reg = <0x51>;
};
};

i2c_grove {
Expand Down
4 changes: 3 additions & 1 deletion Devices/m5stack-stickc-plus2/devicetree.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dependencies:
- Platforms/platform-esp32
- Platforms/platform-esp32
- Drivers/mpu6886-module
- Drivers/bm8563-module
dts: m5stack,stickc-plus2.dts
12 changes: 12 additions & 0 deletions Devices/m5stack-stickc-plus2/m5stack,stickc-plus2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <bindings/mpu6886.h>
#include <bindings/bm8563.h>

/ {
compatible = "root";
Expand All @@ -20,6 +22,16 @@
clock-frequency = <400000>;
pin-sda = <&gpio0 21 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;

mpu6886 {
compatible = "invensense,mpu6886";
reg = <0x68>;
};

bm8563 {
compatible = "belling,bm8563";
reg = <0x51>;
};
};

i2c_grove {
Expand Down
7 changes: 7 additions & 0 deletions Devices/m5stack-sticks3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)

idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port esp_lcd ST7789 PwmBacklight ButtonControl m5pm1-module
)
26 changes: 26 additions & 0 deletions Devices/m5stack-sticks3/Source/Configuration.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "devices/Display.h"
#include "devices/Power.h"
#include <driver/gpio.h>

#include <Tactility/hal/Configuration.h>
#include <ButtonControl.h>
#include <PwmBacklight.h>

using namespace tt::hal;

bool initBoot() {
return driver::pwmbacklight::init(GPIO_NUM_38, 512);
}

static DeviceVector createDevices() {
return {
createPower(),
ButtonControl::createTwoButtonControl(11, 12), // top button, side button
createDisplay()
};
}

extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices
};
32 changes: 32 additions & 0 deletions Devices/m5stack-sticks3/Source/devices/Display.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include "Display.h"

#include <PwmBacklight.h>
#include <St7789Display.h>

std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
St7789Display::Configuration panel_configuration = {
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
.verticalResolution = LCD_VERTICAL_RESOLUTION,
.gapX = 52,
.gapY = 40,
.swapXY = false,
.mirrorX = false,
.mirrorY = false,
.invertColor = true,
.bufferSize = LCD_BUFFER_SIZE,
.touch = nullptr,
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
.resetPin = LCD_PIN_RESET,
.lvglSwapBytes = false
};

auto spi_configuration = std::make_shared<St7789Display::SpiConfiguration>(St7789Display::SpiConfiguration {
.spiHostDevice = LCD_SPI_HOST,
.csPin = LCD_PIN_CS,
.dcPin = LCD_PIN_DC,
.pixelClockFrequency = 40'000'000,
.transactionQueueDepth = 10
});

return std::make_shared<St7789Display>(panel_configuration, spi_configuration);
}
17 changes: 17 additions & 0 deletions Devices/m5stack-sticks3/Source/devices/Display.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include "Tactility/hal/display/DisplayDevice.h"
#include <memory>
#include <driver/gpio.h>
#include <driver/spi_common.h>

constexpr auto LCD_SPI_HOST = SPI2_HOST;
constexpr auto LCD_PIN_CS = GPIO_NUM_41;
constexpr auto LCD_PIN_DC = GPIO_NUM_45;
constexpr auto LCD_PIN_RESET = GPIO_NUM_21;
constexpr auto LCD_HORIZONTAL_RESOLUTION = 135;
constexpr auto LCD_VERTICAL_RESOLUTION = 240;
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 3;
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;

std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
Loading
Loading