linux IIC设备驱动开发
发布时间
阅读量:
阅读量
一,SPI设备驱动框架
在 platform驱动框架和PWM驱动框架中,均涉及到了驱动的分离概念,即控制器或总线与设备之间的分离。I2C的驱动架构划分为I2C总线与I2C设备两个部分。其中总线对应的是芯片内部所集成的I2C资源,而设备则指通过I2C接口连接的外部用户设备,例如RTC、EEPROM等。
1,I2C控制器驱动:在内核中,采用结构体i2c_adapter来描述I2C控制器,该结构体的定义位于文件include/linux/i2c.h之中。
struct i2c_adapter
{
struct module *owner;
unsigned int class; /* classes to allow probing for */
const struct i2c_algorithm *algo; /* the algorithm to access the bus */
void *algo_data;
/* data fields that are valid for all devices */
const struct i2c_lock_operations *lock_ops;
全部评论 (0)
还没有任何评论哟~
