/*
***********************************************************************************************************************
* 
* Product Info
* Isolar version: ISOLAR-AB 4.0.2
* Product release version: RTA-BSW 3.1.0
* 
***********************************************************************************************************************
*/

/********************************************************************************************************************/
/*                                                                                                                  */
/* TOOL-GENERATED SOURCECODE, DO NOT CHANGE                                                                         */
/*                                                                                                                  */
/********************************************************************************************************************/

#ifndef DEM_CFG_EVENTS_H
#define DEM_CFG_EVENTS_H

#include "Dem_Cfg_EventId.h"

/* ---------------------------------------- */
/* DEM_CFG_EVTDISABLESTATUSUPDATE           */
/* ---------------------------------------- */
#define DEM_CFG_EVTDISABLESTATUSUPDATE_OFF  STD_OFF
#define DEM_CFG_EVTDISABLESTATUSUPDATE_ON   STD_ON
#define DEM_CFG_EVTDISABLESTATUSUPDATE  DEM_CFG_EVTDISABLESTATUSUPDATE_OFF

/* ---------------------------------------- */
/* DEM_CFG_TRIGGERFIMREPORTS                */
/* ---------------------------------------- */
#define DEM_CFG_TRIGGERFIMREPORTS_OFF  STD_OFF
#define DEM_CFG_TRIGGERFIMREPORTS_ON   STD_ON
#define DEM_CFG_TRIGGERFIMREPORTS  DEM_CFG_TRIGGERFIMREPORTS_ON

#define DEM_CFG_FIM_OFF STD_OFF
#define DEM_CFG_FIM_ON  STD_ON
#define DEM_CFG_FIM_USED DEM_CFG_FIM_ON
/* ---------------------------------------- */
/* DEM_CFG_TRIGGERDLTREPORTS                */
/* ---------------------------------------- */
#define DEM_CFG_TRIGGERDLTREPORTS_OFF  STD_OFF
#define DEM_CFG_TRIGGERDLTREPORTS_ON   STD_ON
#define DEM_CFG_TRIGGERDLTREPORTS  DEM_CFG_TRIGGERDLTREPORTS_OFF
/* ---------------------------------------- */
/* DEM_CFG_ALLOW_HISTORY            		*/
/* ---------------------------------------- */
#define DEM_CFG_ALLOW_HISTORY_ON   STD_ON
#define DEM_CFG_ALLOW_HISTORY_OFF  STD_OFF
#define DEM_CFG_ALLOW_HISTORY  DEM_CFG_ALLOW_HISTORY_OFF

/* ---------------------------------------- */
/* DEM_CFG_LOCK_ALLFAILUREINFO            	*/
/* ---------------------------------------- */
#define DEM_CFG_LOCK_ALLFAILUREINFO_ON   STD_ON
#define DEM_CFG_LOCK_ALLFAILUREINFO_OFF  STD_OFF
#define DEM_CFG_LOCK_ALLFAILUREINFO  DEM_CFG_LOCK_ALLFAILUREINFO_OFF

/* ---------------------------------------- */
/* DEM_CFG_EVENTMEMORYENTRY_ONFDCTHRESHOLD  */
/* ---------------------------------------- */
#define DEM_CFG_SUPPORTEVENTMEMORYENTRY_ONFDCTHRESHOLD_ON   STD_ON
#define DEM_CFG_SUPPORTEVENTMEMORYENTRY_ONFDCTHRESHOLD_OFF  STD_OFF
#define DEM_CFG_SUPPORTEVENTMEMORYENTRY_ONFDCTHRESHOLD  DEM_CFG_SUPPORTEVENTMEMORYENTRY_ONFDCTHRESHOLD_OFF
/* ----------------------------------------- */
/* DEM_CFG_SUPPORT_EVENT_FDCTHRESHOLDREACHED */
/* ----------------------------------------- */
#define DEM_CFG_SUPPORT_EVENT_FDCTHRESHOLDREACHED   FALSE
/* ---------------------------------------- */
/* DEM_CFG_SETEVENTSTATUSCALLNOTIFICATION   */
/* ---------------------------------------- */
#define DEM_CFG_SETEVENTSTATUSCALLNOTIFICATION_OFF  STD_OFF
#define DEM_CFG_SETEVENTSTATUSCALLNOTIFICATION_ON   STD_ON

#if (defined DEM_SETEVENTSTATUSCALLNOTIFICATION)
#define DEM_CFG_SETEVENTSTATUSCALLNOTIFICATION  DEM_CFG_SETEVENTSTATUSCALLNOTIFICATION_ON
#else
#define DEM_CFG_SETEVENTSTATUSCALLNOTIFICATION  DEM_CFG_SETEVENTSTATUSCALLNOTIFICATION_OFF
#endif

/* ---------------------------------------- */
/* DEM_CFG_SETEVENTSTATUSALLOWEDCALLBACK    */
/* ---------------------------------------- */
#define DEM_CFG_SETEVENTSTATUSALLOWEDCALLBACK_OFF  STD_OFF
#define DEM_CFG_SETEVENTSTATUSALLOWEDCALLBACK_ON   STD_ON
#define DEM_CFG_SETEVENTSTATUSALLOWEDCALLBACK  DEM_CFG_SETEVENTSTATUSALLOWEDCALLBACK_OFF

/* ---------------------------------------- */
/* BOOLEAN configuration switches           */
/* ---------------------------------------- */
#define DEM_CFG_CUSTOMIZABLEDTCSTATUSBYTE           FALSE
#define DEM_CFG_CLEARDTCCLEARSALLBITS               TRUE
#define DEM_CFG_DTCSETTINGBLOCKSREPORTING           TRUE
#define DEM_CFG_PRJSPECIFICEVENTSTATUSHANDLING      FALSE

/* ---------------------------------------- */
/* DEM_CFG_DTC_STATUSCHANGEDCALLBACK        */
/* ---------------------------------------- */
#define DEM_CFG_DTC_STATUSCHANGEDCALLBACK_OFF	STD_OFF
#define DEM_CFG_DTC_STATUSCHANGEDCALLBACK_ON	STD_ON
#define DEM_CFG_DTC_STATUSCHANGEDCALLBACK       DEM_CFG_DTC_STATUSCHANGEDCALLBACK_OFF
/* ---------------------------------------- */
/* DEM_CFG_EVT_CLEARALLOWEDCALLBACK        */
/* ---------------------------------------- */
#define DEM_CFG_EVT_CLEARALLOWEDCALLBACK_OFF	STD_OFF
#define DEM_CFG_EVT_CLEARALLOWEDCALLBACK_ON		STD_ON
#define DEM_CFG_EVT_CLEARALLOWEDCALLBACK       	DEM_CFG_EVT_CLEARALLOWEDCALLBACK_OFF
/* ---------------------------------------- */
/* DEM_CFG_EVT_GLOBALCLEARALLOWEDCALLBACK        */
/* ---------------------------------------- */
#define DEM_CFG_EVT_GLOBALCLEARALLOWEDCALLBACK_OFF		STD_OFF
#define DEM_CFG_EVT_GLOBALCLEARALLOWEDCALLBACK_ON		STD_ON
#define DEM_CFG_EVT_GLOBALCLEARALLOWEDCALLBACK       	DEM_CFG_EVT_GLOBALCLEARALLOWEDCALLBACK_OFF

/* ---------------------------------------- */
/* DEM_CFG_EVT_DATACHANGEDCALLBACK          */
/* ---------------------------------------- */
#define DEM_CFG_EVT_DATACHANGEDCALLBACK_OFF    STD_OFF
#define DEM_CFG_EVT_DATACHANGEDCALLBACK_ON     STD_ON
#define DEM_CFG_EVT_DATACHANGEDCALLBACK        DEM_CFG_EVT_DATACHANGEDCALLBACK_OFF

#define DEM_CFG_EVT_PROJECT_EXTENSION  FALSE

/* ---------------------------------------- */
#define DEM_CFG_BSWERRORBUFFERSIZE  10u

#define DEM_CFG_EVT_STATUS_CHANGE_NUM_CALLBACKS 	0u

/* --------------------------------------------------- */
/* Reset of TestFailedSinceLastClear bit               */
/* --------------------------------------------------- */
#define DEM_CFG_TFSLC_RESET_AFTER_AGING_AND_DISPLACEMENT       FALSE

#define RECOV    (1u)
#define NOTREC   (0u)

#define DEM_DEBOUNCE_RESET    (1u)
#define DEM_DEBOUNCE_FREEZE   (0u)

#define NO_TF_RESET   (1u)
#define TF_RESET      (0u)

#define GC_SUPP    (1u)
#define NO_GC      (0u)

#define ONLY_THIS_CYCLE_AND_READINESS   (1u)
#define NO_STATUS_BYTE_CHANGE           (0u)

#define DEM_CFG_EVT_ATTRIBUTE_OFF  STD_OFF
#define DEM_CFG_EVT_ATTRIBUTE_ON  STD_ON
#define DEM_CFG_EVT_ATTRIBUTE DEM_CFG_EVT_ATTRIBUTE_OFF

/* --------------------------------------------------- */
/* DEM EVENT STATE BITPOSITION                         */
/* --------------------------------------------------- */
#define DEM_EVT_BP_STATE_CAUSALFAULT            0u

#define DEM_EVT_BP_STATE_SUSPICIONLEVEL         1u
#define DEM_EVT_BP_STATE_NOTAVAILABLE           2u
#define DEM_EVT_BP_STATE_INITMONITORING         3u
#define DEM_EVT_BP_STATE_INITMONITORING_MASK    (0x07u)
#define DEM_EVT_BP_STATE_INITMONITORING_SIZE    3u
#define DEM_EVT_BP_STATE_WIRSTATUS_EXTERNAL     6u
#define DEM_EVT_BP_STATE_TFTFC_SINCE_PREINIT       7u
#define DEM_EVT_BP_STATE_TCTFC_SINCE_PREINIT       8u

#define DEM_EVT_BP_STATE_NXT_REPORT_IS_RELEVANT      9u

typedef uint16 Dem_EvtStateType;
#define DEM_EVTSTATE_ISBITSET      rba_DiagLib_Bit16IsBitSet
#define DEM_EVTSTATE_OVERWRITEBIT  rba_DiagLib_Bit16OverwriteBit
#define DEM_EVTSTATE_OVERWRITEBITS rba_DiagLib_Bit16OverwriteBits
#define DEM_EVTSTATE_CLEARBIT      rba_DiagLib_Bit16ClearBit
#define DEM_EVTSTATE_SETBIT        rba_DiagLib_Bit16SetBit
#define DEM_EVTSTATE_GETBITS       rba_DiagLib_Bit16GetBits
#define DEM_EVTSTATE_CLEARBITS     rba_DiagLib_Bit16ClearBits

/* --------------------------------------------------- */
/* DEM EVENT PARAM BITPOSITION                         */
/* --------------------------------------------------- */
#define DEM_EVT_BP_PARAM_ISRECOVERABLE            0u
#define DEM_EVT_PARAMINI_ISRECOVERABLE(X)         ((X)<<DEM_EVT_BP_PARAM_ISRECOVERABLE)
#define DEM_EVT_BP_PARAM_STOREFAILURETONEXTOC     1u
#define DEM_EVT_PARAMINI_STOREFAILURETONEXTOC(X)  ((X)<<DEM_EVT_BP_PARAM_STOREFAILURETONEXTOC)
#define DEM_EVT_PARAMINI_WARNINGINDICATOR(X)
#define DEM_EVT_BP_PARAM_EVTDEST_PRIMARY          2u
#define DEM_EVT_PARAMINI_EVTDEST_PRIMARY(X)       ((X)<<DEM_EVT_BP_PARAM_EVTDEST_PRIMARY)
#define DEM_EVT_BP_PARAM_EVTDEST_SECONDARY        3u
#define DEM_EVT_PARAMINI_EVTDEST_SECONDARY(X)     ((X)<<DEM_EVT_BP_PARAM_EVTDEST_SECONDARY)
#define DEM_EVT_BP_PARAM_EVTDEST_MIRROR           4u
#define DEM_EVT_PARAMINI_EVTDEST_MIRROR(X)        ((X)<<DEM_EVT_BP_PARAM_EVTDEST_MIRROR)
#define DEM_EVT_BP_PARAM_AGING_ALLOWED            5u
#define DEM_EVT_PARAMINI_AGING_ALLOWED(X)         ((X)<<DEM_EVT_BP_PARAM_AGING_ALLOWED)
#define DEM_EVT_PARAMINI_ISEVENTHAS_GLOBALFDCCALLBACK(X)
#define DEM_EVT_PARAMINI_ISEVENTHAS_DATACHANGEDCALLBACK(X)
#define DEM_EVT_BP_PARAM_SIGNIFICANCE             6u
#define DEM_EVT_PARAMINI_SIGNIFICANCE(X)          ((X)<<DEM_EVT_BP_PARAM_SIGNIFICANCE)
#define DEM_EVT_BP_PARAM_SUPPRESSIONINIT          7u
#define DEM_EVT_PARAMINI_SUPPRESSIONINIT(X)       ((X)<<DEM_EVT_BP_PARAM_SUPPRESSIONINIT)
#define DEM_EVT_BP_PARAM_DEBOUNCEBEHAVIOR         8u
#define DEM_EVT_PARAMINI_DEBOUNCEBEHAVIOR(X)      ((X)<<DEM_EVT_BP_PARAM_DEBOUNCEBEHAVIOR)
#define DEM_EVT_BP_PARAM_OPERATIONCYCLEID         9u
#define DEM_EVT_BP_PARAM_OPERATIONCYCLEID_SIZE    2u
#define DEM_EVT_PARAMINI_OPERATIONCYCLEID(X)      ((X)<<DEM_EVT_BP_PARAM_OPERATIONCYCLEID)
#define DEM_EVT_BP_PARAM_AGINGCYCLEID             11u
#define DEM_EVT_BP_PARAM_AGINGCYCLEID_SIZE        2u
#define DEM_EVT_PARAMINI_AGINGCYCLEID(X)          ((X)<<DEM_EVT_BP_PARAM_AGINGCYCLEID)
#define DEM_EVT_BP_PARAM_FAILURECYCLEID           13u
#define DEM_EVT_BP_PARAM_FAILURECYCLEID_SIZE      2u
#define DEM_EVT_PARAMINI_FAILURECYCLEID(X)        ((X)<<DEM_EVT_BP_PARAM_FAILURECYCLEID)
#define DEM_EVT_PARAMINI_MONITORING_CATEGORY(X)

typedef uint16 Dem_EvtParamType;
#define DEM_EVTPARAM_ISBITSET      rba_DiagLib_Bit16IsBitSet
#define DEM_EVTPARAM_GETBITS       rba_DiagLib_Bit16GetBits

/*                 DEBOUNCE_METHODINDEX                              DEBOUNCE_PARAMSETINDEX                                                          SFB                 AgingThreshold      AgingThresholdForTFSLC        FailureThreshold    Priority            MaxNumOfFF          STORAGECONDITION                                                                ENABLECONDITION                                                                 CALLBACKEVENTSTATUSCHANGED                                                      CALLBACKCLEARALLOWED                                                            ClearAllowedBehavior                                                             */

#define DEM_CFG_EVENTPARAMS \
{ \
 DEM_EVTS_INIT (0,                                                0,                                                                              0,                  0,                  0,                            0,                  0,                  0,                  0,                                                                              0,                                                                              0,                                                                              NULL_PTR,                                                                       NO_STATUS_BYTE_CHANGE                                                           ) \
,DEM_EVTS_INIT (DEM_DEBMETH_IDX_ARCTRBASECLASS,                   DEM_DEBPARAM_IDX_CANSM_E_BUS_OFF_NETWORK_0,                                     0,                  1,                  0,                            1,                  255,                0,                  DEM_STOCO_CANSM_E_BUS_OFF_NETWORK_0,                                            DEM_ENCO_CANSM_E_BUS_OFF_NETWORK_0,                                             0,                                                                              NULL_PTR,                                                                       NO_STATUS_BYTE_CHANGE                                                           ) \
,DEM_EVTS_INIT (DEM_DEBMETH_IDX_ARCTRBASECLASS,                   DEM_DEBPARAM_IDX_EVENT_LOSTCOMM_MPDU,                                           0,                  3,                  0,                            1,                  2,                  2,                  DEM_STOCO_Event_LostComm_MPDU,                                                  DEM_ENCO_Event_LostComm_MPDU,                                                   0,                                                                              NULL_PTR,                                                                       NO_STATUS_BYTE_CHANGE                                                           ) \
,DEM_EVTS_INIT (DEM_DEBMETH_IDX_ARCTRBASECLASS,                   DEM_DEBPARAM_IDX_EVENT_LOSTCOMM_SEN,                                            0,                  40,                 0,                            1,                  1,                  2,                  DEM_STOCO_Event_LostComm_SEN,                                                   DEM_ENCO_Event_LostComm_SEN,                                                    0,                                                                              NULL_PTR,                                                                       NO_STATUS_BYTE_CHANGE                                                           ) \
,DEM_EVTS_INIT (DEM_DEBMETH_IDX_ARCTRBASECLASS,                   DEM_DEBPARAM_IDX_EVENT_LOSTCOMM_SEN_1,                                          0,                  3,                  0,                            1,                  2,                  2,                  DEM_STOCO_Event_LostComm_SEN_1,                                                 DEM_ENCO_Event_LostComm_SEN_1,                                                  0,                                                                              NULL_PTR,                                                                       NO_STATUS_BYTE_CHANGE                                                           ) \
,DEM_EVTS_INIT (DEM_DEBMETH_IDX_ARTIME,                           DEM_DEBPARAM_IDX_EVENT_MCAL_ERROR,                                              0,                  3,                  0,                            1,                  2,                  2,                  DEM_STOCO_Event_MCAL_Error,                                                     DEM_ENCO_Event_MCAL_Error,                                                      0,                                                                              NULL_PTR,                                                                       NO_STATUS_BYTE_CHANGE                                                           ) \
,DEM_EVTS_INIT (DEM_DEBMETH_IDX_ARTIME,                           DEM_DEBPARAM_IDX_EVENT_MCU_ERROR,                                               0,                  3,                  0,                            1,                  2,                  2,                  DEM_STOCO_Event_MCU_Error,                                                      DEM_ENCO_Event_MCU_Error,                                                       0,                                                                              NULL_PTR,                                                                       NO_STATUS_BYTE_CHANGE                                                           ) \
}

/*                 DEBOUNCE_BEHAVIOR                                 RECOVER             DRIVECYCLE          WARNINDIC           CATEGORY                                          EVENT_DEST_PRIM     EVENT_DEST_SEC      EVENT_DEST_MIRR     AgingAllowed        ISEVENTHAS_GLOBALFDCCALLBACK ISEVENTHAS_DATACHANGEDCALLBACK SIGNIFICANCE OPCYCLE                              AGINGCYCLE                                        FAILURECYCLE                                      SUPPRESSED           */

#define DEM_CFG_EVENTPARAMS_FLAGS \
{ \
 DEM_EVTS_INIT_FLAGS (0,                                                NOTREC,             NO_TF_RESET,        0,                  DemConf_DemEventCategory_INVALIDCATEGORY,         0,                  0,                  0,                  0,                  0,                  0,                  0,                  0,                                                0,                                                0,                                                0                   ) \
,DEM_EVTS_INIT_FLAGS (DEM_DEBOUNCE_FREEZE,                              RECOV,              NO_TF_RESET,        0,                  DemConf_DemEventCategory_INVALIDCATEGORY,         0,                  0,                  0,                  0,                  0,                  0,                  0,                  DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    FALSE               ) /* Event_CANSM_E_BUS_OFF_NETWORK_0 */  \
,DEM_EVTS_INIT_FLAGS (DEM_DEBOUNCE_FREEZE,                              RECOV,              NO_TF_RESET,        0,                  DemConf_DemEventCategory_INVALIDCATEGORY,         1,                  0,                  0,                  1,                  0,                  0,                  1,                  DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    FALSE               ) /* Event_Event_LostComm_MPDU */  \
,DEM_EVTS_INIT_FLAGS (DEM_DEBOUNCE_FREEZE,                              RECOV,              NO_TF_RESET,        0,                  DemConf_DemEventCategory_INVALIDCATEGORY,         1,                  0,                  0,                  1,                  0,                  0,                  1,                  DemConf_DemOperationCycle_DEM_OPCY_OBD_DCY,       DemConf_DemOperationCycle_DEM_OPCYC_WARMUP,       DemConf_DemOperationCycle_DEM_OPCY_OBD_DCY,       FALSE               ) /* Event_Event_LostComm_SEN */  \
,DEM_EVTS_INIT_FLAGS (DEM_DEBOUNCE_FREEZE,                              RECOV,              NO_TF_RESET,        0,                  DemConf_DemEventCategory_INVALIDCATEGORY,         1,                  0,                  0,                  1,                  0,                  0,                  1,                  DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    FALSE               ) /* Event_Event_LostComm_SEN_1 */  \
,DEM_EVTS_INIT_FLAGS (DEM_DEBOUNCE_FREEZE,                              RECOV,              NO_TF_RESET,        0,                  DemConf_DemEventCategory_INVALIDCATEGORY,         1,                  0,                  0,                  1,                  0,                  0,                  1,                  DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    FALSE               ) /* Event_Event_MCAL_Error */  \
,DEM_EVTS_INIT_FLAGS (DEM_DEBOUNCE_FREEZE,                              RECOV,              NO_TF_RESET,        0,                  DemConf_DemEventCategory_INVALIDCATEGORY,         1,                  0,                  0,                  1,                  0,                  0,                  1,                  DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    DemConf_DemOperationCycle_DemOperationCycle_0,    FALSE               ) /* Event_Event_MCU_Error */  \
}

#define DEM_CFG_TRIGGERMONITORINITBEFORECLEAROK  FALSE

#define DEM_CFG_CALLBACK_INIT_MON_FOR_EVENT_SUPPORTED   FALSE

#endif

