FreeRTOS/Demo/Safer_Interrupts_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/drivers/fsl_pint.c
/*!
 * brief	Configure PINT pattern match.

 * This function configures a given pattern match bit slice.
 *
 * param base Base address of the PINT peripheral.
 * param bslice Pattern match bit slice number.
 * param cfg Pointer to bit slice configuration.
 *
 * retval None.
 */
brief        Configure PINT pattern match.
This function configures a given pattern match bit slice.

param base Base address of the PINT peripheral.
param bslice Pattern match bit slice number.
param cfg Pointer to bit slice configuration.

retval None.
brief Configure PINT pattern match . This function configures a given pattern match bit slice . param base Base address of the PINT peripheral . param bslice Pattern match bit slice number . param cfg Pointer to bit slice configuration . retval None .
void PINT_PatternMatchConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg)
{
    uint32_t src_shift;
    uint32_t cfg_shift;
    uint32_t pmcfg;
    uint32_t tmp_src_shift = PININT_BITSLICE_SRC_MASK;
    uint32_t tmp_cfg_shift = PININT_BITSLICE_CFG_MASK;
    assert(base != NULL);
    src_shift = PININT_BITSLICE_SRC_START + ((uint32_t)bslice * 3UL);
    cfg_shift = PININT_BITSLICE_CFG_START + ((uint32_t)bslice * 3UL);
    base->PMSRC = (base->PMSRC & ~(tmp_src_shift << src_shift)) | ((uint32_t)(cfg->bs_src) << src_shift);
    pmcfg = base->PMCFG;
    pmcfg = (pmcfg & ~(tmp_cfg_shift << cfg_shift)) | ((uint32_t)(cfg->bs_cfg) << cfg_shift);
    if ((uint32_t)bslice != 7UL)
    {
        if (cfg->end_point)
        {
            pmcfg |= (1UL << (uint32_t)bslice);
        }
        else
        {
            pmcfg &= ~(1UL << (uint32_t)bslice);
        }
    }
    base->PMCFG = pmcfg;
    if (base == PINT)
    {
        if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS)
        {
            s_pintCallback[bslice] = cfg->callback;
        }
    }
    else
    {
#if (defined(FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS)
        if ((uint32_t)bslice < (uint32_t)FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS)
        {
            s_secpintCallback[bslice] = cfg->callback;
        }
#endif
    }
}
void PINT_PatternMatchConfig ( PINT_Type * base , pint_pmatch_bslice_t bslice , pint_pmatch_cfg_t * cfg ) { uint32_t src_shift ; uint32_t cfg_shift ; uint32_t pmcfg ; uint32_t tmp_src_shift = PININT_BITSLICE_SRC_MASK ; uint32_t tmp_cfg_shift = PININT_BITSLICE_CFG_MASK ; assert ( base != NULL ) ; src_shift = PININT_BITSLICE_SRC_START + ( ( uint32_t ) bslice * 3UL ) ; cfg_shift = PININT_BITSLICE_CFG_START + ( ( uint32_t ) bslice * 3UL ) ; base -> PMSRC = ( base -> PMSRC & ~ ( tmp_src_shift << src_shift ) ) | ( ( uint32_t ) ( cfg -> bs_src ) << src_shift ) ; pmcfg = base -> PMCFG ; pmcfg = ( pmcfg & ~ ( tmp_cfg_shift << cfg_shift ) ) | ( ( uint32_t ) ( cfg -> bs_cfg ) << cfg_shift ) ; if ( ( uint32_t ) bslice != 7UL ) { if ( cfg -> end_point ) { pmcfg |= ( 1UL << ( uint32_t ) bslice ) ; } else { pmcfg &= ~ ( 1UL << ( uint32_t ) bslice ) ; } } base -> PMCFG = pmcfg ; if ( base == PINT ) { if ( ( uint32_t ) bslice < ( uint32_t ) FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS ) { s_pintCallback [ bslice ] = cfg -> callback ; } } else { #if ( defined ( FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS ) && FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS ) if ( ( uint32_t ) bslice < ( uint32_t ) FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS ) { s_secpintCallback [ bslice ] = cfg -> callback ; } #endif } }
brief        Configure PINT pattern match.
brief Configure PINT pattern match .
/* Input source selection for selected bit slice */ /* Bit slice configuration */ /* If end point is true, enable the bits */ /* Save callback pointer */