2.49.29 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 MCC tree view at the time of code generation itself.

Precondition

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

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

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

  • GPIO_Initialize() must have been called.

Parameters

ParamDescription
pinOne of the IO pins from the enum GPIO_PIN
styleselects type/style of the interrupt

Returns

None.

Example

GPIO_PinIntEnable(GPIO_PIN_RB3, GPIO_INTERRUPT_ON_RISING_EDGE);

Remarks

None.