以下是一些 i2c_get_adapter 函数的常见用法: 1. 使用i2c_get_adapter 函数来获取默认的 I2C 适配器,代码示例如下: structi2c_adapter*adapter; adapter=i2c_get_adapter(0); 这段代码将获取默认的 I2C 适配器,并将其赋值给 adapter 变量。 2. 使用i2c_get_adapter 函数来获取指定编号的 I2C 适配器,代码...
控制器驱动I2C总线驱动重点是I2C适配器驱动,这里要用到两个重要的数据结构:i2c_adapter和i2c_algorithm。其中,Linux 内核将 SOC 的I2C适配器 2023-07-22 15:38:35 I2C子系统SW Architecture 适配器(控制器)驱动,这里用到两个重要的数据结构:i2c_adapter和i2c_algorithm。其中,Linux 内核将 SOC 的I2C适配器(控制...
i2c->adap.algo_data = i2c; // i2c_adapter私有信息结构数据为 s3c24xx_i2c *i2c i2c->adap.dev.parent = &pdev->dev; /* initialise the i2c controller */ ret = s3c24xx_i2c_init(i2c); // 硬件初始化 if (ret != 0) goto err_iomap; /* find the IRQ for this unit (note, this re...