FreeRTOS/Demo/Safer_Interrupts_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/drivers/fsl_pint.c
/*!
 * brief	Configure PINT peripheral pin interrupt.

 * This function configures a given pin interrupt.
 *
 * param base Base address of the PINT peripheral.
 * param intr Pin interrupt.
 * param enable Selects detection logic.
 * param callback Callback.
 *
 * retval None.
 */
brief        Configure PINT peripheral pin interrupt.
This function configures a given pin interrupt.

param base Base address of the PINT peripheral.
param intr Pin interrupt.
param enable Selects detection logic.
param callback Callback.

retval None.
brief Configure PINT peripheral pin interrupt . This function configures a given pin interrupt . param base Base address of the PINT peripheral . param intr Pin interrupt . param enable Selects detection logic . param callback Callback . retval None .
void PINT_PinInterruptConfig(PINT_Type *base, pint_pin_int_t intr, pint_pin_enable_t enable, pint_cb_t callback)
{
    assert(base != NULL);
    PINT_PinInterruptClrRiseFlag(base, intr);
    PINT_PinInterruptClrFallFlag(base, intr);
    if (base == PINT)
    {
        s_pintCallback[intr] = callback;
    }
    else
    {
#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS)
        s_secpintCallback[intr] = callback;
#endif
    }
    base->ISEL = (base->ISEL & ~(1UL << (uint32_t)intr)) |
                 ((((uint32_t)enable & PINT_PIN_INT_LEVEL) != 0U) ? (1UL << (uint32_t)intr) : 0U);
    if (((unsigned)enable & (PINT_PIN_INT_LEVEL | PINT_PIN_INT_RISE)) != 0U)
    {
        base->SIENR = 1UL << (uint32_t)intr;
    }
    else
    {
        base->CIENR = 1UL << (uint32_t)intr;
    }
    if (((unsigned)enable & PINT_PIN_INT_FALL_OR_HIGH_LEVEL) != 0U)
    {
        base->SIENF = 1UL << (uint32_t)intr;
    }
    else
    {
        base->CIENF = 1UL << (uint32_t)intr;
    }
}
void PINT_PinInterruptConfig ( PINT_Type * base , pint_pin_int_t intr , pint_pin_enable_t enable , pint_cb_t callback ) { assert ( base != NULL ) ; PINT_PinInterruptClrRiseFlag ( base , intr ) ; PINT_PinInterruptClrFallFlag ( base , intr ) ; if ( base == PINT ) { s_pintCallback [ intr ] = callback ; } else { #if ( defined ( FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS ) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS ) s_secpintCallback [ intr ] = callback ; #endif } base -> ISEL = ( base -> ISEL & ~ ( 1UL << ( uint32_t ) intr ) ) | ( ( ( ( uint32_t ) enable & PINT_PIN_INT_LEVEL ) != 0U ) ? ( 1UL << ( uint32_t ) intr ) : 0U ) ; if ( ( ( unsigned ) enable & ( PINT_PIN_INT_LEVEL | PINT_PIN_INT_RISE ) ) != 0U ) { base -> SIENR = 1UL << ( uint32_t ) intr ; } else { base -> CIENR = 1UL << ( uint32_t ) intr ; } if ( ( ( unsigned ) enable & PINT_PIN_INT_FALL_OR_HIGH_LEVEL ) != 0U ) { base -> SIENF = 1UL << ( uint32_t ) intr ; } else { base -> CIENF = 1UL << ( uint32_t ) intr ; } }
brief        Configure PINT peripheral pin interrupt.
brief Configure PINT peripheral pin interrupt .
/* Clear Rise and Fall flags first */ /* Security PINT uses additional callback array */ /* select level or edge sensitive */ /* enable rising or level interrupt */ /* Enable falling or select high level */