GPIOs on DIMM-AM335 under Linux

Enabeling GPIO control

To get access to an GPIO pin, first write the GPIO number to /sys/class/gpio/export

echo 7 > /sys/class/gpio/export

Now you should find a directory in /sys/class/gpio to access your GPIO pin. Write in or out to direction to change the direction of the pin:

echo out > /sys/class/gpio/gpio7/direction

The value (0 for off, 1 for on) of the pin is in the value file. To read or change it, read the file or write to it.

echo 1 > /sys/class/gpio/gpio7/valuecat /sys/class/gpio/gpio7/value

The list of GPIO numbers can be found below.

CPU Module

The two color led can be controlled by two GPIO pins.

ColorBank and pinGPIO NumberNotes
Green2-468output is inverted, 0 is on
Red2-569 

 

Verno 3/4/Cadun

There are 8 GPIOs on J12 with a signal level of 3.3V and 14 more on J16 using the GPIO expander.

ConnectorPinSignalBank and pinGPIO Number
J124GPIO_00-77
J128GPIO_21-2153
J1212GPIO_42-1983
J1214GPIO_53-9105
J1216GPIO_62-1882
J1218GPIO_73-10106
J1220GPIO_80-1313
J1222GPIO_90-1212
J163GPIO_I2C_0 128
J164GPIO_I2C_8 136
J165GPIO_I2C_1 129
J166GPIO_I2C_9 137
J167GPIO_I2C_2 130
J168GPIO_I2C_10 138
J169GPIO_I2C_3 131
J1610GPIO_I2C_11 139
J1611GPIO_I2C_4 132
J1612GPIO_I2C_12 140
J1613GPIO_I2C_5 133
J1614GPIO_I2C_13 141
J1615GPIO_I2C_6 134
J1617GPIO_I2C_7 135

 

Lothron 3

The Lothron 3 has 8 accessible GPIO pins on J25.

ConnectorPinSignalBank and pinGPIO Number
J2511GPIO_00-77
J2513GPIO_21-2153
J2515GPIO_42-1983
J2516GPIO_53-9105
J2517GPIO_62-1882
J2518GPIO_73-10106
J2519GPIO_80-1313
J2520GPIO_90-1212



Zurück