Moxa EM-1220-LX [46/57] Api list

Moxa EM-1240-LX [46/57] Api list
EM-1240-LX User’s Manual EM-1240-LX Device API
GPIO
GPIO stands for General Purpose I/O. GPIOs are user-programmable, and can be used for either
digital input or digital output, since the signals are all in TTL format.
Moxa GPIO API
Moxa provides an API library with static link for customers using the EM-1220 or EM-1240 (note
that dynamic link is not supported). Users can use source code provided by Moxa so that the ioctl()
command can be used by the operating system to communicate with drivers.
API List
int get_gpio_mode(unsigned int pio)
--to check if the current GPIO setting is DI or DO.
Input:
unsigned int pio - GPIO port number
Each GPIO point will be regarded as a port. We support from Port 0 to Port 9 for the EM-1240,
and from Port 0 to Port 7 for the EM-1220.
Output:
1 represents DI.
0 represents DO.
Return:
< 0 is wrong.
= 0 is correct.
int get_gpio_data(unsigned int pio)
--to check the current status of the GPIO, either high or low voltage.
Input:
unsigned int pio - GPIO port number
Each GPIO point will be regarded as a port. We support from Port 0 to Port 9 for the EM-1240,
and from Port 0 to Port 7 for the EM-1220.
Output:
1 represents high.
0 represents low.
Return:
< 0 is wrong.
= 0 is correct.
5-3

Содержание

Похожие устройства

Скачать