Eddy DK Programmer Guide
113
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]);
Parameter
fd
Handle to GPIO device(“/dev/eddy_gpio”)
mode
Pointer to the buffer that stores “mode” value for
Port A, B, C.
Bit value 0 means input, 1 means output.
Returns
None
Notice
Any value is ok for bits that are not set to be used GPIO