struct i2c_algorithm
具有用於i2c總線實現的master_xfer
的函數指針模板。我在哪裏可以找到linux內核源代碼中的master_xfer
的默認函數例程。 請有人指導我..哪裏可以找到i2c「master_xfer」函數的一般定義?
1
A
回答
0
/driver/i2c/busses /中有i2c-gpio.c文件。在此我們用bit_xfer
來填充master_xfer
函數。它實施起來有點難。
1
什麼master_xfer設置取決於您的平臺和總線。查看drivers/i2c/busses /下的函數指針設置。請注意,它可以設置爲NULL。
其中它被設置的一個例子是在驅動/ I2C /總線/ I2C-pxa.c:
static const struct i2c_algorithm i2c_pxa_algorithm = {
.master_xfer = i2c_pxa_xfer,
.functionality = i2c_pxa_functionality,
};
還看包括/ LINUX/i2c.h中:
struct i2c_algorithm {
/* If an adapter algorithm can't do I2C-level access, set master_xfer
to NULL. If an adapter algorithm can do SMBus access, set
smbus_xfer. If set to NULL, the SMBus protocol is simulated
using common I2C messages */
/* master_xfer should return the number of messages successfully
processed, or a negative value on error */
int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs,
int num);
int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write,
u8 command, int size, union i2c_smbus_data *data);
/* To determine what the adapter supports */
u32 (*functionality) (struct i2c_adapter *);
};
:
* An i2c_msg is the low level representation of one segment of an I2C
* transaction. It is visible to drivers in the @i2c_transfer() procedure,
* to userspace from i2c-dev, and to I2C adapter drivers through the
* @[email protected]_xfer() method.
*
相關問題
- 1. 哪裏可以找到CeCreateDatabaseWithProps的定義
- 2. 哪裏可以找到Theme_Material_Light的定義?
- 3. 哪裏可以找到PHP函數定義
- 4. 哪裏可以找到源函數定義?
- 5. 哪裏可以找到我需要的Symfony2自定義參數?
- 6. C#哪裏可以放一般方法?
- 7. 哪裏可以找到傳入`open()`函數的不同模式的定義
- 8. 我在哪裏可以找到WordPress主題中的自定義函數?
- 9. 我在哪裏可以找到包含printf函數定義的目標文件?
- 10. RsiOPCAuto.dll ...哪裏可以找到?
- 11. 哪裏可以找到Castle.MicroKernel.dll
- 12. 哪裏可以找到VBSQL.VBX?
- 13. 哪裏可以找到ipseccmd.exe?
- 14. 哪裏可以找到NestedScrollView?
- 15. 哪裏可以找到php_printer.dll?
- 16. 哪裏可以找到FlowPanel?
- 17. 哪裏可以找到tcadsdll.dll?
- 18. 哪裏可以找到AppCompatPreferenceActivity?
- 19. 哪裏可以找到pg_config?
- 20. 哪裏可以找到MyGeneration.dOOdads.dll
- 21. 哪裏可以找到GetMemberInfo
- 22. 哪裏可以找到org.eclipse.jface.nl_de?
- 23. 哪裏可以找到fillPatternId?
- 24. 哪裏可以找到
- 25. 哪裏可以找到定製
- 26. 我在哪裏可以找到spatstat中類對象的定義
- 27. 哪裏可以找到信號和報警功能的定義?
- 28. 我在哪裏可以找到scala.Any和scala.AnyRef的定義?
- 29. 什麼是__dirstream,我們在哪裏可以找到的定義
- 30. 哪裏可以找到窗口消息的定義WM_UAHDRAWMENUITEM(0x92)
感謝您的澄清..是有用的...但假設如果我使用I2c-gpio,請參考。 – kzs
@kzs它看起來像撞擊i2c-gpio接口只使用i2c_adapter結構,而不是i2c_algorithm。 –
沒有彼得,其實它使用,有相同的路徑i2c-gpio.c。因爲我們正在用bit_xfer填充master_xfer函數。感謝您的參考。 – kzs