/**
*     @file    Icu_Siu_Irq.c
*     @version 1.0.0
*
*     @brief   AUTOSAR Icu - SIU source file support for ICU driver.
*     @details SIU source file, containing the variables and functions that are exported by the SIU driver.
*     @addtogroup ICU_MODULE
*     @{
*/
/*==================================================================================================
*     Project             : AUTOSAR 4.3 MCAL
*     Platform            : PA
*     Peripheral          : eMIOS SIU
*     Dependencies        : none
*
*     Autosar Version     : 4.3.1
*     Autosar Revision    : ASR_REL_4_3_REV_0001
*     Autosar ConfVariant :
*     SWVersion           : 1.0.0
*     BuildVersion        : MPC5777C_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190315
*
*     (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2019 NXP
*     All Rights Reserved.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/

#ifdef __cplusplus
extern "C"{
#endif

/**
* @page misra_violations MISRA-C:2012 violations
*
* @section ICU_SIU_IRQ_C_REF_1
* Violates MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
* This violation is not fixed since the inclusion of <MA>_MemMap.h is as per AUTOSAR requirement [SWS_MemMap_00003].
*
* @section ICU_SIU_IRQ_C_REF_2
* Violates MISRA 2012 Advisory Rule 20.1, #include directives should only be preceded by preprocessor
* directives or comments.
* <MA>_MemMap.h is included after each section define in order to set the current memory section as defined by AUTOSAR.
*
* @section ICU_SIU_IRQ_C_REF_3
* Violates MISRA 2012 Advisory Rule 11.4, A conversion should not be performed between a pointer to object and an integer type.
* The cast is used to access memory mapped registers.
*
* @section ICU_SIU_IRQ_C_REF_4
* Violates MISRA 2012 Required Rule 11.6, A cast shall not be performed between pointer to void and an arithmetic type.
* The cast is used to access memory mapped registers.
*
* @section ICU_SIU_IRQ_C_REF_5
* Violates MISRA 2012 Required Rule 10.3, The value of an expression shall not be assigned to an object with a
* narrower essential type or of a different essential type category.
* The assignment and cast are done respective to mask and shift to get the modes/params.
*
* @section ICU_SIU_IRQ_C_REF_6
* Violates MISRA 2012 Advisory Rule 8.7, Functions and objects should not be defined with
* external linkage if they are referenced in only one translation unit.
* These functions represent the API of the driver. External linkage is needed to "export" the API.
*
* @section ICU_SIU_IRQ_C_REF_7
*     Violates MISRA 2012 Required Rule 14.4, The controlling expression of an if statement and
*     the controlling expression of an iteration-statement shall have essentially Boolean type.
*     Multi-statement macros shall be wrapped in a do–while loop, so the macro can appear safely inside if
*     clauses or other places that expect a single statement or a statement block
*
*/

/*==================================================================================================
*                                          INCLUDE FILES
*  1) system and project includes
*  2) needed interfaces from external units
*  3) internal and external interfaces from this unit
==================================================================================================*/
#include "Mcal.h"

#include "Icu_Cfg.h"
#define USER_MODE_REG_PROT_ENABLED (ICU_ENABLE_USER_MODE_SUPPORT)
#include "SilRegMacros.h"

#include "Icu_Reg_eSys_Siu.h"
#include "Icu_Siu.h"

#include "SchM_Icu.h"

#include "Icu_Ipw_Types.h"
#include "Icu_Ipw_Irq.h"

/*==================================================================================================
*                                SOURCE FILE VERSION INFORMATION
==================================================================================================*/
/**
* @{
* @brief          Source file version information
* */
#define ICU_SIU_IRQ_VENDOR_ID_C         43
#define ICU_SIU_IRQ_AR_RELEASE_MAJOR_VERSION_C  4
#define ICU_SIU_IRQ_AR_RELEASE_MINOR_VERSION_C  3
#define ICU_SIU_IRQ_AR_RELEASE_REVISION_VERSION_C  1
#define ICU_SIU_IRQ_SW_MAJOR_VERSION_C  1
#define ICU_SIU_IRQ_SW_MINOR_VERSION_C  0
#define ICU_SIU_IRQ_SW_PATCH_VERSION_C  0
/**@}*/

/*==================================================================================================
*                                       FILE VERSION CHECKS
==================================================================================================*/
#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
    #if ((ICU_SIU_IRQ_AR_RELEASE_MAJOR_VERSION_C != MCAL_AR_RELEASE_MAJOR_VERSION) || \
         (ICU_SIU_IRQ_AR_RELEASE_MINOR_VERSION_C != MCAL_AR_RELEASE_MINOR_VERSION))
        #error "AutoSar Version Numbers of Icu_Siu_Irq.c and Mcal.h are different"
    #endif
#endif

#if (ICU_SIU_IRQ_VENDOR_ID_C != ICU_VENDOR_ID_CFG)
    #error "Icu_Siu_Irq.c and Icu_Cfg.h have different vendor IDs"
#endif
/* Check if source file and Icu_Cfg header file are of the same Autosar version */
#if ((ICU_SIU_IRQ_AR_RELEASE_MAJOR_VERSION_C != ICU_AR_RELEASE_MAJOR_VERSION_CFG) || \
     (ICU_SIU_IRQ_AR_RELEASE_MINOR_VERSION_C != ICU_AR_RELEASE_MINOR_VERSION_CFG) || \
     (ICU_SIU_IRQ_AR_RELEASE_REVISION_VERSION_C != ICU_AR_RELEASE_REVISION_VERSION_CFG))
    #error "AutoSar Version Numbers of Icu_Cfg.h and Icu_Siu_Irq.c are different"
#endif
/* Check if source file and Icu_Cfg header file are of the same Software version */
#if ((ICU_SIU_IRQ_SW_MAJOR_VERSION_C != ICU_SW_MAJOR_VERSION_CFG) || \
     (ICU_SIU_IRQ_SW_MINOR_VERSION_C != ICU_SW_MINOR_VERSION_CFG) || \
     (ICU_SIU_IRQ_SW_PATCH_VERSION_C != ICU_SW_PATCH_VERSION_CFG))
    #error "Software Version Numbers of Icu_Cfg.h and Icu_Siu_Irq.c are different"
#endif

/* Check if source file and Icu_Siu.h file are of the same vendor */
#if (ICU_SIU_IRQ_VENDOR_ID_C != ICU_SIU_VENDOR_ID)
    #error "Icu_Siu_IRQ.c and Icu_Siu.h have different vendor IDs"
#endif
#if ((ICU_SIU_IRQ_AR_RELEASE_MAJOR_VERSION_C != ICU_SIU_AR_RELEASE_MAJOR_VERSION) || \
     (ICU_SIU_IRQ_AR_RELEASE_MINOR_VERSION_C != ICU_SIU_AR_RELEASE_MINOR_VERSION) || \
     (ICU_SIU_IRQ_AR_RELEASE_REVISION_VERSION_C != ICU_SIU_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Icu_Siu_Irq.c and Icu_Siu.h are different"
#endif
/* Check if source file and Icu_Siu.h header file are of the same Software version */
#if ((ICU_SIU_IRQ_SW_MAJOR_VERSION_C != ICU_SIU_SW_MAJOR_VERSION) || \
     (ICU_SIU_IRQ_SW_MINOR_VERSION_C != ICU_SIU_SW_MINOR_VERSION) || \
     (ICU_SIU_IRQ_SW_PATCH_VERSION_C != ICU_SIU_SW_PATCH_VERSION))
    #error "Software Version Numbers of Icu_Siu_Irq.c and Icu_Siu.h are different"
#endif

/* Check if source file and Icu_Reg_eSys_Siu.h file are of the same vendor */
#if (ICU_SIU_IRQ_VENDOR_ID_C != SIU_VENDOR_ID_REG)
    #error "Icu_Siu_IRQ.c and Icu_Reg_eSys_Siu.h have different vendor IDs"
#endif
#if ((ICU_SIU_IRQ_AR_RELEASE_MAJOR_VERSION_C != SIU_AR_RELEASE_MAJOR_VERSION_REG) || \
     (ICU_SIU_IRQ_AR_RELEASE_MINOR_VERSION_C != SIU_AR_RELEASE_MINOR_VERSION_REG) || \
     (ICU_SIU_IRQ_AR_RELEASE_REVISION_VERSION_C != SIU_AR_RELEASE_REVISION_VERSION_REG))
    #error "AutoSar Version Numbers of Icu_Siu_Irq.c and Icu_Reg_eSys_Siu.h are different"
#endif
/* Check if source file and Icu_Reg_eSys_Siu.h header file are of the same Software version */
#if ((ICU_SIU_IRQ_SW_MAJOR_VERSION_C != SIU_SW_MAJOR_VERSION_REG) || \
     (ICU_SIU_IRQ_SW_MINOR_VERSION_C != SIU_SW_MINOR_VERSION_REG) || \
     (ICU_SIU_IRQ_SW_PATCH_VERSION_C != SIU_SW_PATCH_VERSION_REG))
    #error "Software Version Numbers of Icu_Siu_Irq.c and Icu_Reg_eSys_Siu.h are different"
#endif

/* Check if source file and Icu_Ipw_Types.h file are of the same vendor */
#if (ICU_SIU_IRQ_VENDOR_ID_C != ICU_IPW_TYPES_VENDOR_ID)
    #error "Icu_SIU_Irq.c and Icu_Ipw_Types.h have different vendor IDs"
#endif
/* Check if source file and Icu_Ipw_Types header file are of the same Autosar version */
#if ((ICU_SIU_IRQ_AR_RELEASE_MAJOR_VERSION_C != ICU_IPW_TYPES_AR_RELEASE_MAJOR_VERSION) || \
     (ICU_SIU_IRQ_AR_RELEASE_MINOR_VERSION_C != ICU_IPW_TYPES_AR_RELEASE_MINOR_VERSION) || \
     (ICU_SIU_IRQ_AR_RELEASE_REVISION_VERSION_C != ICU_IPW_TYPES_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Icu_Siu_Irq.c and Icu_Ipw_Types.h are different"
#endif
/* Check if source file and Icu_Ipw_Types header file are of the same Software version */
#if ((ICU_SIU_IRQ_SW_MAJOR_VERSION_C != ICU_IPW_TYPES_SW_MAJOR_VERSION) || \
     (ICU_SIU_IRQ_SW_MINOR_VERSION_C != ICU_IPW_TYPES_SW_MINOR_VERSION) || \
     (ICU_SIU_IRQ_SW_PATCH_VERSION_C != ICU_IPW_TYPES_SW_PATCH_VERSION))
    #error "Software Version Numbers of Icu_Siu_Irq.c and Icu_Ipw_Types.h are different"
#endif

/* Check if source file and Icu_Ipw_Irq.h file are of the same vendor */
#if (ICU_SIU_IRQ_VENDOR_ID_C != ICU_IPW_IRQ_VENDOR_ID)
    #error "Icu_Siu_Irq.c and Icu_Ipw_Irq.h have different vendor IDs"
#endif
/* Check if source file and Icu_Ipw_Irq header file are of the same Autosar version */
#if ((ICU_SIU_IRQ_AR_RELEASE_MAJOR_VERSION_C != ICU_IPW_IRQ_AR_RELEASE_MAJOR_VERSION) || \
     (ICU_SIU_IRQ_AR_RELEASE_MINOR_VERSION_C != ICU_IPW_IRQ_AR_RELEASE_MINOR_VERSION) || \
     (ICU_SIU_IRQ_AR_RELEASE_REVISION_VERSION_C != ICU_IPW_IRQ_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Icu_Siu_Irq.c and Icu_Ipw_Irq.h are different"
#endif
/* Check if source file and Icu_Ipw_Irq header file are of the same Software version */
#if ((ICU_SIU_IRQ_SW_MAJOR_VERSION_C != ICU_IPW_IRQ_SW_MAJOR_VERSION) || \
     (ICU_SIU_IRQ_SW_MINOR_VERSION_C != ICU_IPW_IRQ_SW_MINOR_VERSION) || \
     (ICU_SIU_IRQ_SW_PATCH_VERSION_C != ICU_IPW_IRQ_SW_PATCH_VERSION))
    #error "Software Version Numbers of Icu_Siu_Irq.c and Icu_Ipw_Irq.h are different"
#endif

#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
    #if ((ICU_SIU_IRQ_AR_RELEASE_MAJOR_VERSION_C != SILREGMACROS_AR_RELEASE_MAJOR_VERSION) || \
         (ICU_SIU_IRQ_AR_RELEASE_MINOR_VERSION_C != SILREGMACROS_AR_RELEASE_MINOR_VERSION))
        #error "AutoSar Version Numbers of Icu_Siu_Irq.c and SilRegMacros.h are different"
    #endif
#endif
/*==================================================================================================
*                           LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/


/*==================================================================================================
*                                        LOCAL CONSTANTS
==================================================================================================*/


/*==================================================================================================
*                                        LOCAL VARIABLES
==================================================================================================*/


/*==================================================================================================
*                                        GLOBAL CONSTANTS
==================================================================================================*/


/*==================================================================================================
*                                        GLOBAL VARIABLES
==================================================================================================*/

/*==================================================================================================
*                                    LOCAL FUNCTION PROTOTYPES
==================================================================================================*/
#define ICU_START_SEC_CODE
/**
* @brief Include Memory mapping specification
*
* @violates @ref ICU_SIU_IRQ_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*
* @violates @ref ICU_SIU_IRQ_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/

#include "Icu_MemMap.h"

#if (defined ICU_IRQ_CH_0_ISR_USED)
ISR(SIU_EXT_IRQ0_ISR);
#endif

#if (defined ICU_IRQ_CH_1_ISR_USED)
ISR(SIU_EXT_IRQ1_ISR);
#endif

#if (defined ICU_IRQ_CH_2_ISR_USED)
ISR(SIU_EXT_IRQ2_ISR);
#endif

#if (defined ICU_IRQ_CH_3_ISR_USED)
ISR(SIU_EXT_IRQ3_ISR);
#endif

#if ((defined ICU_IRQ_CH_4_ISR_USED)  || (defined ICU_IRQ_CH_5_ISR_USED)  || \
     (defined ICU_IRQ_CH_6_ISR_USED)  || (defined ICU_IRQ_CH_7_ISR_USED)  || \
     (defined ICU_IRQ_CH_8_ISR_USED)  || (defined ICU_IRQ_CH_9_ISR_USED)  || \
     (defined ICU_IRQ_CH_10_ISR_USED) || (defined ICU_IRQ_CH_11_ISR_USED) || \
     (defined ICU_IRQ_CH_12_ISR_USED) || (defined ICU_IRQ_CH_13_ISR_USED) || \
     (defined ICU_IRQ_CH_14_ISR_USED) || (defined ICU_IRQ_CH_15_ISR_USED))
ISR(SIU_EXT_IRQ_4_15_ISR);
#endif

/*==================================================================================================
*                                        LOCAL FUNCTIONS
==================================================================================================*/
#if ((defined ICU_IRQ_CH_0_ISR_USED)||(defined ICU_IRQ_CH_1_ISR_USED)||(defined ICU_IRQ_CH_2_ISR_USED) || \
     (defined ICU_IRQ_CH_3_ISR_USED))

/**
* @brief      Icu_Siu_ProcessInterrupt
* @details
*
* @param[in]      firstHwChannel - first IRQ HW Channel from the HW group
*
* @return void
*
* @implements Icu_Siu_IRQ_ProcessInterrupt_Activity
*/

LOCAL_INLINE FUNC(void, ICU_CODE) Icu_Siu_IRQ_ProcessInterrupt(CONST(uint8, AUTOMATIC) nHwChannel)
{
    /* @violates @ref ICU_SIU_IRQ_C_REF_3 Advisory Rule 11.4, A conversion should not be performed between a pointer to object and an integer type.*/
    /* @violates @ref ICU_SIU_IRQ_C_REF_4 Required Rule 11.6, A cast shall not be performed between pointer to void and an arithmetic type.*/
    VAR(uint32, AUTOMATIC) u32RegSiuEISR = REG_READ32(ICU_SIU_EISR_ADDR32);
    /* @violates @ref ICU_SIU_IRQ_C_REF_3 Advisory Rule 11.4, A conversion should not be performed between a pointer to object and an integer type.*/
    /* @violates @ref ICU_SIU_IRQ_C_REF_4 Required Rule 11.6, A cast shall not be performed between pointer to void and an arithmetic type.*/
    VAR(uint32, AUTOMATIC) u32RegSiuDIRER = REG_READ32(ICU_SIU_DIRER_ADDR32);
    /* Clear pending interrupt serviced */
    /* @violates @ref ICU_SIU_IRQ_C_REF_3 Advisory Rule 11.4, A conversion should not be performed between a pointer to object and an integer type.*/
    /* @violates @ref ICU_SIU_IRQ_C_REF_4 Required Rule 11.6, A cast shall not be performed between pointer to void and an arithmetic type.*/

    REG_WRITE32(ICU_SIU_EISR_ADDR32, ICU_SIU_CHANNEL_MASK_U32(nHwChannel));
    /* Process interrupt for ICU logical channel */
    if((u32RegSiuEISR != (uint32)0x00) && (u32RegSiuDIRER != (uint32)0x00))
    {
        if((boolean)TRUE == Icu_Siu_GetChInit(nHwChannel))
        {
            Icu_Ipw_ReportEvents(ICU_IRQ_HW_CHANNEL((uint16)nHwChannel),(boolean)FALSE);
        }
    }
}
#endif
/*==================================================================================================
                                       GLOBAL FUNCTIONS
==================================================================================================*/

#if (defined ICU_IRQ_CH_0_ISR_USED)
/*================================================================================================*/
/**
* @brief     Interrupt handler for SIU channels : 0
* @details   Process the interrupt of SIU channels 0
*
* @isr
*
* @note   This will be defined only if any of SIU channels 0 is configured
* @violates @ref ICU_SIU_IRQ_C_REF_6 Advisory Rule 8.7, Functions and objects should not be defined with external linkage if they are referenced in only one translation unit.
*/
/*================================================================================================*/
ISR(SIU_EXT_IRQ0_ISR)
{
    Icu_Siu_IRQ_ProcessInterrupt(ICU_SIU_IRQ_0);
    /** @violates @ref ICU_SIU_IRQ_C_REF_7 MISRA 2012 Required Rule 14.4, The controlling expression of an if statement
    *   and the controlling expression of an iteration-statement shall have essentially Boolean type.*/
    EXIT_INTERRUPT();
}
#endif

#if (defined ICU_IRQ_CH_1_ISR_USED)
/*==================================================================================================*/
/**
* @brief     Interrupt handler for SIU channels : 1
* @details   Process the interrupt of SIU channels 1
*
* @isr
*
* @note   This will be defined only if any of SIU channels 1 is configured
* @violates @ref ICU_SIU_IRQ_C_REF_6 Advisory Rule 8.7, Functions and objects should not be defined with external linkage if they are referenced in only one translation unit.
*/
/*================================================================================================*/

ISR(SIU_EXT_IRQ1_ISR)
{
    Icu_Siu_IRQ_ProcessInterrupt(ICU_SIU_IRQ_1);
    /** @violates @ref ICU_SIU_IRQ_C_REF_7 MISRA 2012 Required Rule 14.4, The controlling expression of an if statement
    *   and the controlling expression of an iteration-statement shall have essentially Boolean type.*/
    EXIT_INTERRUPT();
}
#endif

#if (defined ICU_IRQ_CH_2_ISR_USED)
/*================================================================================================*/
/**
* @brief     Interrupt handler for SIU channels : 2
* @details   Process the interrupt of SIU channels 2
*
* @isr
*
* @note  This will be defined only if any of SIU channels 2 is configured
* @violates @ref ICU_SIU_IRQ_C_REF_6 Advisory Rule 8.7, Functions and objects should not be defined with external linkage if they are referenced in only one translation unit.
*/
/*================================================================================================*/

ISR(SIU_EXT_IRQ2_ISR)
{
    Icu_Siu_IRQ_ProcessInterrupt(ICU_SIU_IRQ_2);
    /** @violates @ref ICU_SIU_IRQ_C_REF_7 MISRA 2012 Required Rule 14.4, The controlling expression of an if statement
    *   and the controlling expression of an iteration-statement shall have essentially Boolean type.*/
    EXIT_INTERRUPT();
}
#endif

#if (defined ICU_IRQ_CH_3_ISR_USED)
/*================================================================================================*/
/**
* @brief     Interrupt handler for SIU channels : 3
* @details   Process the interrupt of SIU channels 3
*
* @isr
*
* @note   This will be defined only if any of SIU channels 3 is configured
* @violates @ref ICU_SIU_IRQ_C_REF_6 Advisory Rule 8.7, Functions and objects should not be defined with external linkage if they are referenced in only one translation unit.
*/
/*================================================================================================*/

ISR(SIU_EXT_IRQ3_ISR)
{
    Icu_Siu_IRQ_ProcessInterrupt(ICU_SIU_IRQ_3);
    /** @violates @ref ICU_SIU_IRQ_C_REF_7 MISRA 2012 Required Rule 14.4, The controlling expression of an if statement
    *   and the controlling expression of an iteration-statement shall have essentially Boolean type.*/
    EXIT_INTERRUPT();
}
#endif


#if ((defined ICU_IRQ_CH_4_ISR_USED)  || (defined ICU_IRQ_CH_5_ISR_USED)  || \
     (defined ICU_IRQ_CH_6_ISR_USED)  || (defined ICU_IRQ_CH_7_ISR_USED)  || \
     (defined ICU_IRQ_CH_8_ISR_USED)  || (defined ICU_IRQ_CH_9_ISR_USED)  || \
     (defined ICU_IRQ_CH_10_ISR_USED) || (defined ICU_IRQ_CH_11_ISR_USED) || \
     (defined ICU_IRQ_CH_12_ISR_USED) || (defined ICU_IRQ_CH_13_ISR_USED) || \
     (defined ICU_IRQ_CH_14_ISR_USED) || (defined ICU_IRQ_CH_15_ISR_USED))
/*================================================================================================*/
/**
* @brief     Interrupt handler for SIU channels : 4 to 15
* @details   Process the interrupt of SIU channels 4 to 15
*
* @isr
*
* @note   This will be defined only if any of SIU channels 4 to 15 is configured
* @violates @ref ICU_SIU_IRQ_C_REF_6 Advisory Rule 8.7, Functions and objects should not be defined with external linkage if they are referenced in only one translation unit.
*/
/*================================================================================================*/

ISR(SIU_EXT_IRQ_4_15_ISR)
{
    VAR(uint8, AUTOMATIC) u8IrqChannel = ICU_SIU_IRQ_4;
    VAR(uint32, AUTOMATIC) u32ChannelMask = ICU_SIU_CHANNEL_MASK_U32(ICU_SIU_IRQ_4);
    VAR(uint32, AUTOMATIC) u32RegIrqMask = ICU_SIU_IRQ4_IRQ15_MASK_U32;

    /* @violates @ref ICU_SIU_IRQ_C_REF_3 Advisory Rule 11.4, A conversion should not be performed between a pointer to object and an integer type.*/
    /* @violates @ref ICU_SIU_IRQ_C_REF_4 Required Rule 11.6, A cast shall not be performed between pointer to void and an arithmetic type.*/
    VAR(uint32, AUTOMATIC) u32Reg_SIU_EISR = REG_READ32(ICU_SIU_EISR_ADDR32);

    /* Clear pending interrupt serviced */
    /* @violates @ref ICU_SIU_IRQ_C_REF_3 Advisory Rule 11.4, A conversion should not be performed between a pointer to object and an integer type.*/
    /* @violates @ref ICU_SIU_IRQ_C_REF_4 Required Rule 11.6, A cast shall not be performed between pointer to void and an arithmetic type.*/
    REG_WRITE32(ICU_SIU_EISR_ADDR32, u32RegIrqMask );

    /* Get only IRQ4 .. IRQ15 flags that has Interrupt enable bit set*/
    /* @violates @ref ICU_SIU_IRQ_C_REF_3 Advisory Rule 11.4, A conversion should not be performed between a pointer to object and an integer type.*/
    /* @violates @ref ICU_SIU_IRQ_C_REF_4 Required Rule 11.6, A cast shall not be performed between pointer to void and an arithmetic type.*/
    u32RegIrqMask &= u32Reg_SIU_EISR & REG_READ32(ICU_SIU_DIRER_ADDR32);

    while(0x0U != u32RegIrqMask)
    {
        if (0x0U != (u32RegIrqMask & u32ChannelMask))
        {
            if((boolean)TRUE == Icu_Siu_GetChInit(u8IrqChannel))
            {
                Icu_Ipw_ReportEvents(ICU_IRQ_HW_CHANNEL((uint16)u8IrqChannel),(boolean)FALSE);
            }
            /* clear the IRQ bit for current IRQ channel*/
            u32RegIrqMask &= (uint32)(~u32ChannelMask);
        }
        u8IrqChannel++;
        u32ChannelMask <<= (uint32)1;
    }
    /** @violates @ref ICU_SIU_IRQ_C_REF_7 MISRA 2012 Required Rule 14.4, The controlling expression of an if statement
    *   and the controlling expression of an iteration-statement shall have essentially Boolean type.*/
    EXIT_INTERRUPT();
}
#endif

#define ICU_STOP_SEC_CODE
/*
* @violates @ref ICU_SIU_IRQ_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*
* @violates @ref ICU_SIU_IRQ_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Icu_MemMap.h"

#ifdef __cplusplus
}
#endif
/** @} */

