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

 * This function returns the configuration of a given pin interrupt.
 *
 * param base Base address of the PINT peripheral.
 * param pintr Pin interrupt.
 * param enable Pointer to store the detection logic.
 * param callback Callback.
 *
 * retval None.
 */
brief        Get PINT peripheral pin interrupt configuration.
This function returns the configuration of a given pin interrupt.

param base Base address of the PINT peripheral.
param pintr Pin interrupt.
param enable Pointer to store the detection logic.
param callback Callback.

retval None.
brief Get PINT peripheral pin interrupt configuration . This function returns the configuration of a given pin interrupt . param base Base address of the PINT peripheral . param pintr Pin interrupt . param enable Pointer to store the detection logic . param callback Callback . retval None .
void PINT_PinInterruptGetConfig(PINT_Type *base, pint_pin_int_t pintr, pint_pin_enable_t *enable, pint_cb_t *callback)
{
    uint32_t mask;
    bool level;
    assert(base != NULL);
    *enable = kPINT_PinIntEnableNone;
    level   = false;
    mask = 1UL << (uint32_t)pintr;
    if ((base->ISEL & mask) != 0U)
    {
        level = true;
    }
    if ((base->IENR & mask) != 0U)
    {
        if (level)
        {
            *enable = kPINT_PinIntEnableLowLevel;
        }
        else
        {
            *enable = kPINT_PinIntEnableRiseEdge;
        }
    }
    if ((base->IENF & mask) != 0U)
    {
        if (level)
        {
            *enable = kPINT_PinIntEnableHighLevel;
        }
        else
        {
            if (*enable == kPINT_PinIntEnableRiseEdge)
            {
                *enable = kPINT_PinIntEnableBothEdges;
            }
            else
            {
                *enable = kPINT_PinIntEnableFallEdge;
            }
        }
    }
    if (base == PINT)
    {
        *callback = s_pintCallback[pintr];
    }
    else
    {
#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS)
        *callback = s_secpintCallback[pintr];
#endif
    }
}
void PINT_PinInterruptGetConfig ( PINT_Type * base , pint_pin_int_t pintr , pint_pin_enable_t * enable , pint_cb_t * callback ) { uint32_t mask ; bool level ; assert ( base != NULL ) ; * enable = kPINT_PinIntEnableNone ; level = false ; mask = 1UL << ( uint32_t ) pintr ; if ( ( base -> ISEL & mask ) != 0U ) { level = true ; } if ( ( base -> IENR & mask ) != 0U ) { if ( level ) { * enable = kPINT_PinIntEnableLowLevel ; } else { * enable = kPINT_PinIntEnableRiseEdge ; } } if ( ( base -> IENF & mask ) != 0U ) { if ( level ) { * enable = kPINT_PinIntEnableHighLevel ; } else { if ( * enable == kPINT_PinIntEnableRiseEdge ) { * enable = kPINT_PinIntEnableBothEdges ; } else { * enable = kPINT_PinIntEnableFallEdge ; } } } if ( base == PINT ) { * callback = s_pintCallback [ pintr ] ; } else { #if ( defined ( FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS ) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS ) * callback = s_secpintCallback [ pintr ] ; #endif } }
brief        Get PINT peripheral pin interrupt configuration.
brief Get PINT peripheral pin interrupt configuration .
/* Pin interrupt is level sensitive */ /* Level interrupt is enabled */ /* Rising edge interrupt */ /* Level interrupt is active high */ /* Either falling or both edge */ /* Rising and faling edge */ /* Falling edge */ /* Security PINT uses additional callback array */