
ACM-XE21B6
27
www.acrosser.com
4. Software Installation and
Programming Guide
4.1.
Introduction
4.1.1.
Environment
This test utility develop is based on Ubuntu 18.04.1 Server 64bit.
4.1.2.
GPIO and Watchdog
This model provides both a GPIO interface and a Watchdog timer. Users can use
the GPIO and Watchdog APIs to configure and to access the GPIO interface and the
Watchdog timer. The GPIO has four input pins and four output pins. The Watchdog
timer can be set to 1~255 seconds. Setting the timer to zero disables the timer. The
remaining seconds of the timer to reboot can be read from the timer.
4.2.
API List and Descriptions
4.2.1.
GPIO
Syntax:
Get_gpio_status(int pin)
Description:
Get the status of GPIO input pins and output pins status.
Parameters:
This function takes a pointer to an unsigned char variable
as the parameter.
The pin0 ~ 3 is the status of the output pins. The pin4 ~
pin7 is the status of the input pins.
Return Value:
1:HIGH, 0:LOW.
Syntax:
Set_gpio(int pin, int value)
Description:
Set the status of GPIO Output value.
Parameters:
Set value 0 is Low, 1 is High
Return Value:
If the function sets the values successfully, it returns 0 or
-1, any other returned value stands for error.