您尚未登录。

楼主 #1 2019-11-16 18:18:24

psst
会员
注册时间: 2019-01-22
已发帖子: 92
积分: 22.5

v3s 怎么使用gpio模拟iic

请教各位高手。我想用drivers/i2c/busses/i2c-gpio.c 模拟iic,硬件iic口没有使用,io被占用了。要怎么玩?

menuconfig配置如下
-*- I2C support
Enable compatibility bits for old user-space
<*> I2C device interface
<*> I2C bus multiplexing support
Multiplexer I2C Chip support --->
[**] Autoselect pertinent helper modules
I2C Hardware Bus support --->
*** I2C system bus drivers (mostly embedded / system-on-chip)
│ │ < > CBUS I2C driver
│ │ < > Synopsys DesignWare Platform
│ │ < > EMMA Mobile series I2C adapter
│ │ <*> GPIO-based bitbanging I2C
│ │ < > Marvell mv64xxx I2C Controller
│ │ < > OpenCores I2C Controller
│ │ < > PCA9564/PCA9665 as platform device
│ │ < > Rockchip RK3xxx I2C adapter
│ │ < > Simtec Generic I2C interface

dts如下

i2c0@0 {
compatible = "i2c-gpio";
gpios = <&pio 2 2 // sda
&pio 2 1 // scl

;

i2c-gpio,sda-open-drain;
i2c-gpio,scl-open-drain;
i2c-gpio,delay-us = <2>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
//rv3029c2@56 {
//compatible = "rv3029c2";
//reg = <0x56>;
//};

};

启动后报错, OF: /soc/i2c0@0: could not get #gpio-cells for /soc/clock@01c20000
是不是gpio配置不对,
&pio 2 2 / sda /
&pio 2 1这两个口是串口,没有使用,应该不会被占用,

设备树怎么写?请教大家了

最近编辑记录 psst (2019-11-16 18:19:36)

离线

页脚

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

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


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