GPI - General purpose inputs

At the hardware level, GPI inputs are general-purpose digital inputs that can be configured for various purposes. This block and the associated C/C++ routines provide means to read the value of the corresponding pin at the CPU execution rate. For FPGA users, GPI pins are also available in the sandbox, enabling faster sampling rates.

The table below outlines the location and logic-voltage levels of the FLT inputs across imperix controllers. Detailed information is available in the product datasheets. For the TPI8032, using the TPI GPI helper block is recommended instead.

Param.B-Box 4B-Box 3B-Box microB-Board 3 PRO
Location and count24x VHDCI A16x VHDCI A+B8x rear connector16x JX1+JX2 (bot.)
Logic level3.3V / 5V3.3V / 5V5V3.3V
Shared withFLTN/AN/AN/A
Product datasheetB-Box 4B-Box 3B-Box 3 microB-Board 3

Signal specification

The output signal returns the value of one GPI pin.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • GPI pin(s) (vectorizable) a selection of GPI pin(s) to read. It can be a single value or a vector.
  • Show simulation input port defines whether the simulation input is displayed.
GPI Simulink dialog

PLECS block

Signal specification

The output signal returns the value of one GPI pin.

General purpose inputs PLECS block

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • GPI pin(s) (vectorizable) a selection of GPI pin(s) to read. It can be a single value or a vector.
  • Simulation input port defines if the target inport is displayed or not. This parameter is only used in simulation.

C++ functions

Standard functions

void Gpi_ActivateInput(unsigned int bit, unsigned int device=0);Code language: C++ (cpp)

Activates the GPI pin on B-Box 4 devices. Since these pins are shared with FLT, this function determines the active input type.

Can only be called in UserInit().

Parameters

  • bit: the GPI pin number
  • device: the ID of the addressed device (optional, used in multi-device configuration only)
int Gpi_GetBit(unsigned int bit, unsigned int device=0);Code language: C++ (cpp)

Returns the value (0 or 1) of a given GPI pin.

Can be called in the interrupt routine.

Parameters

  • bit: the GPI pin number
  • device: the ID of the addressed device (optional, used in multi-device configuration only)

Return value

  • The value of the GPI pin

Legacy functions

int Gpi_Get(unsigned int device=0);Code language: C++ (cpp)

Returns the value of all GPI pins in the form of a 16-bit value.

Can be called in the interrupt routine.

Parameters

  • device: the ID of the addressed device (optional, used in multi-device configuration only)

Return value

  • The value of all GPI pins