GPO - General purpose outputs

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

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

Param.B-Box 4B-Box 3B-Box microB-Board 3 PRO
Location and count48x VHDCI C+D32x VHDCI C+D8x rear connector32x JX1+JX2 (bot.)
Logic level3.3V / 5V (elec.)3.3V / 5V5V3.3V
Shared withPWMN/AN/AN/A
Product datasheetB-Box 4B-Box 3B-Box 3 microB-Board 3

Signal specification

The GPO pin is set if the input is >0.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • GPO pin(s) (vectorizable) is the GPO pin(s) to control. It can be a single value or a vector.
  • Reset pin value to 0 in case of fault acts when a fault is detected, for instance when an analog inputs exceeds a configured limit value.
  • Show simulation output port defines if the simulation output is displayed or not.

PLECS block

Signal specification

The GPO pin is set if the input is >0.

General purpose outputs PLECS block

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • GPO pin(s) (vectorizable) is the GPO pin(s) to control. It can be a single value or a vector.
  • Optional reset can be set to Reset pin value to 0 in case of fault to act when a fault is detected, for instance when an analog inputs exceeds a configured limit value.
  • Simulation input port defines if the target outport is displayed or not. This parameter is only used in simulation.

C++ functions

Standard functions

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

Activates a given GPO pin on B-Box 4 devices. Since these pins are shared with CB-PWM, this function determines the active output type.

Can only be called in UserInit().

Parameters

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

Sets a given GPO pin.

Can be called in the interrupt routine.

Parameters

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

Clears a given GPO pin.

Can be called in the interrupt routine.

Parameters

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

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

Toggles a given GPO pin.

Can be called in the interrupt routine.

Parameters

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

Sets a given GPO pin to value.

value = 0 → GPO(bit) = 0
value > 0 → GPO(bit) = 1

Can be called in the interrupt routine.

Parameters

  • bit: the GPO pin number
  • value: the value to apply to the GPO pin (0 or 1)
  • device: the ID of the addressed device (optional, used in multi-device configuration only)
void Gpo_ClearBitInCaseOfFault(unsigned int bit, unsigned int device=0);Code language: C++ (cpp)

Configures a given GPO pin to clear automatically upon a system fault.

Can only be called in UserInit().

Parameters

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

Legacy functions

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

Sets the whole 16-bit GPO register.

Can be called in the interrupt routine.

Parameters

  • value: the 16-bit value to apply to the GPO outputs
  • device: the ID of the addressed device (optional, used in multi-device configuration only)