Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CLIENT_DisableInterrupt callback function

The CLIENT_DisableInterrupt event callback function disables interrupts on a general-purpose I/O (GPIO) pin that is configured as an interrupt input.

Syntax


GPIO_CLIENT_DISABLE_INTERRUPT CLIENT_DisableInterrupt;

NTSTATUS CLIENT_DisableInterrupt(
  _In_ PVOID                              Context,
  _In_ PGPIO_DISABLE_INTERRUPT_PARAMETERS DisableParameters
)
{ ... }

Parameters

Context [in]

A pointer to the GPIO controller driver's device context.

DisableParameters [in]

A pointer to a GPIO_DISABLE_INTERRUPT_PARAMETERS structure that describes the GPIO interrupt pin.

Return value

The CLIENT_DisableInterrupt function returns STATUS_SUCCESS if the call is successful. Otherwise, it returns an appropriate error code.

Remarks

This callback function is implemented by the GPIO controller driver. GpioClx calls this function to disable interrupts on a GPIO pin that is configured as an interrupt request input.

To register your driver's CLIENT_DisableInterrupt callback function, call the GPIO_CLX_RegisterClient method. This method accepts, as an input parameter, a pointer to a GPIO_CLIENT_REGISTRATION_PACKET structure that contains a CLIENT_DisableInterrupt function pointer.

GpioClx always calls the CLIENT_EnableInterrupt and CLIENT_DisableInterrupt callback functions at IRQL = PASSIVE_LEVEL. However, if the GPIO registers are memory-mapped, GpioClx calls the other interrupt-related callback functions from its ISR at DIRQL. In this case, the CLIENT_EnableInterrupt and CLIENT_DisableInterrupt functions should use the GPIO interrupt lock to synchronize their interrupt-related operations to the ISR. For more information, see Interrupt Synchronization for GPIO Controller Drivers.

Examples

To define a CLIENT_DisableInterrupt callback function, you must first provide a function declaration that identifies the type of callback function you're defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it's a requirement for writing drivers for the Windows operating system.

For example, to define a CLIENT_DisableInterrupt callback function that is named MyEvtGpioDisableInterrupt, use the GPIO_CLIENT_DISABLE_INTERRUPT function type, as shown in this code example:


GPIO_CLIENT_DISABLE_INTERRUPT MyEvtGpioDisableInterrupt;

Then, implement your callback function as follows:


_Use_decl_annotations_
VOID
  MyEvtGpioDisableInterrupt(
    PVOID Context,
    PGPIO_DISABLE_INTERRUPT_PARAMETERS DisableParameters
    )
{ ... }

The GPIO_CLIENT_DISABLE_INTERRUPT function type is defined in the Gpioclx.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the GPIO_CLIENT_DISABLE_INTERRUPT function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for KMDF Drivers. For more information about _Use_decl_annotations_, see Annotating Function Behavior.

Requirements

Target platform

Desktop

Version

Supported starting with Windows 8.

Header

Gpioclx.h

IRQL

Called at PASSIVE_LEVEL.

See also

CLIENT_EnableInterrupt
GPIO_CLIENT_REGISTRATION_PACKET
GPIO_CLX_RegisterClient
GPIO_DISABLE_INTERRUPT_PARAMETERS

 

 

Send comments about this topic to Microsoft

Show: