On 2023-10-28, Chris Green wrote:
I am using the python3 smbus module, but it's hard work because of the
lack of documentation. Web searches confirm that the documentation is somewhat thin!
The SMBus spec is available from http://smbus.org (or at least it used
to be ... watch it be hidden behind a paywall now).
I am using the python3 smbus module, but it's hard work because of the
lack of documentation. Web searches confirm that the documentation is somewhat thin!
If you do the obvious this is what you get:-
>>> import smbus dir (smbus)
['SMBus', '__doc__', '__file__', '__loader__', '__name__',
'__package__', '__spec__']
>>> help(smbus)
Help on module SMBus:gnueabihf.so
NAME
SMBus
DESCRIPTION
This module defines an object type that allows SMBus
transactions on hosts running the Linux kernel. The host kernel
must have I2C support, I2C device interface support, and a bus
adapter driver.
All of these can be either built-in to the kernel, or loaded
from modules.
Because the I2C device interface is opened R/W, users of this
module usually must have root permissions.
FILE
/usr/lib/python3/dist-packages/smbus.cpython-39-arm-linux-
Even a list of available methods would be handy! :-)
Presumably python3's smbus is just a wrapper so if I could find the underlying C/C++
documentation it might help.
Il Sat, 28 Oct 2023 17:08:00 +0100, Chris Green ha scritto:
I am using the python3 smbus module, but it's hard work because of the
lack of documentation. Web searches confirm that the documentation is somewhat thin!
If you do the obvious this is what you get:-
>>> import smbus dir (smbus)
['SMBus', '__doc__', '__file__', '__loader__', '__name__',
'__package__', '__spec__']
>>> help(smbus)
Help on module SMBus:
NAME
SMBus
DESCRIPTION
This module defines an object type that allows SMBus
transactions on hosts running the Linux kernel. The host kernel
must have I2C support, I2C device interface support, and a bus
adapter driver.
All of these can be either built-in to the kernel, or loaded
from modules.
Because the I2C device interface is opened R/W, users of this
module usually must have root permissions.
FILEgnueabihf.so
/usr/lib/python3/dist-packages/smbus.cpython-39-arm-linux-
Even a list of available methods would be handy! :-)
Presumably python3's smbus is just a wrapper so if I could find the underlying C/C++
documentation it might help.
https://pypi.org/project/smbus2/
smbus2 is designed to be a "drop-in replacement of smbus". SO you can look
at its documentation for or use it instead of smbus.
Disclaimer: I haven't any experience on this library
I am using the python3 smbus module, but it's hard work because of the
lack of documentation. Web searches confirm that the documentation is >somewhat thin!
If you do the obvious this is what you get:-
>>> import smbus
>>> dir (smbus)
['SMBus', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__']
>>> help(smbus)
...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 446 |
Nodes: | 16 (2 / 14) |
Uptime: | 19:36:58 |
Calls: | 9,234 |
Calls today: | 1 |
Files: | 13,496 |
Messages: | 6,063,226 |