問題タブ [smbus]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - SMbus からの 2 番目のリリースは正しいですか?
SMbus パッケージをインポートしたい: リンク
(私はPython 3.7を使用しています)
win10およびVisual Code内でcmdウィンドウで実行してみました。( pip install smbus
)
- install "smbus2" を実行できました。しかし、このパッケージには「smbus」も必要です:(
私はいつもこのエラーメッセージを受け取ります:
c - SMBus Block Read with address offset after writing initial command
I am trying to implement a master Linux driver to communicate with an Omron D6t-PH differential pressure flow-meter slave device.
Reading the manual for this instrument, and the provided sample code (which is for an STM32 uC) it appears I need to increment the slave address following the initial "write to the access address". This will allow me to read measured data from the device.
There IS a function provided within the Linux i2c smbus library here that will do this, although it does not appear to support the address increment that follows the initial "access register write".
Does anyone know a workaround or some advice on how to handle this device address incrementing requirement?
Below is some doc and guides I have been following. First is the device manual;
Address increment requirement is shown on P.7 Table 3. of the D6T... manual
During Write: Set LSB of slave address to “0” to form D8h (1101_1000b).
During Read: Set LSB of slave address to “1” to form D9h (1101_1001b).
Flow chart of the commands required are on P.12,P20-22
Some sample code which outlines the same is on P.28
I2C1_MastrSel(add, 1); /* Slave 7bit => 8bit for RD */
With respect to the master Linux user space driver I am trying to write, how can I alter the "SMBus Block Read" command so i can increment the address following the second "Start" command? Here is the commands structure:
S Addr Wr [A] Comm [A] S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P
This is some prototype code which I have written so far its a success up to the point of the block read: