[Overview][Resource strings][Types][Classes][Index] Reference for unit 'fpi2c' (#pascalio)

TI2CDevice

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract I2C device class

Declaration

Source position: fpi2c.pas line 165

type TI2CDevice = class(TObject)

protected

  procedure SetAddress(); virtual;

  

Set device addresse

public

  constructor Create(); virtual;

  

  function ReadByte; virtual; abstract;

  

Read single byte

  procedure WriteByte(); virtual; abstract;

  

Writes a single byte to the device

  function ReadRegByte(); virtual; abstract;

  

Read byte from register

  function ReadRegWord(); virtual; abstract;

  

  procedure WriteRegByte(); virtual; abstract;

  

  procedure WriteRegWord(); virtual; abstract;

  

  function ReadBlockData(); virtual; abstract;

  

  procedure WriteBlockData(); virtual; abstract;

  property Address: TI2CAddress; [rw]

  

end;

Inheritance

TI2CDevice

  

Abstract I2C device class

|

TObject

Description

This class is an abstact interface for sending data to and receiving data from a I2C device attached to an I2C Bus. If you are using only one device in your application, you should use a derived class, e.g. TI2CLinuxDevice. If there are multiple conccurrent threads in your multi threaded application accessing on bus, you may want to use TI2CBus for request serialization. As an alternative, you should be able to create multiple instances of TI2CDevice---one for each device (not tested). This class is not threadsafe.


Documentation generated on: 2020-05-22