自定义LCD触摸无法使用

Viewed 49

问题描述


fpioa.set_function(52, FPIOA.IIC3_SCL)
fpioa.set_function(53, FPIOA.IIC3_SDA)
i2c3=I2C(3)
tp = TOUCH(1,i2c = i2c3, type = TOUCH.TYPE_CST328)
1.3SDK使用以上代码可以正常使用,将SDK更新为1.5版本之后,使用会报以下的错误:
RuntimeError: Custom Touch Device created failed

硬件板卡


正点原子

软件版本


CanMV_K230D_ATK_DNK230D_micropython_v1.5-legacy-0-g413737f_nncase_v2.9.0.img

1 Answers
import os, time
from machine import FPIOA, I2C, TOUCH, Pin

fpioa = FPIOA()
# touch int
fpioa.set_function(2, FPIOA.GPIO2)
# touch rst
fpioa.set_function(3, FPIOA.GPIO3)

# touch i2c
i2c2=I2C(2, scl = 11, sda = 12)
# print(i2c2.scan())

#touch = TOUCH(1, i2c = i2c2)
touch = TOUCH(1, i2c = i2c2, rst = 2, int = 3)
# touch = TOUCH(1, i2c = i2c3, rst = 2, int = 3, range_x = 480, range_y = 800)

print(touch)

while True:
    point = touch.read(5)

    if len(point):
        print(point)
    time.sleep(0.1)

你好,请参考这个,和文档https://www.kendryte.com/k230_canmv/zh/main/zh/api/machine/K230_CanMV_TOUCH%E6%A8%A1%E5%9D%97API%E6%89%8B%E5%86%8C.html#id2