![]() |
i2c
1.4.2
RoadNarrows Robotics I2C Package
|
I2C class. More...
Public Member Functions | |
def | __init__ (self) |
Class constructor. | |
def | __del__ (self) |
Destructor. | |
def | open (self, device) |
Open a I2C bus device. More... | |
def | close (self) |
Close an open I2C bus device. More... | |
def | is_open (self) |
Test if I2C bus is open. More... | |
def | read (self, addr, count) |
Read data from an attached device connected to the open I2C bus. More... | |
def | write (self, addr, buf) |
Write data to an attached device connected to the open I2C bus. More... | |
def | transfer (self, addr, buf, count) |
Transfer data to an attached device connected to the open I2C bus and receive response. More... | |
def | write_read (self, addr, buf, count) |
Write/read data to/from an attached device connected to the open I2C bus. More... | |
def | check (self, addr) |
Test for the existence of a device with the given address. More... | |
def | scan (self) |
Scan I2C bus for all attached devices. More... | |
def | __init__ (self) |
Class constructor. | |
def | __del__ (self) |
Destructor. | |
def | open (self, device) |
Open a I2C bus device. More... | |
def | close (self) |
Close an open I2C bus device. More... | |
def | is_open (self) |
Test if I2C bus is open. More... | |
def | read (self, addr, count) |
Read data from an attached device connected to the open I2C bus. More... | |
def | write (self, addr, buf) |
Write data to an attached device connected to the open I2C bus. More... | |
def | transfer (self, addr, buf, count) |
Transfer data to an attached device connected to the open I2C bus and receive response. More... | |
def | write_read (self, addr, buf, count) |
Write/read data to/from an attached device connected to the open I2C bus. More... | |
def | check (self, addr) |
Test for the existence of a device with the given address. More... | |
def | scan (self) |
Scan I2C bus for all attached devices. More... | |
def | __init__ (self) |
Class constructor. | |
def | __del__ (self) |
Destructor. | |
def | open (self, device) |
Open a I2C bus device. More... | |
def | close (self) |
Close an open I2C bus device. More... | |
def | is_open (self) |
Test if I2C bus is open. More... | |
def | read (self, addr, count) |
Read data from an attached device connected to the open I2C bus. More... | |
def | write (self, addr, buf) |
Write data to an attached device connected to the open I2C bus. More... | |
def | transfer (self, addr, buf, count) |
Transfer data to an attached device connected to the open I2C bus and receive response. More... | |
def | write_read (self, addr, buf, count) |
Write/read data to/from an attached device connected to the open I2C bus. More... | |
def | check (self, addr) |
Test for the existence of a device with the given address. More... | |
def | scan (self) |
Scan I2C bus for all attached devices. More... | |
Public Attributes | |
m_device | |
m_fd | |
m_addr | |
def rnr.i2c.i2c.check | ( | self, | |
addr | |||
) |
Test for the existence of a device with the given address.
addr | Device address to check. |
Definition at line 278 of file i2c.py.
References rnr.i2c.i2c.m_addr, and rnr.i2c.i2c.m_fd.
Referenced by rnr.i2c.i2c.check(), and rnr.i2c.i2c.scan().
def rnr.i2c.i2c.check | ( | self, | |
addr | |||
) |
Test for the existence of a device with the given address.
addr | Device address to check. |
Definition at line 278 of file i2c.py.
References rnr.i2c.i2c.check(), rnr.i2c.i2c.m_addr, and rnr.i2c.i2c.m_fd.
def rnr.i2c.i2c.check | ( | self, | |
addr | |||
) |
Test for the existence of a device with the given address.
addr | Device address to check. |
Definition at line 278 of file i2c.py.
References rnr.i2c.i2c.check(), rnr.i2c.i2c.m_addr, and rnr.i2c.i2c.m_fd.
def rnr.i2c.i2c.close | ( | self | ) |
Close an open I2C bus device.
Raises I2CException on error.
Definition at line 144 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, and rnr.i2c.i2c.m_fd.
Referenced by rnr.i2c.i2c.__del__(), and rnr.i2c.i2c.close().
def rnr.i2c.i2c.close | ( | self | ) |
Close an open I2C bus device.
Raises I2CException on error.
Definition at line 144 of file i2c.py.
References rnr.i2c.i2c.close(), rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, and rnr.i2c.i2c.m_fd.
def rnr.i2c.i2c.close | ( | self | ) |
Close an open I2C bus device.
Raises I2CException on error.
Definition at line 144 of file i2c.py.
References rnr.i2c.i2c.close(), rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, and rnr.i2c.i2c.m_fd.
def rnr.i2c.i2c.is_open | ( | self | ) |
Test if I2C bus is open.
Definition at line 160 of file i2c.py.
References rnr.i2c.i2c.is_open(), and rnr.i2c.i2c.m_fd.
def rnr.i2c.i2c.is_open | ( | self | ) |
Test if I2C bus is open.
Definition at line 160 of file i2c.py.
References rnr.i2c.i2c.m_fd.
Referenced by rnr.i2c.i2c.is_open().
def rnr.i2c.i2c.is_open | ( | self | ) |
Test if I2C bus is open.
Definition at line 160 of file i2c.py.
References rnr.i2c.i2c.is_open(), and rnr.i2c.i2c.m_fd.
def rnr.i2c.i2c.open | ( | self, | |
device | |||
) |
Open a I2C bus device.
Raises I2CException on error.
device | I2C device name (e.g. /dev/i2c-3). |
Definition at line 130 of file i2c.py.
References rnr.i2c.i2c.m_device, and rnr.i2c.i2c.m_fd.
Referenced by rnr.i2c.i2c.open().
def rnr.i2c.i2c.open | ( | self, | |
device | |||
) |
Open a I2C bus device.
Raises I2CException on error.
device | I2C device name (e.g. /dev/i2c-3). |
Definition at line 130 of file i2c.py.
References rnr.i2c.i2c.m_device, rnr.i2c.i2c.m_fd, and rnr.i2c.i2c.open().
def rnr.i2c.i2c.open | ( | self, | |
device | |||
) |
Open a I2C bus device.
Raises I2CException on error.
device | I2C device name (e.g. /dev/i2c-3). |
Definition at line 130 of file i2c.py.
References rnr.i2c.i2c.m_device, rnr.i2c.i2c.m_fd, and rnr.i2c.i2c.open().
def rnr.i2c.i2c.read | ( | self, | |
addr, | |||
count | |||
) |
Read data from an attached device connected to the open I2C bus.
Raises I2CException on error.
addr | Attached device address. |
count | Number of bytes to read. |
Definition at line 176 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, and rnr.i2c.i2c.m_fd.
Referenced by rnr.i2c.i2c.read(), and rnr.i2c.i2c.write_read().
def rnr.i2c.i2c.read | ( | self, | |
addr, | |||
count | |||
) |
Read data from an attached device connected to the open I2C bus.
Raises I2CException on error.
addr | Attached device address. |
count | Number of bytes to read. |
Definition at line 176 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, rnr.i2c.i2c.m_fd, and rnr.i2c.i2c.read().
def rnr.i2c.i2c.read | ( | self, | |
addr, | |||
count | |||
) |
Read data from an attached device connected to the open I2C bus.
Raises I2CException on error.
addr | Attached device address. |
count | Number of bytes to read. |
Definition at line 176 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, rnr.i2c.i2c.m_fd, and rnr.i2c.i2c.read().
def rnr.i2c.i2c.scan | ( | self | ) |
Scan I2C bus for all attached devices.
Definition at line 291 of file i2c.py.
References rnr.i2c.i2c.check(), and rnr.i2c.i2c.scan().
def rnr.i2c.i2c.scan | ( | self | ) |
Scan I2C bus for all attached devices.
Definition at line 291 of file i2c.py.
References rnr.i2c.i2c.check().
Referenced by rnr.i2c.i2c.scan().
def rnr.i2c.i2c.scan | ( | self | ) |
Scan I2C bus for all attached devices.
Definition at line 291 of file i2c.py.
References rnr.i2c.i2c.check(), and rnr.i2c.i2c.scan().
def rnr.i2c.i2c.transfer | ( | self, | |
addr, | |||
buf, | |||
count | |||
) |
Transfer data to an attached device connected to the open I2C bus and receive response.
Raises I2CException on error.
addr | Attached device address. |
buf | Buffer to transfer. |
count | Number of bytes to read back. |
Definition at line 232 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, rnr.i2c.i2c.m_fd, and rnr.i2c.i2c.transfer().
def rnr.i2c.i2c.transfer | ( | self, | |
addr, | |||
buf, | |||
count | |||
) |
Transfer data to an attached device connected to the open I2C bus and receive response.
Raises I2CException on error.
addr | Attached device address. |
buf | Buffer to transfer. |
count | Number of bytes to read back. |
Definition at line 232 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, and rnr.i2c.i2c.m_fd.
Referenced by rnr.i2c.i2c.transfer().
def rnr.i2c.i2c.transfer | ( | self, | |
addr, | |||
buf, | |||
count | |||
) |
Transfer data to an attached device connected to the open I2C bus and receive response.
Raises I2CException on error.
addr | Attached device address. |
buf | Buffer to transfer. |
count | Number of bytes to read back. |
Definition at line 232 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, rnr.i2c.i2c.m_fd, and rnr.i2c.i2c.transfer().
def rnr.i2c.i2c.write | ( | self, | |
addr, | |||
buf | |||
) |
Write data to an attached device connected to the open I2C bus.
Raises I2CException on error.
addr | Attached device address. |
buf | Buffer to write. |
Definition at line 204 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, rnr.i2c.i2c.m_fd, and rnr.i2c.i2c.write().
def rnr.i2c.i2c.write | ( | self, | |
addr, | |||
buf | |||
) |
Write data to an attached device connected to the open I2C bus.
Raises I2CException on error.
addr | Attached device address. |
buf | Buffer to write. |
Definition at line 204 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, rnr.i2c.i2c.m_fd, and rnr.i2c.i2c.write().
def rnr.i2c.i2c.write | ( | self, | |
addr, | |||
buf | |||
) |
Write data to an attached device connected to the open I2C bus.
Raises I2CException on error.
addr | Attached device address. |
buf | Buffer to write. |
Definition at line 204 of file i2c.py.
References rnr.i2c.i2c.m_addr, rnr.i2c.i2c.m_device, and rnr.i2c.i2c.m_fd.
Referenced by rnr.i2c.i2c.write(), and rnr.i2c.i2c.write_read().
def rnr.i2c.i2c.write_read | ( | self, | |
addr, | |||
buf, | |||
count | |||
) |
Write/read data to/from an attached device connected to the open I2C bus.
Raises I2CException on error.
addr | Attached device address. |
buf | Buffer to transfer. |
count | Number of bytes to read back. |
Definition at line 267 of file i2c.py.
References rnr.i2c.i2c.read(), rnr.i2c.i2c.write(), and rnr.i2c.i2c.write_read().
def rnr.i2c.i2c.write_read | ( | self, | |
addr, | |||
buf, | |||
count | |||
) |
Write/read data to/from an attached device connected to the open I2C bus.
Raises I2CException on error.
addr | Attached device address. |
buf | Buffer to transfer. |
count | Number of bytes to read back. |
Definition at line 267 of file i2c.py.
References rnr.i2c.i2c.read(), rnr.i2c.i2c.write(), and rnr.i2c.i2c.write_read().
def rnr.i2c.i2c.write_read | ( | self, | |
addr, | |||
buf, | |||
count | |||
) |
Write/read data to/from an attached device connected to the open I2C bus.
Raises I2CException on error.
addr | Attached device address. |
buf | Buffer to transfer. |
count | Number of bytes to read back. |
Definition at line 267 of file i2c.py.
References rnr.i2c.i2c.read(), and rnr.i2c.i2c.write().
Referenced by rnr.i2c.i2c.write_read().