Skip to content

Inputs and Outputs

This section covers the details of the Display’s inputs and outputs.

The Display handles digital and analog inputs.

The display has twelve 0-12V digital inputs. The table below shows the General-Purpose Input/Outputs (GPIOs) assigned to the digital inputs on the AMPSEAL connector.

PinGPIOPinGPIO
19125140
2117282
512429145
813431116
1113934122
1214435136

The state of the digital inputs can be read through C++ code or terminal commands. To read the state of digital inputs from the terminal, enter the following commands:

Terminal window
$ echo 91 > /sys/class/gpio/export
$ echo in > /sys/class/gpio/gpio91/direction
$ cat /sys/class/gpio/gpio91/value // Read the value of the input

To read the state of digital inputs in the Reference App via C++, use the following code:

// Reference App I/O Module
int input = io->get_channel_value("INPUT1"); // Read Digital Input

The display has six 0-12V analog inputs. The built-in co-processor reads the analog inputs (Read more about it in the Coprocessor section) and then passes to the main processor via UART or CAN. The assigned pins for analog inputs on AMPSEAL connector are 9,10, 17, 19, 20, and 22.

The state of the analog input can only be read through C++ code in the Reference App by reading and parsing the data from UART. Use the code below to read analog inputs via C++:

analog_input = new adc("/dev/ttymxc4");
connect(analog_input, SIGNAL(adc_ready(int, int)), this, SLOT(adc_ready(int, int)));
void demoApp::adc_ready(int channel, int value)
{
qDebug() << "adc" << channel << " = " << value;
}

The Display handles digital outputs.

The display has four digital high-side drivers capable of sourcing up to 2A each. The table below shows the General-Purpose Input/Outputs (GPIOs) assigned to the digital outputs on the AMPSEAL connector.

PinGPIOPinGPIO
31626167
41637200

The digital outputs can be controlled through C++ code or terminal commands. To control it from the terminal, enter the following commands:

Terminal window
$ echo 198 > /sys/class/gpio/export
$ echo out > /sys/class/gpio/gpio162/direction
$ echo 1 > /sys/class/gpio/gpio162/value # Turn output on
$ echo 0 > /sys/class/gpio/gpio162/value # Turn output off

Use the code below to control the digital outputs in the Reference App via C++:

analog_input = new adc("/dev/ttymxc4");
io->set_channel_value("OUTPUT3", true); // Turn output on
io->set_channel_value("OUTPUT3", false); // Turn output off