Export (0) Print
Expand All

GPIO_CLIENT_REGISTRATION_PACKET structure

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).

Syntax


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;
} GPIO_CLIENT_REGISTRATION_PACKET, *PGPIO_CLIENT_REGISTRATION_PACKET;

Members

Version

The 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.

Size

The size, in bytes, of this structure. Set this member to sizeof(GPIO_CLIENT_REGISTRATION_PACKET).

Flags

A set of flags that indicate which registration options are selected. No flags are currently defined for registration options. Set this member to zero.

ControllerContextSize

The 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.

Reserved

Reserved for future use. Set this member to zero.

CLIENT_PrepareController

A pointer to the GPIO controller driver's CLIENT_PrepareController event callback function.

CLIENT_ReleaseController

A pointer to the GPIO controller driver's CLIENT_ReleaseController event callback function.

CLIENT_StartController

A pointer to the GPIO controller driver's CLIENT_StartController event callback function.

CLIENT_StopController

A pointer to the GPIO controller driver's CLIENT_StopController event callback function.

CLIENT_QueryControllerBasicInformation

A pointer to the GPIO controller driver's CLIENT_QueryControllerBasicInformation event callback function.

CLIENT_QuerySetControllerInformation

A pointer to the GPIO controller driver's CLIENT_QuerySetControllerInformation event callback function.

CLIENT_EnableInterrupt

A pointer to the GPIO controller driver's CLIENT_EnableInterrupt event callback function.

CLIENT_DisableInterrupt

A pointer to the GPIO controller driver's CLIENT_DisableInterrupt event callback function.

CLIENT_UnmaskInterrupt

A pointer to the GPIO controller driver's CLIENT_UnmaskInterrupt event callback function.

CLIENT_MaskInterrupts

A pointer to the GPIO controller driver's CLIENT_MaskInterrupts event callback function.

CLIENT_QueryActiveInterrupts

A pointer to the GPIO controller driver's CLIENT_QueryActiveInterrupts event callback function.

CLIENT_ClearActiveInterrupts

A pointer to the GPIO controller driver's CLIENT_ClearActiveInterrupts event callback function.

CLIENT_ConnectIoPins

A pointer to the GPIO controller driver's CLIENT_ConnectIoPins event callback function.

CLIENT_DisconnectIoPins

A pointer to the GPIO controller driver's CLIENT_DisconnectIoPins event callback function.

CLIENT_ReadGpioPins

A pointer to the GPIO controller driver's CLIENT_ReadGpioPins event callback function.

CLIENT_ReadGpioPinsUsingMask

A pointer to the GPIO controller driver's CLIENT_ReadGpioPinsUsingMask event callback function.

CLIENT_WriteGpioPins

A pointer to the GPIO controller driver's CLIENT_WriteGpioPins event callback function.

CLIENT_WriteGpioPinsUsingMask

A pointer to the GPIO controller driver's CLIENT_WriteGpioPinsUsingMask event callback function.

CLIENT_SaveBankHardwareContext

A pointer to the GPIO controller driver's CLIENT_SaveBankHardwareContext event callback function.

CLIENT_RestoreBankHardwareContext

A pointer to the GPIO controller driver's CLIENT_RestoreBankHardwareContext event callback function.

CLIENT_PreProcessControllerInterrupt

A pointer to the GPIO controller driver's CLIENT_PreProcessControllerInterrupt event callback function.

CLIENT_ControllerSpecificFunction

A pointer to the GPIO controller driver's CLIENT_ControllerSpecificFunction event callback function.

CLIENT_ReconfigureInterrupt

A pointer to the GPIO controller driver's CLIENT_ReconfigureInterrupt event callback function.

CLIENT_QueryEnabledInterrupts

A pointer to the GPIO controller driver's CLIENT_QueryEnabledInterrupts event callback function. This member is supported starting with Windows 8.1.

Remarks

The 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.

Requirements

Version

Supported starting with Windows 8.

Header

Gpioclx.h

See also

CLIENT_ClearActiveInterrupts
CLIENT_ConnectIoPins
CLIENT_CONTROLLER_BASIC_INFORMATION
CLIENT_ControllerSpecificFunction
CLIENT_DisableInterrupt
CLIENT_DisconnectIoPins
CLIENT_EnableInterrupt
CLIENT_MaskInterrupts
CLIENT_PrepareController
CLIENT_PreProcessControllerInterrupt
CLIENT_QueryActiveInterrupts
CLIENT_QueryControllerBasicInformation
CLIENT_QueryEnabledInterrupts
CLIENT_ReadGpioPins
CLIENT_ReadGpioPinsUsingMask
CLIENT_ReconfigureInterrupt
CLIENT_ReleaseController
CLIENT_RestoreBankHardwareContext
CLIENT_SaveBankHardwareContext
CLIENT_StartController
CLIENT_StopController
CLIENT_UnmaskInterrupt
CLIENT_WriteGpioPins
CLIENT_WriteGpioPinsUsingMask
DriverEntry
GPIO_CLX_RegisterClient

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft