OE - Pi  1.1
 All Classes Namespaces Functions
OpenElectrons_i2c.OpenElectrons_i2c Class Reference

OpenElectrons_i2c: this class provides i2c functions for read and write operations. More...

Inheritance diagram for OpenElectrons_i2c.OpenElectrons_i2c:
explorerlib.Explorer OpenElectrons_BMP180.BMP180 OpenElectrons_L3GD20.L3GD20 OpenElectrons_LSM303.ACCEL OpenElectrons_LSM303.MAG OpenElectrons_LSM303D.LSM303D pilight.PILIGHT SmartDrive.SmartDrive smartups.SmartUPS

Public Member Functions

def __init__
 Initialize the class with the i2c address of your device. More...
 
def errMsg
 Prints an error message if a read error is detected. More...
 
def writeByte
 Write a byte to your i2c device at a given location. More...
 
def readByte
 Read an unsigned byte from your i2c device at a given location. More...
 
def simpleWriteByte
 Write a byte to your i2c device at a given location. More...
 
def simpleReadByte
 Read an unsigned byte from your i2c device at a given location. More...
 
def readByteSigned
 Read a signed byte from your i2c device at a given location. More...
 
def readArray
 Read a byte array from your i2c device starting at a given location. More...
 
def writeArray
 Write a byte array from your i2c device starting at a given location. More...
 
def readString
 Read a string from your i2c device starting at a given location. More...
 
def readIntegerBE
 Read an unsigned 16 bit integer from your i2c device from a given location. More...
 
def readInteger
 Read an unsigned 16 bit integer from your i2c device from a given location. More...
 
def readIntegerSignedBE
 Read a signed 16 bit integer from your i2c device from a given location. More...
 
def readIntegerSigned
 Read a signed 16 bit integer from your i2c device from a given location. More...
 
def readLongBE
 Read an unsigned 32bit integer from your i2c device from a given location. More...
 
def readLong
 Read an unsigned 32bit integer from your i2c device from a given location. More...
 
def readLongSignedBE
 Read a signed 32bit integer from your i2c device from a given location. More...
 
def readLongSigned
 Read a signed 32bit integer from your i2c device from a given location. More...
 
def GetFirmwareVersion
 Read the firmware version of the i2c device. More...
 
def GetVendorName
 Read the vendor name of the i2c device. More...
 
def GetDeviceId
 Read the i2c device id. More...
 

Static Public Member Functions

def pi_rev
 
def which_bus
 

Public Attributes

 address
 
 bus
 

Detailed Description

OpenElectrons_i2c: this class provides i2c functions for read and write operations.

Constructor & Destructor Documentation

def OpenElectrons_i2c.OpenElectrons_i2c.__init__ (   self,
  i2c_address 
)

Initialize the class with the i2c address of your device.

Parameters
selfThe object pointer.
i2c_addressAddress of your device.

Member Function Documentation

def OpenElectrons_i2c.OpenElectrons_i2c.errMsg (   self)

Prints an error message if a read error is detected.

Parameters
selfThe object pointer.
def OpenElectrons_i2c.OpenElectrons_i2c.GetDeviceId (   self)

Read the i2c device id.

Parameters
selfThe object pointer.
def OpenElectrons_i2c.OpenElectrons_i2c.GetFirmwareVersion (   self)

Read the firmware version of the i2c device.

Parameters
selfThe object pointer.
def OpenElectrons_i2c.OpenElectrons_i2c.GetVendorName (   self)

Read the vendor name of the i2c device.

Parameters
selfThe object pointer.
def OpenElectrons_i2c.OpenElectrons_i2c.readArray (   self,
  reg,
  length 
)

Read a byte array from your i2c device starting at a given location.

Parameters
selfThe object pointer.
regThe first register in the array to read from.
lengthThe length of the array.
def OpenElectrons_i2c.OpenElectrons_i2c.readByte (   self,
  reg 
)

Read an unsigned byte from your i2c device at a given location.

Parameters
selfThe object pointer.
regThe register to read from.
def OpenElectrons_i2c.OpenElectrons_i2c.readByteSigned (   self,
  reg 
)

Read a signed byte from your i2c device at a given location.

Parameters
selfThe object pointer.
regThe register to read from.
def OpenElectrons_i2c.OpenElectrons_i2c.readInteger (   self,
  reg 
)

Read an unsigned 16 bit integer from your i2c device from a given location.

little endian read integers.

Parameters
selfThe object pointer.
regThe first register of the first byte of the integer to read.
def OpenElectrons_i2c.OpenElectrons_i2c.readIntegerBE (   self,
  reg 
)

Read an unsigned 16 bit integer from your i2c device from a given location.

Big-endian read integers .

Parameters
selfThe object pointer.
regThe first register of the first byte of the integer to read.
def OpenElectrons_i2c.OpenElectrons_i2c.readIntegerSigned (   self,
  reg 
)

Read a signed 16 bit integer from your i2c device from a given location.

little endian read integers .

Parameters
selfThe object pointer.
regThe first register of the first byte of the integer to read.
def OpenElectrons_i2c.OpenElectrons_i2c.readIntegerSignedBE (   self,
  reg 
)

Read a signed 16 bit integer from your i2c device from a given location.

Big endian read integers .

Parameters
selfThe object pointer.
regThe first register of the first byte of the integer to read.
def OpenElectrons_i2c.OpenElectrons_i2c.readLong (   self,
  reg 
)

Read an unsigned 32bit integer from your i2c device from a given location.

little endian read integers.

Parameters
selfThe object pointer.
regThe first register of the first byte of the integer to read.
def OpenElectrons_i2c.OpenElectrons_i2c.readLongBE (   self,
  reg 
)

Read an unsigned 32bit integer from your i2c device from a given location.

Big endian read integers.

Parameters
selfThe object pointer.
regThe first register of the first byte of the integer to read.
def OpenElectrons_i2c.OpenElectrons_i2c.readLongSigned (   self,
  reg 
)

Read a signed 32bit integer from your i2c device from a given location.

little endian read integers .

Parameters
selfThe object pointer.
regThe first register of the first byte of the integer to read.
def OpenElectrons_i2c.OpenElectrons_i2c.readLongSignedBE (   self,
  reg 
)

Read a signed 32bit integer from your i2c device from a given location.

Big endian read integers .

Parameters
selfThe object pointer.
regThe first register of the first byte of the integer to read.
def OpenElectrons_i2c.OpenElectrons_i2c.readString (   self,
  reg,
  length 
)

Read a string from your i2c device starting at a given location.

Parameters
selfThe object pointer.
regThe first register of the string to read from.
lengthThe length of the string.
def OpenElectrons_i2c.OpenElectrons_i2c.simpleReadByte (   self)

Read an unsigned byte from your i2c device at a given location.

Parameters
selfThe object pointer.
def OpenElectrons_i2c.OpenElectrons_i2c.simpleWriteByte (   self,
  value 
)

Write a byte to your i2c device at a given location.

Parameters
selfThe object pointer.
valueValue to write.
def OpenElectrons_i2c.OpenElectrons_i2c.writeArray (   self,
  reg,
  arr 
)

Write a byte array from your i2c device starting at a given location.

Parameters
selfThe object pointer.
regThe first register in the array to write to.
arrThe array to write.
def OpenElectrons_i2c.OpenElectrons_i2c.writeByte (   self,
  reg,
  value 
)

Write a byte to your i2c device at a given location.

Parameters
selfThe object pointer.
regThe register to write value at.
valueValue to write.

The documentation for this class was generated from the following file: