您尚未登录。

楼主 #1 2020-01-01 15:08:08

staunchheart
会员
注册时间: 2019-12-17
已发帖子: 232
积分: 190

F1C100S中 XBOOT下移GT911遇到问题,请教

在GT911初始化时
if(!gt911_read(dev, GT911_CONFIG_DATA, &cfg, 1))
调用i2c-f1c100s中的
static int f1c100s_i2c_wait_status(struct i2c_f1c100s_pdata_t * pdat)
{
ktime_t timeout = ktime_add_ms(ktime_get(), 1);
do {
if((read32(pdat->virt + I2C_CNTR) & (1 << 3)))
return read32(pdat->virt + I2C_STAT);
} while(ktime_before(ktime_get(), timeout));
LOG("f1c100s_i2c_status(pdat) timeout");
return I2C_STAT_BUS_ERROR;
}

打印总是超时,我将这份代码移植到RT-Thread中也是一样,也是这里超时

cast-kk131.json中

"i2c-f1c100s@0x01c27000": {
"clock-name": "link-i2c0",
"clock-frequency": 400000,
"reset": 130,
"sda-gpio": 140,
"sda-gpio-config": 3,
"scl-gpio": 139,
"scl-gpio-config": 3
},
"ts-gt911@0": {
"i2c-bus": "i2c-f1c100s.0",
"slave-address": 20,
"interrupt-gpio": 131,
"interrupt-gpio-config": 6,
"reset-gpio": 130,
"reset-gpio-config": 1
},

最近编辑记录 staunchheart (2020-01-01 15:09:32)

离线

楼主 #3 2020-01-01 16:32:31

staunchheart
会员
注册时间: 2019-12-17
已发帖子: 232
积分: 190

Re: F1C100S中 XBOOT下移GT911遇到问题,请教

触摸电路如图

i2c-f1c100s中
if(pdat->sda >= 0)
{
if(pdat->sdacfg >= 0)
gpio_set_cfg(pdat->sda, pdat->sdacfg);
gpio_set_pull(pdat->sda, GPIO_PULL_UP);
}
if(pdat->scl >= 0)
{
if(pdat->sclcfg >= 0)
gpio_set_cfg(pdat->scl, pdat->sclcfg);
gpio_set_pull(pdat->scl, GPIO_PULL_UP);
}

最近编辑记录 staunchheart (2020-01-01 16:38:38)

离线

楼主 #4 2020-01-02 11:13:47

staunchheart
会员
注册时间: 2019-12-17
已发帖子: 232
积分: 190

Re: F1C100S中 XBOOT下移GT911遇到问题,请教

补充一下
I2C是PE11,PE12
INT PE3
RST PE2
有没有什么思路?

离线

楼主 #5 2020-01-03 20:41:00

staunchheart
会员
注册时间: 2019-12-17
已发帖子: 232
积分: 190

Re: F1C100S中 XBOOT下移GT911遇到问题,请教

我学艺不精,以为I2C的REST是指I2C的REST脚。
实际上是要DEVICE_TYPE_RESETCHIP中的。
将rest改为80就好了。。。
另外GITEE上的master上的GT911驱动,启动时序是错误的
橘子 :
https://github.com/xboot/xboot/pull/11/commits/b119553d16f6b260090f16436e250ff316a550a4
感谢橘子大神

最近编辑记录 staunchheart (2020-01-03 20:44:21)

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn


东莞哇酷科技有限公司开发