1. GPIO Pin Definition
DEBIX has a set of 2*20Pin/ 2.0mm pitch GPIO pin header (J2), which can be used for connecting external hardware like LEDs, buttons, sensors, functional modules.
- The voltage of I2C, UART, CAN, SPI and GPIO pin is 3.3V.
- 5V pins (pin6 and pin8) can be used to power DEBIX Model A/B or to supply power to peripherals.
Table 1 GPIO Pin Definition
Pin
Definition
Pin
Definition
1
POE_VA1
2
POE_VA2
3
POE_VB1
4
POE_VB2
5
GND
6
VDD_5V
7
GND
8
VDD_5V
9
UART2_RXD
10
ONOFF
11
UART2_TXD
12
SYS_nRST
13
UART3_RXD
14
ECSPI1_SS0
15
UART3_TXD
16
ECSPI1_MOSI
17
UART4_RXD
18
ECSPI1_MISO
19
UART4_TXD
20
ECSPI1_SCLK
21
I2C4_SCL
22
ECSPI2_SS0
23
I2C4_SDA
24
ECSPI2_MOSI
25
I2C6_SCL
26
ECSPI2_MISO
27
I2C6_SDA
28
ECSPI2_SCLK
29
GPIO1_IO11
30
GPIO1_IO12
31
CAN1_TXD
32
GPIO1_IO13
33
CAN1_RXD
34
GPIO5_IO03
35
CAN2_TXD
36
GPIO5_IO04
37
CAN2_RXD
38
GPIO3_IO21
39
GND
40
GND
2. Multiplexing Function
Refer to the DEBIX Model A GPIO Pin Multiplexing Function List V1.1 on the DEBIX official website.
Example:
Pins 14, 16, 18, 20, 22, 24, 26, and 28 can be multiplexed as GPIOs if the SPI function is not needed. Please refer to the table below for details.
l The DTS file used is arch/arm64/boot/dts/freescale/imx8mp-evk.dts. Modify the code as shown below:
l After applying this patch and generating a new dtb, replace the /boot/imx8mp-evk.dtb on the device with the new one.
l Replace the /boot/Image on the device with the generating Image.
3. Use of GPIO
Use gpiod to control IO. The download command is:
#apt install gpiodThe control command: (Eg. To control the GPIO5_IO10 corresponding to pin28)
Output high level: gpioset 4 10=1
Output low level: gpioset 4 10=0
Set as input io: gpioget 4 10