Skip to content
Closed
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
15 changes: 12 additions & 3 deletions Devices/btt-panda-touch/bigtreetech,panda-touch.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_usbhost.h>
#include <tactility/bindings/esp32_ledc_backlight.h>
#include <tactility/bindings/esp32_pwm_ledc.h>
#include <tactility/bindings/pwm_backlight.h>
#include <bindings/rgb_display.h>
#include <bindings/gt911.h>

Expand Down Expand Up @@ -55,9 +56,17 @@
pin-scl = <&gpio0 3 GPIO_FLAG_NONE>;
};

display_backlight_pwm {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 21 GPIO_FLAG_NONE>;
period-ns = <33333>;
ledc-timer = <0>;
ledc-channel = <0>;
};

display_backlight {
compatible = "espressif,esp32-ledc-backlight";
pin-backlight = <&gpio0 21 GPIO_FLAG_NONE>;
compatible = "pwm-backlight";
pwm = <&display_backlight_pwm>;
};

display0 {
Expand Down
2 changes: 1 addition & 1 deletion Devices/cyd-2432s024c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)

idf_component_register(
SRCS ${SOURCE_FILES}
REQUIRES TactilityKernel driver
REQUIRES TactilityKernel
)
54 changes: 50 additions & 4 deletions Devices/cyd-2432s024c/cyd,2432s024c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/esp32_ledc_backlight.h>
#include <tactility/bindings/esp32_pwm_ledc.h>
#include <tactility/bindings/pwm_backlight.h>
#include <tactility/bindings/rgb_led_pwm.h>
#include <bindings/ili9341.h>
#include <bindings/cst816s.h>

Expand Down Expand Up @@ -39,13 +41,57 @@
};
};

rgb_led_channel_red {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 4 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <0>;
inverted;
};

rgb_led_channel_green {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 16 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <1>;
inverted;
};

rgb_led_channel_blue {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 17 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <2>;
inverted;
};

rgb_led_pwm {
compatible = "rgb-led-pwm";
pwm-red = <&rgb_led_channel_red>;
pwm-green = <&rgb_led_channel_green>;
pwm-blue = <&rgb_led_channel_blue>;
// Default is red, and we want to reset it to off by default
default-color = <0 0 0>;
enabled;
};

display_backlight_pwm {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 27 GPIO_FLAG_NONE>;
period-ns = <1953125>;
ledc-timer = <1>;
ledc-channel = <3>;
};

display_backlight {
compatible = "espressif,esp32-ledc-backlight";
compatible = "pwm-backlight";
// Off by default so display power-on won't show the screen from before the last power loss.
// The display backlight is turned on during the boot process.
status = "disabled";
pin-backlight = <&gpio0 27 GPIO_FLAG_NONE>;
frequency-hz = <512>;
pwm = <&display_backlight_pwm>;
};

spi0 {
Expand Down
12 changes: 0 additions & 12 deletions Devices/cyd-2432s024c/source/module.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
#include <tactility/module.h>
#include <tactility/error.h>

#include <driver/gpio.h>

extern "C" {

static error_t start() {
// Set the RGB LED pins to output and turn them off (0 on, 1 off)
gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); // Red
gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT); // Green
gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT); // Blue

gpio_set_level(GPIO_NUM_4, 1); // Red
gpio_set_level(GPIO_NUM_16, 1); // Green
gpio_set_level(GPIO_NUM_17, 1); // Blue

return ERROR_NONE;
}

Expand Down
2 changes: 1 addition & 1 deletion Devices/cyd-2432s024r/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)

idf_component_register(
SRCS ${SOURCE_FILES}
REQUIRES TactilityKernel driver
REQUIRES TactilityKernel
)
54 changes: 50 additions & 4 deletions Devices/cyd-2432s024r/cyd,2432s024r.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_ledc_backlight.h>
#include <tactility/bindings/esp32_pwm_ledc.h>
#include <tactility/bindings/pwm_backlight.h>
#include <tactility/bindings/rgb_led_pwm.h>
#include <bindings/ili9341.h>
#include <bindings/xpt2046.h>

Expand All @@ -24,13 +26,57 @@
gpio-count = <40>;
};

rgb_led_channel_red {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 4 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <0>;
inverted;
};

rgb_led_channel_green {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 16 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <1>;
inverted;
};

rgb_led_channel_blue {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 17 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <2>;
inverted;
};

rgb_led_pwm {
compatible = "rgb-led-pwm";
pwm-red = <&rgb_led_channel_red>;
pwm-green = <&rgb_led_channel_green>;
pwm-blue = <&rgb_led_channel_blue>;
// Default is red, and we want to reset it to off by default
default-color = <0 0 0>;
enabled;
};

display_backlight_pwm {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 27 GPIO_FLAG_NONE>;
period-ns = <1953125>;
ledc-timer = <1>;
ledc-channel = <3>;
};

display_backlight {
compatible = "espressif,esp32-ledc-backlight";
compatible = "pwm-backlight";
// Off by default so display power-on won't show the screen from before the last power loss.
// The display backlight is turned on during the boot process.
status = "disabled";
pin-backlight = <&gpio0 27 GPIO_FLAG_NONE>;
frequency-hz = <512>;
pwm = <&display_backlight_pwm>;
};

spi0 {
Expand Down
2 changes: 0 additions & 2 deletions Devices/cyd-2432s024r/source/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
extern "C" {

static error_t start() {
// Empty for now
return ERROR_NONE;
}

static error_t stop() {
// Empty for now
return ERROR_NONE;
}

Expand Down
2 changes: 1 addition & 1 deletion Devices/cyd-2432s028r/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)

idf_component_register(
SRCS ${SOURCE_FILES}
REQUIRES TactilityKernel driver
REQUIRES TactilityKernel
)
54 changes: 50 additions & 4 deletions Devices/cyd-2432s028r/cyd,2432s028r.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/esp32_ledc_backlight.h>
#include <tactility/bindings/esp32_pwm_ledc.h>
#include <tactility/bindings/pwm_backlight.h>
#include <tactility/bindings/rgb_led_pwm.h>
#include <bindings/ili9341.h>
#include <bindings/xpt2046_softspi.h>

Expand All @@ -33,13 +35,57 @@
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;
};

rgb_led_channel_red {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 4 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <0>;
inverted;
};

rgb_led_channel_green {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 16 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <1>;
inverted;
};

rgb_led_channel_blue {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 17 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <2>;
inverted;
};

display_backlight_pwm {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 21 GPIO_FLAG_NONE>;
period-ns = <1953125>;
ledc-timer = <1>;
ledc-channel = <3>;
};

rgb_led_pwm {
compatible = "rgb-led-pwm";
pwm-red = <&rgb_led_channel_red>;
pwm-green = <&rgb_led_channel_green>;
pwm-blue = <&rgb_led_channel_blue>;
// Default is red, and we want to reset it to off by default
default-color = <0 0 0>;
enabled;
};

display_backlight {
compatible = "espressif,esp32-ledc-backlight";
compatible = "pwm-backlight";
// Off by default so display power-on won't show the screen from before the last power loss.
// The display backlight is turned on during the boot process.
status = "disabled";
pin-backlight = <&gpio0 21 GPIO_FLAG_NONE>;
frequency-hz = <512>;
pwm = <&display_backlight_pwm>;
};

touch {
Expand Down
13 changes: 0 additions & 13 deletions Devices/cyd-2432s028r/source/module.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
#include <tactility/module.h>
#include <tactility/error.h>

#include <driver/gpio.h>

extern "C" {

static error_t start() {
// Set the RGB LED pins to output and turn them off (0 on, 1 off)
gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); // Red
gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT); // Green
gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT); // Blue

gpio_set_level(GPIO_NUM_4, 1); // Red
gpio_set_level(GPIO_NUM_16, 1); // Green
gpio_set_level(GPIO_NUM_17, 1); // Blue

return ERROR_NONE;
}

static error_t stop() {
// Empty for now
return ERROR_NONE;
}

Expand Down
2 changes: 1 addition & 1 deletion Devices/cyd-2432s028rv3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)

idf_component_register(
SRCS ${SOURCE_FILES}
REQUIRES TactilityKernel driver
REQUIRES TactilityKernel
)
Loading
Loading