2 gpio and watchdog, 1 overview, 2 installing device driver – Acrosser AR-B6051 User Manual

Page 45: 2 gpio and watchdog 6.2.1 overview

Advertising
background image

For example:

struct CanMsg msg;

msg.data[0]

=

0xa1;

msg.data[1]

=

0xb2;

msg.data[2] = 0xc3;

msg.length = 3;

6.2 GPIO and Watchdog

6.2.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.

6.2.2 Installing Device Driver

Before executing the applications which invoke the GPIO or Watchdog APIs, users should make sure

that the Linux device driver or the Windows device driver has been installed.

On Linux platform, after successfully installing the device driver, a character device node named

“/dev/AcroDev” will be created automatically. The APIs open the device node “/dev/AcroDev”

implicitly so acquiring a file descriptor of “/dev/AcroDev” is not ncecssary.

On Windows platform, after successfully installing the device driver, there is a device which shows

‘Acrosser Device’ in the ‘Device Manager’. The APIs on Windows platform open this device implicitly.

45

Advertising