大家好、
我不熟悉嵌入式 Linux。
我已配置 TPS65023驱动程序(reguler_TPS65023=Y)并根据设置器件树
https://www.kernel.org/doc/Documentation/devicetree/bindings/regulator/tps65023.txt
i2cdetect 显示我的器件寄存器成功。
0 1 2 3 4 5 6 7 8 9 A b c d e f
00:------------ ------------ ------
10:------------ ------------ ------------ --
20:------------ ------------ ------------ --
30:------------ ------------ ------------ --
40:------------ ------ UU -------------- ----
50:---------- ------------ ------------ --
60:------------ ------------ ------------ --
现在、我想编写一个客户端程序、通过 I2C 控制 LDO 和 DCDC。
是否有一些标准方法来实现这一点?
我希望有类似的东西
include "some_system_file" some_system_function_openI2C(int I2C5); some_system_function_writeBlockI2C(int I2C5, char* data, int length); some_system_function_closeI2C(int I2C5);
我已阅读 https://www.kernel.org/doc/html/latest/i2c/dev-interface.html
smbus 功能似乎非常适合。 但是、I2C_funcs ioctl 检查器件和 用户空间器件驱动程序器件会让我对 smbus 是否真正满足我的要求犹豫不决。
如有任何建议,请提出。
梁