[Overview][Resource strings][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'fpgpio' (#pascalio)

TGpioRegisterController

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

Generic class for I/O controller using registers

Declaration

Source position: fpgpio.pas.bak line 172

type TGpioRegisterController = class(TGpioController)

protected

  function GetActiveLow(); override;

  function GetDirection(); override;

  function GetValue(); override;

  procedure SetActiveLow(); override;

  procedure SetDirection(); override;

  procedure SetValue(); override;

  function GetRegister(); virtual; abstract;

  

Address of a requested register

  function GetRegisterValue(); virtual; abstract;

  

Retrieves the value of a given register

  procedure SetRegisterValue(); virtual; abstract;

  

Set the value of a given register

  function GetRegisterValueS(); virtual;

  

Convenience method for getting a value for a specific pin

  procedure SetRegisterValueS(); virtual;

  

Convenience method for setting a value for a specific pin

  property RegisterValue []: TRegisterValue; [rw]

  

Value of a given register

end;

Inheritance

TGpioRegisterController

  

Generic class for I/O controller using registers

|

TGpioController

  

Generic class for a goup of GPIO pins controlled together

|

TObject

Description

Many external I/O expanders provide an interface which exposes the internal registers to the contoller. This base class provides an basic interface to these I/O expanders.

Setting and getting values basically operate on 3 methods:

  1. function GetRegister(): Getting the adress of the register and the position of the pin within this register.
  2. function GetRegisterValue(): Reading the current TRegisterValue.
  3. procedure SetRegisterValue(): Setting the new value if desired.
  4. If you are interested in only one bit of a register, you may use the convenience methods TGpioRegisterController.GetRegisterValueS and TGpioRegisterController.SetRegisterValueS.

Only expanders with 8 bit registers are supported. This does not mean, the expander may have at maximum 8 GPIO channels. An expander may provide more than one register for one task.


Documentation generated on: 2020-05-22