Skip to content

Commit e0bef63

Browse files
waveshare_esp32_s3_touch_lcd_2: cleanups
1 parent c727ecc commit e0bef63

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

internal_filesystem/lib/mpos/board/waveshare_esp32_s3_touch_lcd_2.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
2323
LCD_CS = 45
2424
LCD_BL = 1
2525

26-
I2C_BUS = 0
27-
I2C_FREQ = 400000
28-
TP_SDA = 48
29-
TP_SCL = 47
30-
TP_ADDR = 0x15
31-
TP_REGBITS = 8
32-
3326
print("waveshare_esp32_s3_touch_lcd_2.py machine.SPI.Bus() initialization")
3427
try:
3528
spi_bus = machine.SPI.Bus(host=SPI_BUS, mosi=LCD_MOSI, miso=LCD_MISO, sck=LCD_SCLK)
@@ -82,8 +75,8 @@
8275
mpos.ui.main_display.set_backlight(100)
8376

8477
# Touch handling:
85-
i2c_bus = i2c.I2C.Bus(host=I2C_BUS, scl=TP_SCL, sda=TP_SDA, freq=I2C_FREQ, use_locks=False)
86-
touch_dev = i2c.I2C.Device(bus=i2c_bus, dev_id=TP_ADDR, reg_bits=TP_REGBITS)
78+
i2c_bus = i2c.I2C.Bus(host=0, scl=47, sda=48, freq=400000, use_locks=False)
79+
touch_dev = i2c.I2C.Device(bus=i2c_bus, dev_id=0x15, reg_bits=8)
8780
indev = cst816s.CST816S(touch_dev, startup_rotation=lv.DISPLAY_ROTATION._180) # button in top left, good
8881
InputManager.register_indev(indev)
8982

@@ -124,7 +117,6 @@ def adc_to_voltage(adc_value):
124117
from mpos import SensorManager
125118

126119
# IMU is on I2C0 (same bus as touch): SDA=48, SCL=47, addr=0x6B
127-
# i2c_bus was created on line 75 for touch, reuse it for IMU
128120
SensorManager.init(i2c_bus, address=0x6B, mounted_position=SensorManager.FACING_EARTH)
129121

130122
# === CAMERA HARDWARE ===

0 commit comments

Comments
 (0)