Touchscreen driver POC
Example documentation
This commit is contained in:
+27
-3
@@ -17,6 +17,8 @@
|
||||
# |Display RST |GPIO5 |Pin11/GPIO17/SPI1_CE1 |Orange |
|
||||
# |Touch SDA |GPIO21 |Pin3/GPIO2/I2C1_SDA |Gray |
|
||||
# |Touch SCL |GPIO22 |Pin5/GPIO3/I2C1_SCL |Purple |
|
||||
# |Touch RST |GPIO15 |Pin13/GPIO27 |Blue |
|
||||
# |Touch INT |GPIO16 |Pin15/GPIO22 |White |
|
||||
#
|
||||
# Exposed Entities
|
||||
# ---
|
||||
@@ -64,10 +66,26 @@ spi:
|
||||
|
||||
# For the touchscreen
|
||||
i2c:
|
||||
id: i2c_bus
|
||||
sda: GPIO21
|
||||
scl: GPIO22
|
||||
scan: false
|
||||
|
||||
|
||||
touchscreen:
|
||||
platform: icnt86x
|
||||
id: touchscreen0
|
||||
address: 0x48
|
||||
reset_pin: GPIO15
|
||||
update_interval: 50ms
|
||||
calibration:
|
||||
x_min: 0
|
||||
x_max: 295
|
||||
y_min: 0
|
||||
y_max: 127
|
||||
transform:
|
||||
mirror_x: true
|
||||
mirror_y: true
|
||||
|
||||
### Okay, now the Good Stuff ###
|
||||
|
||||
# Load some fonts for the display renderer (we don't neeed these with LVGL)
|
||||
@@ -106,7 +124,7 @@ binary_sensor:
|
||||
inverted: true
|
||||
id: boot_button
|
||||
internal: true
|
||||
on_press:
|
||||
on_click:
|
||||
then:
|
||||
- component.update: lvgl0
|
||||
- delay: 1s
|
||||
@@ -132,6 +150,8 @@ lvgl:
|
||||
- id: lvgl0
|
||||
displays:
|
||||
- display0
|
||||
touchscreens:
|
||||
- touchscreen0
|
||||
# on_draw_end:
|
||||
# - component.update: display0
|
||||
bg_color: 0xFFFFFF
|
||||
@@ -154,12 +174,14 @@ lvgl:
|
||||
bg_color: 0xFFFFFF
|
||||
widgets:
|
||||
- label:
|
||||
text: 'Test 2bpp 1532'
|
||||
text: 'Test 2bpp 1636'
|
||||
align: TOP_LEFT
|
||||
text_font: font1
|
||||
- button:
|
||||
id: button0
|
||||
align: TOP_RIGHT
|
||||
on_click:
|
||||
- logger.log: "button0 clicked (unlock)"
|
||||
widgets:
|
||||
- image:
|
||||
src: home_lock_open
|
||||
@@ -167,6 +189,8 @@ lvgl:
|
||||
- button:
|
||||
id: button1
|
||||
align: BOTTOM_RIGHT
|
||||
on_click:
|
||||
- logger.log: "button1 clicked (lock)"
|
||||
widgets:
|
||||
- image:
|
||||
src: home_lock
|
||||
|
||||
Reference in New Issue
Block a user