Specifications
Page | 70
5.6.1 API and Application Demonstrations
The Application Programming Interface (API) used for SOC8200 application
development employs the standard application interface of Windows
Embedded CE 6.0. The SOC8200 has an additional GPIO interface based on
standard API.
Note:
For interface definitions of Windows Embedded CE 6.0 standard applications,
please refer to related help documents for the MSDN Windows Embedded CE
6.0 API.
Some interfaces are only used by drivers. They can’t be used by applications.
5.6.2 The definition and demonstration of GPIO interface
GPIO device name L"GIO1:" to expand DeviceIoControl interface definition,
corresponding IOCTL code includes:
IOCTL Code
Description
IOCTL_GPIO_SETBIT
Set GPIO pin as 1
IOCTL_GPIO_CLRBIT
Set GPIO pin as 0
IOCTL_GPIO_GETBIT
Read GPIO pin
IOCTL_GPIO_SETMODE
Set the working mode of GPIO pin
IOCTL_GPIO_GETMODE
Read the working mode of GPIO pin
IOCTL_GPIO_GETIRQ
Read the corresponding IRQ of GPIO pin
An operation example is shown below:
1. Open GPIO device
HANDLE hFile = CreateFile(_T("GIO1:"), (GENERIC_READ|GENERIC_WRITE),
(FILE_SHARE_READ|FILE_SHARE_WRITE), 0, OPEN_EXISTING, 0, 0);
2. Set/read the working mode of GPIO
DWORD id = 0, mode = 0;
Set the working mode of GPIO:
DWORD pInBuffer[2];