beautypg.com

Solvline Eddy DKV2.1.0.3 User Manual

Page 94

background image

Chapter 6. Library

Introduction

94


enable: 0

 disable (Do not use as GPIO), 1  Enable (use as GPIO)

mode: 0

 Set as input mode,, 1  Set as output mode

value: 0

 Read/Write status is set to Low, 1  Read/Write status is set to High

pullup: 0

 pulldown, 1  pullup

SETGPIOINIT

Function

Initializes ports that will be used as GPIO after boot.

Format

void ioctl(int fd, SETGPIOINIT, struct *gpio_struct);

Parameter

fd

Handle to GPIO device(‚/dev/eddy_gpio‛)

gpio_struct

Pointer to the struct which stores GPIO table value in
/etc/eddy_gpio.cfg with GPIO configuration file
registered in Web configuration.
struct gpio_struct {
unsigned int value[3];
unsigned int mode[3];
unsigned int pullup[3];

unsigned int enable[3]; };

Returns

None

Notice

Eddy-CPU provides maximum GPIO ports of 56.
Eddy-S4M provides maximum GPIO ports of 34.
That is when using only WAN and when devices such as serial ports,
ADC, Rese, RDY LED… are used, number of available GPIO ports
decreases.
This command initializes available GPIO ports leaving the devices that
are registered in configuration in Pinetd.c after boot so users don’t
have use this command. When used, users need to be careful.
For instance, if a serial port is enabled through web configuration and
Eddy is rebooted, the port acts as a serial port, not a GPIO port. But
when this port is forced to be used as GPIO port with this command, the
application that uses this serial port will not operate properly.






SETGPIOMOD_LM

Function

Sets Read/Write direction for all Port A, B, C

Format

void ioctl(int fd, SETGPIOMOD_LM, int *mode[3]);