4.5.1 The interface and demonstration of application
The Application Programming Interface (API) used by SOC8200 application development
employs the standard application interface of Windows Embedded CE 6.0. SOC8200 just has an
additional GPIO interface based on standard API.
1. For interface definition of Windows Embedded CE 6.0 standard application,
please refer to related help documents of MSDN Windows Embedded CE 6.0
API.
2. The example of the use of standard API is provided in the section of 7.2. The
development demonstration of interface application.
3. Some interfaces are just used for drivers. They can’t be used by the application
programmer.
4.5.1.1The 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
Operation example is showed 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];
pInBuffer[0] = id;
pInBuffer[1] = mode;
DeviceIoControl(hFile, IOCTL_GPIO_SETMODE, pInBuffer,
sizeof
(pInBuffer), NULL, 0, NULL, NULL);
Read the working mode of GPIO:
DeviceIoControl(hFile, IOCTL_GPIO_GETMODE, &id,
sizeof
(DWORD), &mode,
sizeof
(DWORD),
NULL, NULL);
"id" is GPIO Pin number, "mode" is GPIO mode, including:
Mode definition
Description
GPIO_DIR_OUTPUT
Output mode
Содержание AM3517
Страница 6: ...Fig1 1 SOC8200 Single Board Computer...
Страница 21: ...2 2 14 JTAG Interface PIN Description 1 VCC 2 TMS 3 TDI 4 NTRST 5 TD0 6 RTCK 7 TCK 8 EMU0 9 EMU1 10 GND...
Страница 24: ...Digital output Control independently Table 3 1 BSP specifications...
Страница 60: ...Appendix Appendix I Dimension Fig 2 2 Dimension Drawing...
Страница 62: ...3 When the following appears select Continue 4 Please wait until the installation is completed...
Страница 63: ......
Страница 76: ......