在线时间543 小时
UID1650185
注册时间2017-4-19
NXP金币600
TA的每日心情 | 怒 2021-1-28 20:09 |
---|
签到天数: 317 天 连续签到: 1 天 [LV.8]以坛为家I
金牌会员
 
- 积分
- 9291
- 最后登录
- 2022-5-12
|
本帖最后由 小马哥-1650185 于 2018-4-9 15:52 编辑
实验用到3路iic,都用io模拟
第一路用 硬件iic的io口,驱动为io模拟
sda1: GPIO->B[0][24]
scl1: GPIO->B[0][23]
调试没什么问题,一切都是正常的...
然而换成别的io就不行了,同样的驱动,只换了io口,iic从设备一直应答失败.
驱动在别的设备上移植的,,,在上面io模拟的iic也是ok的.
如下: 第二路
sda2: GPIO->B[1][11](复用KEY3)
scl2: GPIO->B[0][15](复用LED0)
第三路
sda3: GPIO->B[0][21](复用LED2)
scl3: GPIO->B[0][22](复用LED3)
怀疑是万利板子的io复用功能影响的,现把复用的设备拆掉还是不行,,甚至还把 复用外设的线割断了还是不行..不知道是不是io的问题,还是配置问题,
不过仿真看着 这些io是有高低电平变化的.
io初始化如下:
- gpio_pin_config_t led_config = { kGPIO_DigitalOutput, 0, };
- CLOCK_EnableClock(kCLOCK_Gpio0);
- CLOCK_EnableClock(kCLOCK_Gpio1);
-
- GPIO_PinInit(GPIO, 0, 24, &led_config);//
- GPIO_PinInit(GPIO, 0, 23, &led_config);//
- GPIO_PinInit(GPIO, 1, 11, &led_config);//
- GPIO_PinInit(GPIO, 0, 15, &led_config);//
- GPIO_PinInit(GPIO, 0, 21, &led_config);//
- GPIO_PinInit(GPIO, 0, 22, &led_config);//
复制代码
|
|