MTAC-GPIO Usage
Hardware specific information for this card is available on the MTAC-GPIO page.
The GPIO accessory card provides:
- 4 digital inputs (
din0-din3
) - 4 digital outputs (
dout0-dout3
) - 3 analog inputs (
adc0-adc2
) - 2 LEDs (
led1, led2
)
Attribute | Connector Pin | Description |
---|---|---|
Analog inputs | ||
adc0 | 6 | Reads data from the Analog Input 0 pin and triggers a new conversion (0 – 4096 decimal (0xFFFh)) |
adc1 | 7 | Reads data from the Analog Input 1 pin and triggers a new conversion (0 – 4096 decimal (0xFFFh)) |
adc2 | 8 | Reads data from the Analog Input 2 pin and triggers a new conversionĀ (0 – 4096 decimal (0xFFFh)) |
Digital inputs | ||
din0 | 1 | Reads the state of the External Input 0 pin |
din1 | 2 | Reads the state of the External Input 1 pin |
din2 | 3 | Reads the state of the External Input 2 pin |
din3 | 4 | Reads the state of the External Input 3 pin |
Digital outputs | ||
dout0 | 10 | Sets or clears the External Output 0 output pin |
dout1 | 11 | Sets or clears the External Output 1 output pin |
dout2 | 12 | Sets or clears the External Output 2 output pin |
dout3 | 13 | Sets or clears the External Output 3 output pin |
LEDs | ||
led1 | Turns the led on or off | |
led2 | Turns the led on or off |
Use the provided mts-io-sysfs utility to interface with the accessory card.
Examples:
Read a digital input:
$ mts-io-sysfs show gpiob/din0
Set a digital output:
$ mts-io-sysfs store gpiob/dout0 1
Read an analog input:
$ mts-io-sysfs show gpiob/adc0
Set an LED
$ mts-io-sysfs store gpiob/led1 1