/*
***********************************************************************************************************************
* 
* 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_DTCID_H
#define DEM_CFG_DTCID_H

#include "Dem_Cfg_EventId.h"

#define DEM_CFG_EVCOMB_DISABLED       1u
#define DEM_CFG_EVCOMB_ONSTORAGE      2u
#define DEM_CFG_EVCOMB_ONRETRIEVAL    3u
#define DEM_CFG_EVCOMB            DEM_CFG_EVCOMB_DISABLED

#define DEM_DTCID_INVALID           0u
#define DEM_DTCID_COUNT             5u
#define DEM_DTCID_ARRAYLENGTH       (DEM_DTCID_COUNT+1u)

#define DemConf_DemDTCClass_DemDTC_LostComm_SEN                      1u
#define DemConf_DemDTCClass_DemDTC_LostComm_MPDU                     2u
#define DemConf_DemDTCClass_DemDTC_LostComm_SEN_1                    3u
#define DemConf_DemDTCClass_DemDTC_MCAL_Error                        4u
#define DemConf_DemDTCClass_DemDTC_MCU_Error                         5u

#define DEM_DTCGROUPID_INVALID           0u
#define DEM_DTCGROUPID_COUNT             1u
#define DEM_DTCGROUPID_ARRAYLENGTH       (DEM_DTCGROUPID_COUNT+1u)

// genInfo: for (EvCombination==OFF) the explicit mapping from dtcid to eventId is necessary, because an event may not be assigned to any DTC
#define  DEM_MAP_EVENTID_DTCID   \
const Dem_DtcIdType Dem_MapEventIdToDtcId[DEM_EVENTID_ARRAYLENGTH] = \
{ \
   DEM_DTCID_INVALID \
   ,DEM_DTCID_INVALID                       /* CANSM_E_BUS_OFF_NETWORK_0 */ \
   ,DemConf_DemDTCClass_DemDTC_LostComm_MPDU  /* Event_LostComm_MPDU */ \
   ,DemConf_DemDTCClass_DemDTC_LostComm_SEN  /* Event_LostComm_SEN */ \
   ,DemConf_DemDTCClass_DemDTC_LostComm_SEN_1  /* Event_LostComm_SEN_1 */ \
   ,DemConf_DemDTCClass_DemDTC_MCAL_Error   /* Event_MCAL_Error */ \
   ,DemConf_DemDTCClass_DemDTC_MCU_Error    /* Event_MCU_Error */ \
};

#define DEM_MAP_DTCGROUPID_DTCID \
{ {0u,0u}\
 ,{DemConf_DemDTCClass_DemDTC_LostComm_SEN , DemConf_DemDTCClass_DemDTC_MCU_Error}	/* DEM_DTC_GROUP_ALL_DTCS */\
}

#if (DEM_CFG_EVCOMB == DEM_CFG_EVCOMB_DISABLED)

#define DEM_MAP_DTCID_EVENTID        \
const Dem_MapDtcIdToEventIdType  Dem_MapDtcIdToEventId[DEM_DTCID_ARRAYLENGTH] = \
{ \
   DEM_EVENTID_INVALID \
   ,DemConf_DemEventParameter_Event_LostComm_SEN /* DemDTC_LostComm_SEN */ \
   ,DemConf_DemEventParameter_Event_LostComm_MPDU /* DemDTC_LostComm_MPDU */ \
   ,DemConf_DemEventParameter_Event_LostComm_SEN_1 /* DemDTC_LostComm_SEN_1 */ \
   ,DemConf_DemEventParameter_Event_MCAL_Error /* DemDTC_MCAL_Error */ \
   ,DemConf_DemEventParameter_Event_MCU_Error /* DemDTC_MCU_Error */ \
};

#else

#define DEM_MAP_DTCID_EVENTID        \
static const  Dem_EventIdType  Dem_MapDtcIdToEventId_DemDTC_LostComm_SEN[] = { \
   DemConf_DemEventParameter_Event_LostComm_SEN \
}; \
 \
 \
static const  Dem_EventIdType  Dem_MapDtcIdToEventId_DemDTC_LostComm_MPDU[] = { \
   DemConf_DemEventParameter_Event_LostComm_MPDU \
}; \
 \
 \
static const  Dem_EventIdType  Dem_MapDtcIdToEventId_DemDTC_LostComm_SEN_1[] = { \
   DemConf_DemEventParameter_Event_LostComm_SEN_1 \
}; \
 \
 \
static const  Dem_EventIdType  Dem_MapDtcIdToEventId_DemDTC_MCAL_Error[] = { \
   DemConf_DemEventParameter_Event_MCAL_Error \
}; \
 \
 \
static const  Dem_EventIdType  Dem_MapDtcIdToEventId_DemDTC_MCU_Error[] = { \
   DemConf_DemEventParameter_Event_MCU_Error \
}; \
 \
 \
 \
const Dem_MapDtcIdToEventIdType  Dem_MapDtcIdToEventId[DEM_DTCID_ARRAYLENGTH] = \
{ \
   { \
      NULL_PTR, \
      0u \
   } \
   ,{ \
      &Dem_MapDtcIdToEventId_DemDTC_LostComm_SEN[0], \
      (uint16)(DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_LostComm_SEN)/DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_LostComm_SEN[0])) \
   } \
   ,{ \
      &Dem_MapDtcIdToEventId_DemDTC_LostComm_MPDU[0], \
      (uint16)(DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_LostComm_MPDU)/DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_LostComm_MPDU[0])) \
   } \
   ,{ \
      &Dem_MapDtcIdToEventId_DemDTC_LostComm_SEN_1[0], \
      (uint16)(DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_LostComm_SEN_1)/DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_LostComm_SEN_1[0])) \
   } \
   ,{ \
      &Dem_MapDtcIdToEventId_DemDTC_MCAL_Error[0], \
      (uint16)(DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_MCAL_Error)/DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_MCAL_Error[0])) \
   } \
   ,{ \
      &Dem_MapDtcIdToEventId_DemDTC_MCU_Error[0], \
      (uint16)(DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_MCU_Error)/DEM_SIZEOF_VAR(Dem_MapDtcIdToEventId_DemDTC_MCU_Error[0])) \
   } \
};

#endif

/*----------------------------------------------------------------------------
 J1939Node <-> DTC Mapping
 ----------------------------------------------------------------------------*/

#endif

