General description

The GPO block sets the value of the general-purpose output (GPO) pins.

The GPO pin locations, numbering, and voltage levels are available in the B-Box RCP datasheet and in the B-Board PRO datasheet.

Simulink block

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 bit selects one pin to control.

  • 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.

Parameters

  • Device ID select 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.

  • 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_SetBit(unsigned int bit, unsigned int device=0);
void Gpo_ClearBit(unsigned int bit, unsigned int device=0);
void Gpo_ToggleBit(unsigned int bit, unsigned int device=0);

Sets, clear, or toggle the addressed GPO pin.

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);

Sets the GPO pin to value.

GPO(bit) = 0 if value=0, GPO(bit) = 1 if value>0

Parameters

  • 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)

Advanced functions
void Gpo_Set(unsigned int value, unsigned int device=0);

Sets the whole 16-bit GPO register.

It has to be called during the control interrupt.

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)

  • No labels