beautypg.com

Appendix b - programming guide (linux), B-1 gpio and watchdog, Overview – Acrosser AR-R6006 User Manual

Page 34: File descriptions, Gpio and watchdog, B-2 api list and descriptions, Gpio

background image

Revision: 1.0

Appendix B - Programming Guide (Linux)

B-1 GPIO and Watchdog

Overview

AR-B6006 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 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.

In this GPIO and Watchdog package, on Linux and Windows platform, we provides:
GPIO and Watchdog test utility.



File Descriptions
GPIO and Watchdog
On Linux platform:
1. Libw83627.h

This file includes the declarations of the APIs and macro definitions.

2. maintest.c

The source code of the utility.

3. Libw83627.a

The file is static link file.

B-2 API List and Descriptions

GPIO and Watchdog
GPIO
1. Syntax:
Get_gpo_status(int pin)

Description: Get the value of GPIO Output and put the value at *val.

Parameters:

I.

The parameter ‘channel’ indicates the GPIO Output pins to show. Users can use the
GPO0, GPO1, GPO2, GPO3 to indicate the GPIO Outpurt channel.

Return Value: If the function gets the values successfully, it returns status.

2. Syntax:

Set_gpio(int pin, int value)

Description: Set the status of GPIO Output value.

Parameters:

Set value 0 is Low, 1 is High




34