Add kernel drivers for SPI and UART and make locking APIs more consistent (#489)

- Add kernel support for SPI driver
- Add kernel support for UART driver
- Implemented ESP32 UART kernel driver
- Update existing UART-related code in Tactility to use new kernel driver
- Remove UART from tt::hal::Configuration
- Remove tt_hal_uart functionality but keep functions for now
- Update devicetrees for UART changes
- Kernel mutex and recursive mutex: improved locking API design
- Other kernel improvements
- Added device_exists_of_type() and device_find_by_name()
This commit is contained in:
Ken Van Hoeylandt
2026-02-07 21:28:11 +01:00
committed by GitHub
parent 7e24105d0c
commit 74127a5f6c
119 changed files with 1679 additions and 1792 deletions
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
+1 -26
View File
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -80,31 +81,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
},
},
.uart {
uart::Configuration {
.name = "P1",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_1,
.txPin = GPIO_NUM_3,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
+10
View File
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -20,4 +21,13 @@
pin-sda = <27>;
pin-scl = <22>;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <3>;
pin-rx = <1>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -80,30 +81,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
},
},
.uart {
uart::Configuration {
.name = "P1",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_1,
.txPin = GPIO_NUM_3,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -20,4 +21,13 @@
pin-sda = <27>;
pin-scl = <22>;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <3>;
pin-rx = <1>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/kernel/SystemEvents.h>
@@ -1,5 +1,6 @@
#include "devices/St7701Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/kernel/SystemEvents.h>
+1 -26
View File
@@ -1,6 +1,7 @@
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
@@ -46,31 +47,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr
}
},
.uart {
// P4 header, JST SH 1.0, GND / 3.3V / IO17 / IO18
uart::Configuration {
.name = "UART1",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_17,
.txPin = GPIO_NUM_18,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 9600,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
+10
View File
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -30,4 +31,13 @@
pin-sda = <17>;
pin-scl = <18>;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <18>;
pin-rx = <17>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/SdCard.h"
#include "devices/Display.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -1,6 +1,7 @@
#include "devices/SdCard.h"
#include "devices/Display.h"
#include "devices/Power.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -1,6 +1,7 @@
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -70,55 +71,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr // No custom lock needed
}
},
.uart {
// "UART0-IN"
uart::Configuration {
.name = "UART0",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_44,
.txPin = GPIO_NUM_43,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
},
// "UART1-OUT"
uart::Configuration {
.name = "UART1",
.port = UART_NUM_2,
.rxPin = GPIO_NUM_18,
.txPin = GPIO_NUM_17,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -22,4 +23,22 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart0 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_0>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <17>;
pin-rx = <18>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -72,55 +73,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr // No custom lock needed
}
},
.uart {
// "UART0-IN"
uart::Configuration {
.name = "UART0",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_44,
.txPin = GPIO_NUM_43,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
},
// "UART1-OUT"
uart::Configuration {
.name = "UART1",
.port = UART_NUM_2,
.rxPin = GPIO_NUM_18,
.txPin = GPIO_NUM_17,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -22,4 +23,22 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart0 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_0>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <17>;
pin-rx = <18>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <TCA9534.h>
@@ -56,55 +57,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr // No custom lock needed
}
},
.uart {
// "UART0-OUT"
uart::Configuration {
.name = "UART0",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_44,
.txPin = GPIO_NUM_43,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
},
// "UART1-OUT"
uart::Configuration {
.name = "UART1",
.port = UART_NUM_2,
.rxPin = GPIO_NUM_19,
.txPin = GPIO_NUM_20,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -22,4 +23,22 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart0 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_0>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <20>;
pin-rx = <19>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,6 +1,7 @@
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -72,31 +73,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr // No custom lock needed
}
},
.uart {
// "UART1"
uart::Configuration {
.name = "UART1",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_16,
.txPin = GPIO_NUM_17,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -22,4 +23,13 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <17>;
pin-rx = <16>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -2,6 +2,7 @@
#include "Tactility/lvgl/LvglSync.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Xpt2046Power.h>
@@ -74,31 +75,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr // No custom lock needed
}
},
.uart {
// "UART1"
uart::Configuration {
.name = "UART1",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_3,
.txPin = GPIO_NUM_1,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -22,4 +23,13 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <1>;
pin-rx = <3>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <PwmBacklight.h>
@@ -46,31 +47,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr
}
},
.uart {
// "UART1"
uart::Configuration {
.name = "UART1",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_44,
.txPin = GPIO_NUM_43,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -22,4 +23,13 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart0 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_0>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
@@ -80,31 +81,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr
}
},
.uart {
//CN1 header, JST SH 1.25, GND / IO22 / IO21 / 3.3V
uart::Configuration {
.name = "UART1",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_21,
.txPin = GPIO_NUM_22,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 9600,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -13,7 +14,7 @@
gpio-count = <40>;
};
i2c_internal {
i2c_internal: i2c0 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_0>;
clock-frequency = <400000>;
@@ -21,12 +22,22 @@
pin-scl = <32>;
};
/* CN1 header */
i2c_external {
// CN1 header
i2c_external: i2c1 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_1>;
clock-frequency = <400000>;
pin-sda = <21>;
pin-scl = <22>;
};
// CN1 header, JST SH 1.25, GND / IO22 / IO21 / 3.3V
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <22>;
pin-rx = <21>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -74,31 +75,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr
}
},
.uart {
//P1 header, JST SH 1.25, 5V / TXD (43) / RXD (44) / GND
uart::Configuration {
.name = "UART0",
.port = UART_NUM_0,
.rxPin = GPIO_NUM_44,
.txPin = GPIO_NUM_43,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -13,7 +14,7 @@
gpio-count = <49>;
};
i2c_internal {
i2c_internal: i2c0 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_0>;
clock-frequency = <400000>;
@@ -23,7 +24,7 @@
pin-scl-pullup;
};
i2c_external {
i2c_external: i2c1 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_1>;
clock-frequency = <400000>;
@@ -32,4 +33,14 @@
pin-sda-pullup;
pin-scl-pullup;
};
// P1 header
uart0 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_0>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,6 +1,7 @@
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
@@ -45,31 +46,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr
}
},
.uart {
//P4 header, JST SH 1.0, GND / 3.3V / IO17 / IO18
uart::Configuration {
.name = "UART1",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_17,
.txPin = GPIO_NUM_18,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 9600,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -13,7 +14,7 @@
gpio-count = <49>;
};
i2c_internal {
i2c_internal: i2c0 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_0>;
clock-frequency = <400000>;
@@ -23,7 +24,7 @@
pin-scl-pullup;
};
i2c_external {
i2c_external: i2c1 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_1>;
clock-frequency = <400000>;
@@ -32,4 +33,13 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <18>;
pin-rx = <17>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
+1 -25
View File
@@ -4,6 +4,7 @@
#include "devices/Sdcard.h"
#include "devices/TdeckKeyboard.h"
#include "devices/TrackballDevice.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -50,30 +51,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
}
},
.uart {
uart::Configuration {
.name = "Grove",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_44,
.txPin = GPIO_NUM_43,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 38400,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
+1 -1
View File
@@ -58,7 +58,7 @@ bool initBoot() {
std::vector<tt::hal::gps::GpsConfiguration> gps_configurations;
gps_service->getGpsConfigurations(gps_configurations);
if (gps_configurations.empty()) {
if (gps_service->addGpsConfiguration(tt::hal::gps::GpsConfiguration {.uartName = "Grove", .baudRate = 38400, .model = tt::hal::gps::GpsModel::UBLOX10})) {
if (gps_service->addGpsConfiguration(tt::hal::gps::GpsConfiguration {.uartName = "uart1", .baudRate = 38400, .model = tt::hal::gps::GpsModel::UBLOX10})) {
LOGGER.info("Configured internal GPS");
} else {
LOGGER.error("Failed to configure internal GPS");
+10
View File
@@ -4,6 +4,7 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_i2s.h>
#include <tactility/bindings/esp32_uart.h>
// Reference: https://wiki.lilygo.cc/get_started/en/Wearable/T-Deck-Plus/T-Deck-Plus.html#Pin-Overview
/ {
@@ -40,4 +41,13 @@
pin-data-in = <GPIO_PIN_NONE>;
pin-mclk = <GPIO_PIN_NONE>;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/Power.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -1,4 +1,5 @@
#include "devices/Display.h"
#include <driver/gpio.h>
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/Sdcard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -44,30 +45,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
},
},
.uart {
uart::Configuration {
.name = "STEMMA QT",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_44,
.txPin = GPIO_NUM_43,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 38400,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -22,4 +23,13 @@
pin-sda-pullup;
pin-scl-pullup;
};
stemma_qt: uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -3,6 +3,7 @@
#include "devices/TpagerEncoder.h"
#include "devices/TpagerKeyboard.h"
#include "devices/TpagerPower.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -60,28 +61,5 @@ extern const Configuration hardwareConfiguration = {
.initMode = spi::InitMode::ByTactility,
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
}},
.uart {uart::Configuration {
.name = "Internal",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_4,
.txPin = GPIO_NUM_12,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 38400,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}}
};
+1 -1
View File
@@ -41,7 +41,7 @@ bool tpagerInit() {
gps_service->getGpsConfigurations(gps_configurations);
if (gps_configurations.empty()) {
if (gps_service->addGpsConfiguration(tt::hal::gps::GpsConfiguration {
.uartName = "Internal",
.uartName = "uart0",
.baudRate = 38400,
.model = tt::hal::gps::GpsModel::UBLOX10
})) {
@@ -4,6 +4,7 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_i2s.h>
#include <tactility/bindings/esp32_uart.h>
// Reference: https://wiki.lilygo.cc/get_started/en/LoRa_GPS/T-LoraPager/T-LoraPager.html#Pin-Overview
/ {
@@ -34,4 +35,22 @@
pin-data-in = <17>;
pin-mclk = <10>;
};
uart_internal: uart0 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_0>;
pin-tx = <12>;
pin-rx = <4>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
uart_external: uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -2,6 +2,7 @@
#include "devices/SdCard.h"
#include "devices/CardputerKeyboard.h"
#include "devices/CardputerPower.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -79,31 +80,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr
},
},
.uart {
uart::Configuration {
.name = "Port A",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_2,
.txPin = GPIO_NUM_1,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -4,6 +4,7 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_i2s.h>
#include <tactility/bindings/esp32_uart.h>
// Reference: https://docs.m5stack.com/en/core/Cardputer-Adv
/ {
@@ -45,4 +46,13 @@
pin-data-in = <46>;
pin-mclk = <GPIO_PIN_NONE>;
};
uart_port_a: uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <1>;
pin-rx = <2>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -3,6 +3,7 @@
#include "devices/CardputerEncoder.h"
#include "devices/CardputerKeyboard.h"
#include "devices/CardputerPower.h"
#include <driver/gpio.h>
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
@@ -10,7 +11,7 @@
using namespace tt::hal;
bool initBoot() {
static bool initBoot() {
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT, 512);
}
@@ -78,30 +79,5 @@ extern const Configuration hardwareConfiguration = {
.lock = nullptr
},
},
.uart {
uart::Configuration {
.name = "Port A",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_2,
.txPin = GPIO_NUM_1,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -4,6 +4,7 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_i2s.h>
#include <tactility/bindings/esp32_uart.h>
// Reference: https://docs.m5stack.com/en/core/Cardputer
/ {
@@ -36,4 +37,13 @@
pin-data-in = <46>;
pin-mclk = <GPIO_PIN_NONE>;
};
uart_port_a: uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <1>;
pin-rx = <2>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
+1 -25
View File
@@ -1,6 +1,7 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include "devices/Power.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -46,30 +47,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
}
},
.uart {
uart::Configuration {
.name = "Port A", // Grove
.port = UART_NUM_1,
.rxPin = GPIO_NUM_32,
.txPin = GPIO_NUM_33,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
},
}
};
+10
View File
@@ -4,6 +4,7 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_i2s.h>
#include <tactility/bindings/esp32_uart.h>
// Reference: https://docs.m5stack.com/en/core/Core2
/ {
@@ -46,4 +47,13 @@
pin-data-in = <34>;
pin-mclk = <GPIO_PIN_NONE>;
};
uart_port_a: uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <33>;
pin-rx = <32>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,9 +1,9 @@
#include "InitBoot.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/hal/uart/Uart.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Axp2101Power.h>
@@ -46,76 +46,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
}
},
.uart {
uart::Configuration {
.name = "Port A",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_2,
.txPin = GPIO_NUM_1,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
},
uart::Configuration {
.name = "Port B",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_9,
.txPin = GPIO_NUM_8,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
},
uart::Configuration {
.name = "Port C",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_18,
.txPin = GPIO_NUM_17,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
+10
View File
@@ -4,6 +4,7 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_i2s.h>
#include <tactility/bindings/esp32_uart.h>
// Reference: https://docs.m5stack.com/en/core/CoreS3
/ {
@@ -68,4 +69,13 @@
pin-data-in = <14>;
pin-mclk = <0>;
};
uart_port_a: uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <1>;
pin-rx = <2>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/Power.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -52,30 +53,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
}
},
.uart {
uart::Configuration {
.name = "Grove",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_32,
.txPin = GPIO_NUM_33,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
},
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -32,4 +33,13 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart_grove: uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <33>;
pin-rx = <32>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,4 +1,5 @@
#include "devices/Display.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -54,30 +55,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
}
},
.uart {
uart::Configuration {
.name = "Grove",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_32,
.txPin = GPIO_NUM_33,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
},
}
};
@@ -2,6 +2,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -31,4 +32,13 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart_grove: uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <33>;
pin-rx = <32>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,7 +1,9 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/hal/i2c/I2c.h>
using namespace tt::hal;
+1 -11
View File
@@ -21,15 +21,5 @@ static std::vector<std::shared_ptr<tt::hal::Device>> createDevices() {
extern const Configuration hardwareConfiguration = {
.initBoot = nullptr,
.createDevices = createDevices,
.uart = {
uart::Configuration {
.name = "/dev/ttyUSB0",
.baudRate = 115200
},
uart::Configuration {
.name = "/dev/ttyACM0",
.baudRate = 115200
}
}
.createDevices = createDevices
};
+1
View File
@@ -1,6 +1,7 @@
#include "UnPhoneFeatures.h"
#include "devices/Hx8357Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -49,31 +50,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
}
},
.uart {
//UART Header
uart::Configuration {
.name = "UART0",
.port = UART_NUM_0,
.rxPin = GPIO_NUM_44,
.txPin = GPIO_NUM_43,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -22,4 +23,13 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart0 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_0>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/Sdcard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -68,6 +69,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr
}
},
.uart {}
}
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
@@ -39,31 +40,5 @@ extern const Configuration hardwareConfiguration = {
.isMutable = false,
.lock = nullptr
}
},
.uart {
// "UART1"
uart::Configuration {
.name = "UART1",
.port = UART_NUM_1,
.rxPin = GPIO_NUM_44,
.txPin = GPIO_NUM_43,
.rtsPin = GPIO_NUM_NC,
.ctsPin = GPIO_NUM_NC,
.rxBufferSize = 1024,
.txBufferSize = 1024,
.config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 0,
.source_clk = UART_SCLK_DEFAULT,
.flags = {
.allow_pd = 0,
.backup_before_sleep = 0,
}
}
}
}
};
@@ -3,6 +3,7 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
@@ -22,4 +23,13 @@
pin-sda-pullup;
pin-scl-pullup;
};
uart1 {
compatible = "espressif,esp32-uart";
port = <UART_NUM_1>;
pin-tx = <43>;
pin-rx = <44>;
pin-cts = <GPIO_PIN_NONE>;
pin-rts = <GPIO_PIN_NONE>;
};
};
@@ -1,5 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>