freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

第11課字符設(shè)備驅(qū)動-閱讀頁

2024-10-18 16:41本頁面
  

【正文】 ies。 /*適配器設(shè)備 */ ? int nr。 /* client鏈表頭 */ ? char name[48]。 ? }。 ? //SMBus傳輸函數(shù)指針 ? int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 mand, int size, union i2c_smbus_data *data)。 ? }。 /*從設(shè)備地址 */ ? __u16 flags。 /*消息長度 */ ? __u8 *buf。 i2c_client ? struct i2c_client { ? unsigned short flags。 /*芯片地址,注意: 7位地址存儲在低 7位 */ ? char name[I2C_NAME_SIZE]。 /*依附的 i2c_adapter指針 */ ? struct i2c_driver *driver。 /*設(shè)備結(jié)構(gòu)體 */ ? int irq。 /*鏈表頭 */ ? struct list_head detected。 /*用于同步 */ ? }。 /*唯一的驅(qū)動 id*/ ? unsigned int class。 /*適配器添加函數(shù)(舊式) */ ? int (*detach_adapter)(struct i2c_adapter *)。 /*設(shè)備刪除函數(shù)(舊式) */ ? int (*probe)(struct i2c_client *, const struct i2c_device_id *)。 /*設(shè)備刪除函數(shù)(新式) */ ? void (*shutdown)(struct i2c_client *)。 /*設(shè)備掛起函數(shù) */ ? int (*resume)(struct i2c_client *)。 /*類似 ioctl*/ ? struct device_driver driver。 /*此驅(qū)動支持的 I2C設(shè)備列表 */ ? int (*detect)(struct i2c_client *, int kind, struct i2c_board_info *)。 ? struct list_head clients。 I2C核心 ? 提供了一套接口函數(shù),允許一個 I2C adapter、 I2C driver和 I2C client在初始化時在 I2C Core中進行注冊,以及在退出時進行注銷 。 – int i2c_del_adapter(struct i2c_adapter *adapter)。 – void i2c_del_driver(struct i2c_driver *driver)。 – int i2c_detach_client(struct i2c_client *)。 – int i2c_master_send(struct i2c_client *client, const char *buf, int count)。 I2C總線驅(qū)動 ? I2C總線驅(qū)動的任務(wù),是為系統(tǒng)中各個 I2C總線增加相應(yīng)的讀寫方法 。 ? 當(dāng) I2C總線驅(qū)動模塊被卸載時,卸載函數(shù)需要釋放 I2C適配器所占用的硬件資源,然后通過 i2c_del_adapter() 函數(shù)注銷 i2c_adapter結(jié)構(gòu)體 。 主要是 實現(xiàn) 其 中的 master_xfer() 函數(shù)和 functionality() 函數(shù)。 ? I2C設(shè)備驅(qū)動也分成兩個模塊,它們分別是 i2c_driver和i2c_client結(jié)構(gòu)體 。 ? I2C設(shè)備驅(qū)動程序,實現(xiàn)了字符設(shè)備的文件操作接口,對設(shè)備的具體訪問是通過 I2C適配器來實現(xiàn)的。同時構(gòu)造一個對用戶層接口的數(shù)據(jù)結(jié)構(gòu),并通過接口函數(shù)向內(nèi)核注冊一個主設(shè)備號為 89的字符 設(shè)備。 ? i2cdev_read() 和 i2cdev_write() 函數(shù)分別實現(xiàn)了用戶空間的 read和 write操作,這兩個函數(shù)又分別會調(diào)用 I2C核心的 i2c_master_recv() 和 i2c_master_send() 函數(shù)來構(gòu)造一條 I2C消息,并且最終調(diào)用 i2c_algorithm提供的函數(shù)接口來完成消息的
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1