内核中有这样的实现方式:
2879 static struct i2c_gpio_platform_data da850_gpio_i2c_pdata = {
2880 .sda_pin = GPIO_TO_PIN(1, 4),
2881 .scl_pin = GPIO_TO_PIN(1, 5),
2882 .udelay = 2, /* 250 KHz */
2883 };
2884
2885 static struct platform_device da850_gpio_i2c = {
2886 .name = "i2c-gpio",
2887 .id = 1,
2888 .dev = {
2889 .platform_data = &da850_gpio_i2c_pdata,
2890 },
2891 };
platform_device_register(&da850_gpio_i2c);
我是不是只要将
2880 .sda_pin = GPIO_TO_PIN(1, 4),
2881 .scl_pin = GPIO_TO_PIN(1, 5),
配置成我当前使用的gpio就实现了gpio模拟i2c的功能,求大神出来指导下
内核中有这样的实现方式:
2879 static struct i2c_gpio_platform_data da850_gpio_i2c_pdata = {
2880 .sda_pin = GPIO_TO_PIN(1, 4),
2881 .scl_pin = GPIO_TO_PIN(1, 5),
2882 .udelay = 2, /* 250 KHz */
2883 };
2884
2885 static struct platform_device da850_gpio_i2c = {
2886 .name = "i2c-gpio",
2887 .id = 1,
2888 .dev = {
2889 .platform_data = &da850_gpio_i2c_pdata,
2890 },
2891 };
platform_device_register(&da850_gpio_i2c);
我是不是只要将
2880 .sda_pin = GPIO_TO_PIN(1, 4),
2881 .scl_pin = GPIO_TO_PIN(1, 5),
配置成我当前使用的gpio就实现了gpio模拟i2c的功能,求大神出来指导下
举报