Apex AD10 DO Usage#

Hardware Specification#

Electrical Characteristics#


Description

Vout

Output voltage

GND

Ground

emitt

Abbreviation for Emitter

colle

Abbreviation for Collector


Vout  Result

high level=1

3.3V

low level=0

0V

Pin Definition#

Function

DB9 PIN Number

Description

Device Node

DI_0

1

GPIO IN

/dev/gpio/di0

DI_1

2

GPIO IN

/dev/gpio/di1

DO_0

3

GPIO OUT

/dev/gpio/do0

DO_1

4

GPIO OUT

/dev/gpio/do1

DO_2

5

GPIO OUT

/dev/gpio/do2

GND

6-9

Ground


Function

DB9 PIN Number

Description

Device Node

DO_3

1

GPIO OUT

/dev/gpio/do3

DI_2

3

GPIO IN

/dev/gpio/di2

DI_3

5

GPIO IN

/dev/gpio/di3

GND

6/8

Ground


Method of Application#

System version below 5.x.x-x.x.x#

The example of using the GPIO interface is as follows.

# Use root
sudo su -

# Set output to high
echo 1 > /sys/class/gpio/<device node>/value
# Example: echo 1 > /sys/class/gpio/gpio339/value

# Set output to low
echo 0 > /sys/class/gpio/<device node>/value
# Example: echo 0 > /sys/class/gpio/gpio339/value

System version above 6.x.x-x.x.x#

The usage of GPIO is as below

sudo /opt/miivii/features/gpio/bin/miivii_set_do_level <DO number> <level: 0/1> <duration(seconds) of level>
#<DO number>: Represents the sequence number of the DO. 0 represents DO1, 1 represents DO1, and so on.
#<level: 0/1>: Represents the level to be set. 0 represents low level, and 1 represents high level.
#<duration(seconds) of level>: The duration of the level in seconds. During this period, the DO level will be in the state specified by <level: 0/1>. After the level duration is exceeded, the DO returns to its previous state.

#Please note that starting from Linux kernel version 4.8, the GPIO SYSFS interface is marked as deprecated and is no longer supported in Jetpack 6.0 and later versions. It is recommended to use libgpiod for GPIO operations. Therefore, setting the level without specifying a duration is not supported.
#Example: Set DO0 to high level with a duration of 20 seconds.
#sudo /opt/miivii/features/gpio/bin/miivii_set_do_level 0 1 20

Compile sample code

cp -r /opt/miivii/features ~/
cd ~/features/gpio
sudo make;