User manual

GPIO_DIR_INPUT
Input mode
GPIO_INT_LOW_HIGH
Rising edge trigger mode
GPIO_INT_HIGH_LOW
Falling edge trigger mode
GPIO_INT_LOW
low level trigger mode
GPIO_INT_HIGH
high level trigger mode
GPIO_DEBOUNCE_ENABLE
Jumping trigger enable
3. The operation of GPIO Pin
DWORD id = 0, pin = 0;
Output high level:
DeviceIoControl(hFile, IOCTL_GPIO_SETBIT, &id, sizeof(DWORD), NULL, 0, NULL, NULL);
Output low level:
DeviceIoControl(hFile, IOCTL_GPIO_CLRBIT, &id, sizeof(DWORD), NULL, 0, NULL, NULL);
Read the pin state
DeviceIoControl(hFile, IOCTL_GPIO_GETBIT, &id, sizeof(DWORD), &pin, sizeof(DWORD), NULL,
NULL);
"id" is GPIO pin number, "pin" returns to pin state
4. Other optional operation
Read the corresponding IRQ number of GPIO pin
DWORD id = 0, irq = 0;
DeviceIoControl(hFile, IOCTL_GPIO_GETIRQ, &id, sizeof(DWORD), &irq, sizeof(DWORD), NULL,
NULL);
"id" is GPIO pin number, "irq" returns IRQ number
5. Close GPIO device
CloseHandle(hFile);
1. GPIO pin definition: 0~191 MPU Bank1~6 GPIO pin, 192~209 TPS65930
GPIO 0~17.
2. GPIO interrupt mode is used for drivers, application cannot set this mode.
3. For definition of IOCTL code and GPIO mode, please refer to CD file
[\wince_6\inc\gpio.h] User should include the header file.