1.15.10.22 GPIO_PinIntEnable Function

C

void GPIO_PinIntEnable(GPIO_PIN pin, GPIO_INTERRUPT_STYLE style);

Summary

Enables IO interrupt on selected IO pin.

Description

This function enables selected type of interrupt on selected IO pin.

All the pins of a particular port channel must be enabled using this API either for edge type or mismatch type interrupt. User must not enable few pins of a particular port channel in mismatch style and few others in edge style. Such mix-up will result in unexpected behavior. Whichever style of interrupt is desired, setting for that must be done in "Use Edge Type Interrupt" option for corresponding port channel in MHC tree view at the time of code generation itself.

Precondition

  • Corresponding pin must be configured in interrupt mode in MHC Pin Manager.

  • To use edge type of interrupt, "Use Edge Type Interrupt" option for corresponding port channel must be checked in MHC tree view.

  • To use mismatch type interrupt, "Use Edge Type Interrupt" option for corresponding port channel must be unchecked in MHC tree view.

  • GPIO_Initialize() must have been called.

Parameters

Param Description
pin One of the IO pins from the enum GPIO_PIN
style selects type/style of the interrupt

Returns

None.

Example

GPIO_PinIntEnable(GPIO_PIN_RB3, GPIO_INTERRUPT_ON_RISING_EDGE);

Remarks

None.