// gpioclx.h
typedef struct _GPIO_CLIENT_REGISTRATION_PACKET {
USHORT Version;
USHORT Size;
ULONG Flags;
ULONG ControllerContextSize;
ULONG64 Reserved;
PGPIO_CLIENT_PREPARE_CONTROLLER CLIENT_PrepareController;
PGPIO_CLIENT_RELEASE_CONTROLLER CLIENT_ReleaseController;
PGPIO_CLIENT_START_CONTROLLER CLIENT_StartController;
PGPIO_CLIENT_STOP_CONTROLLER CLIENT_StopController;
PGPIO_CLIENT_QUERY_CONTROLLER_BASIC_INFORMATION CLIENT_QueryControllerBasicInformation;
PGPIO_CLIENT_QUERY_SET_CONTROLLER_INFORMATION CLIENT_QuerySetControllerInformation;
PGPIO_CLIENT_ENABLE_INTERRUPT CLIENT_EnableInterrupt;
PGPIO_CLIENT_DISABLE_INTERRUPT CLIENT_DisableInterrupt;
PGPIO_CLIENT_UNMASK_INTERRUPT CLIENT_UnmaskInterrupt;
PGPIO_CLIENT_MASK_INTERRUPTS CLIENT_MaskInterrupts;
PGPIO_CLIENT_QUERY_ACTIVE_INTERRUPTS CLIENT_QueryActiveInterrupts;
PGPIO_CLIENT_CLEAR_ACTIVE_INTERRUPTS CLIENT_ClearActiveInterrupts;
PGPIO_CLIENT_CONNECT_IO_PINS CLIENT_ConnectIoPins;
PGPIO_CLIENT_DISCONNECT_IO_PINS CLIENT_DisconnectIoPins;
union {
PGPIO_CLIENT_READ_PINS CLIENT_ReadGpioPins;
PGPIO_CLIENT_READ_PINS_MASK CLIENT_ReadGpioPinsUsingMask;
};
union {
PGPIO_CLIENT_WRITE_PINS CLIENT_WriteGpioPins;
PGPIO_CLIENT_WRITE_PINS_MASK CLIENT_WriteGpioPinsUsingMask;
};
PGPIO_CLIENT_SAVE_BANK_HARDWARE_CONTEXT CLIENT_SaveBankHardwareContext;
PGPIO_CLIENT_RESTORE_BANK_HARDWARE_CONTEXT CLIENT_RestoreBankHardwareContext;
PGPIO_CLIENT_PRE_PROCESS_CONTROLLER_INTERRUPT CLIENT_PreProcessControllerInterrupt;
PGPIO_CLIENT_CONTROLLER_SPECIFIC_FUNCTION CLIENT_ControllerSpecificFunction;
PGPIO_CLIENT_RECONFIGURE_INTERRUPT CLIENT_ReconfigureInterrupt;
PGPIO_CLIENT_QUERY_ENABLED_INTERRUPTS CLIENT_QueryEnabledInterrupts;
PGPIO_CLIENT_CONNECT_FUNCTION_CONFIG_PINS CLIENT_ConnectFunctionConfigPins;
PGPIO_CLIENT_DISCONNECT_FUNCTION_CONFIG_PINS CLIENT_DisconnectFunctionConfigPins;
} GPIO_CLIENT_REGISTRATION_PACKET, *PGPIO_CLIENT_REGISTRATION_PACKET;
View the official Windows Driver Kit DDI referenceNo description available.
The GPIO_CLIENT_REGISTRATION_PACKET structure contains registration information that the general-purpose I/O (GPIO) controller driver passes to the GPIO framework extension (GpioClx).
VersionThe version number for the GPIO interface that the GPIO controller driver supports. Set this member to the value GPIO_CLIENT_VERSION, which is defined in the Gpioclx.h header file.
SizeThe size, in bytes, of this structure. Set this member to sizeof(GPIO_CLIENT_REGISTRATION_PACKET).
FlagsA set of flags that indicate which registration options are selected. No flags are currently defined for registration options. Set this member to zero.
ControllerContextSizeThe required device context size, in bytes. The GPIO_CLX_RegisterClient method allocates a device context of this size. When GpioClx calls any registered callback function in the GPIO_CLIENT_REGISTRATION_PACKET structure, GpioClx passes this device context to the callback function as a parameter. The callback functions use this context to access and update the driver's information about the state of the GPIO controller device. For more information, see GPIO Device Contexts.
ReservedReserved for future use. Set this member to zero.
CLIENT_PrepareControllerA pointer to the GPIO controller driver's CLIENT_PrepareController event callback function.
CLIENT_ReleaseControllerA pointer to the GPIO controller driver's CLIENT_ReleaseController event callback function.
CLIENT_StartControllerA pointer to the GPIO controller driver's CLIENT_StartController event callback function.
CLIENT_StopControllerA pointer to the GPIO controller driver's CLIENT_StopController event callback function.
CLIENT_QueryControllerBasicInformationA pointer to the GPIO controller driver's CLIENT_QueryControllerBasicInformation event callback function.
CLIENT_QuerySetControllerInformationA pointer to the GPIO controller driver's CLIENT_QuerySetControllerInformation event callback function.
CLIENT_EnableInterruptA pointer to the GPIO controller driver's CLIENT_EnableInterrupt event callback function.
CLIENT_DisableInterruptA pointer to the GPIO controller driver's CLIENT_DisableInterrupt event callback function.
CLIENT_UnmaskInterruptA pointer to the GPIO controller driver's CLIENT_UnmaskInterrupt event callback function.
CLIENT_MaskInterruptsA pointer to the GPIO controller driver's CLIENT_MaskInterrupts event callback function.
CLIENT_QueryActiveInterruptsA pointer to the GPIO controller driver's CLIENT_QueryActiveInterrupts event callback function.
CLIENT_ClearActiveInterruptsA pointer to the GPIO controller driver's CLIENT_ClearActiveInterrupts event callback function.
CLIENT_ConnectIoPinsA pointer to the GPIO controller driver's CLIENT_ConnectIoPins event callback function.
CLIENT_DisconnectIoPinsA pointer to the GPIO controller driver's CLIENT_DisconnectIoPins event callback function.
CLIENT_ReadGpioPinsA pointer to the GPIO controller driver's CLIENT_ReadGpioPins event callback function.
CLIENT_ReadGpioPinsUsingMaskA pointer to the GPIO controller driver's CLIENT_ReadGpioPinsUsingMask event callback function.
CLIENT_WriteGpioPinsA pointer to the GPIO controller driver's CLIENT_WriteGpioPins event callback function.
CLIENT_WriteGpioPinsUsingMaskA pointer to the GPIO controller driver's CLIENT_WriteGpioPinsUsingMask event callback function.
CLIENT_SaveBankHardwareContextA pointer to the GPIO controller driver's CLIENT_SaveBankHardwareContext event callback function.
CLIENT_RestoreBankHardwareContextA pointer to the GPIO controller driver's CLIENT_RestoreBankHardwareContext event callback function.
CLIENT_PreProcessControllerInterruptA pointer to the GPIO controller driver's CLIENT_PreProcessControllerInterrupt event callback function.
CLIENT_ControllerSpecificFunctionA pointer to the GPIO controller driver's CLIENT_ControllerSpecificFunction event callback function.
CLIENT_ReconfigureInterruptA pointer to the GPIO controller driver's CLIENT_ReconfigureInterrupt event callback function.
CLIENT_QueryEnabledInterruptsA pointer to the GPIO controller driver's CLIENT_QueryEnabledInterrupts event callback function. This member is supported starting with Windows 8.1.
CLIENT_ConnectFunctionConfigPinsCLIENT_DisconnectFunctionConfigPinsThe GPIO controller driver passes a pointer to a GPIO_CLIENT_REGISTRATION_PACKET structure as an input parameter to the GPIO_CLX_RegisterClient method. This method registers the driver to use the services provided by GpioClx. Typically, the driver calls this method from its DriverEntry routine.
The GPIO_CLIENT_REGISTRATION_PACKET structure contains two unnamed unions. Each union can contain a pointer to one of two alternative types of event callback functions. In each case, your GPIO controller driver should implement the type of callback function that is best suited to the GPIO controller hardware. The GPIO controller driver's CLIENT_QueryControllerBasicInformation callback function informs GpioClx which callback functions are implemented.
After the GPIO controller driver calls GPIO_CLX_RegisterClient to register a set of callbacks, GpioClx calls the driver's CLIENT_QueryControllerBasicInformation callback function to obtain a CLIENT_CONTROLLER_BASIC_INFORMATION structure that contains GPIO controller hardware attributes and configuration data. GpioClx uses this information to determine which callback functions the GPIO controller driver has implemented.
If the GPIO controller driver implements CLIENT_ReadGpioPins and CLIENT_WriteGpioPins callback functions, the CLIENT_QueryControllerBasicInformation callback function should set the FormatIoRequestsAsMasks flag bit in the Flags member of this CLIENT_CONTROLLER_BASIC_INFORMATION structure to 0.
If the CLIENT_QueryControllerBasicInformation callback function sets the FormatIoRequestsAsMasks flag bit to 1, this value indicates that the driver implements CLIENT_ReadGpioPinsUsingMask and CLIENT_WriteGpioPinsUsingMask callback functions.
GpioClx requires a GPIO controller driver to implement certain callback functions, but support for other callback functions is optional. For more information, see Optional and Required GPIO Callback Functions.
CLIENT_CONTROLLER_BASIC_INFORMATION
CLIENT_ControllerSpecificFunction
CLIENT_PreProcessControllerInterrupt
CLIENT_QueryControllerBasicInformation
CLIENT_RestoreBankHardwareContext
CLIENT_SaveBankHardwareContext