User manual

Page | 109
Id is the GPIO pin number; mode is the GPIO mode definition; the
following table lists all the mode definitions;
Mode Definitions
Descriptions
GPIO_DIR_OUTPUT
Output mode
GPIO_DIR_INPUT
Output mode
GPIO_INT_LOW_HIGH
Triggered on rising edge
GPIO_INT_HIGH_LOW
Triggered on falling edge
GPIO_INT_LOW
Triggered by low level
GPIO_INT_HIGH
Triggered by high level
GPIO_DEBOUNCE_ENABLE
Debounce enabled
5. Operations on GPIO pins
Operations on Pins
DWORD id = 0, pin = 0;
High Level Output
DeviceIoControl(hFile, IOCTL_GPIO_SETBIT, &id, sizeof(DWORD),
NULL, 0, NULL, NULL);
Low Level Output
DeviceIoControl(hFile, IOCTL_GPIO_CLRBIT, &id, sizeof(DWORD),
NULL, 0, NULL, NULL);
Read Status of Pins
DeviceIoControl(hFile, IOCTL_GPIO_GETBIT, &id, sizeof(DWORD),
&pin, sizeof(DWORD), NULL, NULL);
Id is the GPIO pin number; pin returns pin status.