...this is a standard rpi3 with stretch, using pythonThe device specifies the number of returned bytes, not the user
Did you ask Python?picandies wrote: ↑Tue Sep 25, 2018 4:17 pm...this is a standard rpi3 with stretch, using pythonThe device specifies the number of returned bytes, not the user
get_my_data= bus.read_block_data(WHAT EXACTLY GOES IN HERE)
WHAT are these parameters , please list & describe
I need to read 10 bytes of data to be rcvd
Code: Select all
[email protected]:~ $ python3 Python 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170124] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import smbus >>> help(smbus.SMBus.read_block_data) Help on method_descriptor: read_block_data(...) read_block_data(addr, cmd) -> results Perform SMBus Read Block Data transaction.
i2c_smbus_read_block_data — SMBus block read request
s32 i2c_smbus_read_block_data ( struct i2c_client * client,
u8 * values);
Handle to slave device
Command byte issued to let the slave know what data should be returned
Byte array into which data will be read; big enough to hold the data returned by the slave. SMBus allows at most 32 bytes.
Returns the number of bytes read in the slave's response, else a negative number to indicate some kind of error.
Note that using this function requires that the client's adapter support the I2C_FUNC_SMBUS_READ_BLOCK_DATA functionality. Not all adapter drivers support this; its emulation through I2C messaging relies on a specific mechanism (I2C_M_RECV_LEN) which may not be implemented.
Thanks for the reply, though I'm not sure how it makes sense...This mean you'd do the following?s32 i2c_smbus_read_block_data ( struct i2c_client * client,
u8 * values);
Python's help() function shows you the docstring for the object you pass it so it is up to the author of a module to proved relevant text.
Usually the 1st place I'd look is in the horse's mouth http://www.smbus.org/specs/], it doesn't give Python implementation but Python's is a wrapper around the original C.By the way where is this info actually defined/described in the real world (as an actual document rather then posts/comments)
I originally looked around there , but no answer to my question about the command parameter format for the python commands.Usually the 1st place I'd look is in the horse's mouth http://www.smbus.org/specs/], it doesn't give Python implementation