
Chapter 5 Software Installation and
Programming Guide
5.1 API List and Descriptions
5.1.1 GPIO and Watchdog
5.1.1.1 Overview
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.
5.1.1.2 GPIO(Linux)
1. 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.
2. Syntax:
Set_gpio(int pin, int value)
Description: Set the status of GPIO Output value.
Parameters:
61