7
Digital Input/Output Function Library
DI/O provides input/output to support inter-device communications. Simple programming guides allow easy
transmission of digital signals between the system and attached peripherals.
7.1
DI/O with Windows API
AMSTX-CF DI/O API library files and a demo program (including source code) can be downloaded from
https://www.adlinktech.com/Products/Industrial_Motherboards_SBCs/MicroSTX_Motherboard/AMSTX-CF_Series
To use the DI/O function library for the AMSTX-CF series, include the GpioLib.h header file and GpioLib.lib linkage
library in the C++ project. DI/O functions are as follows.
GPIO_Init
This API checks if the GPIO driver handle is valid.
char GPIO_Init ()
Return value:
GPIO_OK on success. GPIO_ERROR on failure.
GPI_Read
This API reads the digital input (DI) pin status:
char GPI_Read(UCHAR GpioNum, PUCHAR data)
Argument:
GpioNum: The number of a digital input pin (0-3)
data: The digital input pin status will be copied to this address
Return value:
GPIO_OK on success. GPIO_ERROR on failure.
GPO_Write
This API writes the new state of a digital output (DO):
char GPO_Write(UCHAR GpioNum,UCHAR GpioPortVal)
Argument:
GpioNum: The number of a digital output pin (4-7).
GpioPortVal: A new output state of 0 or 1.
Return value:
GPIO_OK on success. GPIO_ERROR on failure
Digital Input/Output Function Library
AMSTX-CF Series
33
Need help?
Do you have a question about the AMSTX-CF Series and is the answer not in the manual?