Skip to content
Merged
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
1 change: 0 additions & 1 deletion Buildscripts/TactilitySDK/TactilitySDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ macro(tactility_project project_name)
set(COMPONENTS
TactilityFreeRtos
bm8563-module
bm8563-module
bmi270-module
mpu6886-module
pi4ioe5v6408-module
Expand Down
4 changes: 2 additions & 2 deletions Devices/m5stack-cardputer-adv/m5stack,cardputer-adv.dts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
port_a: grove0 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_I2C>;
pinSdaRx = <&gpio0 2 GPIO_FLAG_NONE>;
pinSclTx = <&gpio0 1 GPIO_FLAG_NONE>;
pinSdaTx = <&gpio0 2 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 1 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_1>;
i2cPort = <I2C_NUM_1>;
i2cClockFrequency = <400000>;
Expand Down
4 changes: 2 additions & 2 deletions Devices/m5stack-cardputer/m5stack,cardputer.dts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
port_a: grove0 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_I2C>;
pinSdaRx = <&gpio0 2 GPIO_FLAG_NONE>;
pinSclTx = <&gpio0 1 GPIO_FLAG_NONE>;
pinSdaTx = <&gpio0 2 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 1 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_1>;
i2cPort = <I2C_NUM_0>;
i2cClockFrequency = <400000>;
Expand Down
4 changes: 2 additions & 2 deletions Devices/m5stack-core2/m5stack,core2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
port_a: grove0 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_I2C>;
pinSdaRx = <&gpio0 32 GPIO_FLAG_NONE>;
pinSclTx = <&gpio0 33 GPIO_FLAG_NONE>;
pinSdaTx = <&gpio0 32 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 33 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_1>;
i2cPort = <I2C_NUM_1>;
i2cClockFrequency = <400000>;
Expand Down
12 changes: 6 additions & 6 deletions Devices/m5stack-cores3/m5stack,cores3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
port_a: grove0 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_I2C>;
pinSdaRx = <&gpio0 2 GPIO_FLAG_NONE>;
pinSclTx = <&gpio0 1 GPIO_FLAG_NONE>;
pinSdaTx = <&gpio0 2 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 1 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_1>;
i2cPort = <I2C_NUM_1>;
i2cClockFrequency = <400000>;
Expand All @@ -56,8 +56,8 @@
port_b: grove1 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_UART>;
pinSdaRx = <&gpio0 9 GPIO_FLAG_NONE>;
pinSclTx = <&gpio0 8 GPIO_FLAG_NONE>;
pinSdaTx = <&gpio0 9 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 8 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_1>;
i2cPort = <I2C_NUM_1>;
i2cClockFrequency = <400000>;
Expand All @@ -66,8 +66,8 @@
port_c: grove2 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_UART>;
pinSdaRx = <&gpio0 17 GPIO_FLAG_NONE>;
pinSclTx = <&gpio0 18 GPIO_FLAG_NONE>;
pinSdaTx = <&gpio0 17 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 18 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_2>;
i2cPort = <I2C_NUM_1>;
i2cClockFrequency = <400000>;
Expand Down
12 changes: 6 additions & 6 deletions Devices/m5stack-stackchan/m5stack,stackchan.dts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
port_a: grove0 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_I2C>;
pinSdaRx = <&gpio0 2 GPIO_FLAG_NONE>;
pinSclTx = <&gpio0 1 GPIO_FLAG_NONE>;
pinSdaTx = <&gpio0 2 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 1 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_2>;
i2cPort = <I2C_NUM_1>;
i2cClockFrequency = <400000>;
Expand All @@ -90,8 +90,8 @@
port_b: grove1 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_UART>;
pinSdaRx = <&gpio0 9 GPIO_FLAG_NONE>;
pinSclTx = <&gpio0 8 GPIO_FLAG_NONE>;
pinSdaTx = <&gpio0 9 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 8 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_2>;
i2cPort = <I2C_NUM_1>;
i2cClockFrequency = <400000>;
Expand All @@ -100,8 +100,8 @@
port_c: grove2 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_DISABLED>;
pinSdaRx = <&gpio0 17 GPIO_FLAG_NONE>;
pinSclTx = <&gpio0 18 GPIO_FLAG_NONE>;
pinSdaTx = <&gpio0 17 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 18 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_2>;
i2cPort = <I2C_NUM_1>;
i2cClockFrequency = <400000>;
Expand Down
5 changes: 2 additions & 3 deletions Devices/m5stack-tab5/Source/Configuration.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include "devices/Power.h"
#include "devices/Tab5Keyboard.h"

Expand All @@ -13,11 +12,11 @@ using namespace tt::hal;
static constexpr auto* TAG = "Tab5";

static DeviceVector createDevices() {
::Device* i2c2 = device_find_by_name("i2c2");
auto* i2c2 = device_find_by_name("i2c2");
check(i2c2, "i2c2 not found");
return {
createPower(),
createDisplay(),
createSdCard(),
std::make_shared<Tab5Keyboard>(i2c2)
};
}
Expand Down
4 changes: 3 additions & 1 deletion Devices/m5stack-tab5/Source/devices/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ static std::shared_ptr<tt::hal::touch::TouchDevice> createGt911Touch() {
}

static std::shared_ptr<tt::hal::touch::TouchDevice> createSt7123Touch() {
auto* i2c = device_find_by_name("i2c0");
check(i2c, "i2c0 not found");
auto configuration = std::make_unique<St7123Touch::Configuration>(
I2C_NUM_0,
i2c,
720,
1280,
false, // swapXY
Expand Down
2 changes: 1 addition & 1 deletion Devices/m5stack-tab5/Source/devices/Ili9881cDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bool Ili9881cDisplay::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, cons
.pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565,
.in_color_format = LCD_COLOR_FMT_RGB565,
.out_color_format = LCD_COLOR_FMT_RGB565,
.num_fbs = 1, // TODO: 2?
.num_fbs = 2,
.video_timing =
{
.h_size = 720,
Expand Down
26 changes: 0 additions & 26 deletions Devices/m5stack-tab5/Source/devices/SdCard.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions Devices/m5stack-tab5/Source/devices/SdCard.h

This file was deleted.

2 changes: 1 addition & 1 deletion Devices/m5stack-tab5/Source/devices/St7123Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool St7123Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, const
.dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT,
.dpi_clock_freq_mhz = 70,
.pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565,
.num_fbs = 1,
.num_fbs = 2,
.video_timing = {
.h_size = 720,
.v_size = 1280,
Expand Down
9 changes: 4 additions & 5 deletions Devices/m5stack-tab5/Source/devices/St7123Touch.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#include "St7123Touch.h"

#include <Tactility/Logger.h>
#include <tactility/drivers/esp32_i2c_master.h>
#include <esp_lcd_touch_st7123.h>
#include <esp_err.h>

static const auto LOGGER = tt::Logger("ST7123Touch");

bool St7123Touch::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
esp_lcd_panel_io_i2c_config_t io_config = ESP_LCD_TOUCH_IO_I2C_ST7123_CONFIG();
return esp_lcd_new_panel_io_i2c(
static_cast<esp_lcd_i2c_bus_handle_t>(configuration->port),
&io_config,
&outHandle
) == ESP_OK;
io_config.scl_speed_hz = esp32_i2c_master_get_clock_frequency(configuration->controller);
i2c_master_bus_handle_t bus = esp32_i2c_master_get_bus_handle(configuration->controller);
return esp_lcd_new_panel_io_i2c_v2(bus, &io_config, &outHandle) == ESP_OK;
}

bool St7123Touch::createTouchHandle(esp_lcd_panel_io_handle_t ioHandle, const esp_lcd_touch_config_t& config, esp_lcd_touch_handle_t& touchHandle) {
Expand Down
8 changes: 4 additions & 4 deletions Devices/m5stack-tab5/Source/devices/St7123Touch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <EspLcdTouch.h>
#include <Tactility/TactilityCore.h>
#include <driver/i2c.h>
#include <tactility/device.h>

class St7123Touch final : public EspLcdTouch {

Expand All @@ -12,14 +12,14 @@ class St7123Touch final : public EspLcdTouch {
public:

Configuration(
i2c_port_t port,
::Device* controller,
uint16_t xMax,
uint16_t yMax,
bool swapXy = false,
bool mirrorX = false,
bool mirrorY = false,
gpio_num_t pinInterrupt = GPIO_NUM_NC
) : port(port),
) : controller(controller),
xMax(xMax),
yMax(yMax),
swapXy(swapXy),
Expand All @@ -28,7 +28,7 @@ class St7123Touch final : public EspLcdTouch {
pinInterrupt(pinInterrupt)
{}

i2c_port_t port;
::Device* controller;
uint16_t xMax;
uint16_t yMax;
bool swapXy;
Expand Down
Loading
Loading