#ifndef _DEM_H
#define _DEM_H

#include "Std_Types.h"
#include "Dem_Types.h"
//#include "Dem_PBCfg.h"


#define DEM_AR_RELEASE_MAJOR_VERSION   4u
#define DEM_AR_RELEASE_MINOR_VERSION   2u

// This value is defined in the DEM specification.
#ifndef DEM_EVENT_STATUS_PASSED
#define DEM_EVENT_STATUS_PASSED         0x00
#endif

// This value is defined in the DEM specification.
#ifndef DEM_EVENT_STATUS_FAILED
#define DEM_EVENT_STATUS_FAILED         0x01
#endif

// Value was selected as given in DEM SWS.
#ifndef DEM_EVENT_STATUS_PREPASSED
#define DEM_EVENT_STATUS_PREPASSED      0x02
#endif

// Value was selected as given in DEM SWS.
#ifndef DEM_EVENT_STATUS_PREFAILED
#define DEM_EVENT_STATUS_PREFAILED      0x03
#endif


/*Manually added for compilation rpm4kor
#define CANIF_E_STOPPED                6
#define CAN_E_TIMEOUT                  5
#define CANIF_E_NOT_SLEEP              11
#define CANIF_E_INVALID_DLC				9
*/

#define DemConf_DemEventParameter_PDUR_E_INIT_FAILED                 37
#define DemConf_DemEventParameter_PDUR_E_PDU_INSTANCE_LOST           38
#define DemConf_DemEventParameter_COMM_E_NET_START_IND_CHANNEL_0     45
#define DemConf_DemEventParameter_COMM_E_NET_START_IND_CHANNEL_1     46
#define DemConf_DemEventParameter_COMM_E_NET_START_IND_CHANNEL_2	 47
#define DemConf_DemEventParameter_COMM_E_NET_START_IND_CHANNEL_3	 48
#define DemConf_DemEventParameter_COMM_E_NET_START_IND_CHANNEL_4	 49
#define DemConf_DemEventParameter_CANIF_E_STOPPED_0                  50
#define DemConf_DemEventParameter_CANSM_E_BUSOFF_NETWORK_0           51
#define DemConf_DemEventParameter_CANSM_E_BUSOFF_NETWORK_1           52
#define DemConf_DemEventParameter_CANSM_E_BUSOFF_NETWORK_2           53
#define DemConf_DemEventParameter_CANSM_E_BUSOFF_NETWORK_3           54
#define DemConf_DemEventParameter_CANIF_E_INVALID_DLC_0              53
#define DemConf_DemEventParameter_CANIF_E_NOT_SLEEP_0                54
#define DemConf_DemEventParameter_CANIF_E_STOPPED					 55
/** @brief Identifier for DEM error ADC_E_TIMEOUT*/
#define DemConf_DemEventParameter_ADC_E_TIMEOUT   ((Dem_EventIdType) 0x1)

/** @brief Identifier for DEM error ETH_E_ACCESS*/
#define DemConf_DemEventParameter_ETH_E_ACCESS   ((Dem_EventIdType) 0x2)

/** @brief Identifier for DEM error FLS_E_WRITE_FAILED*/
#define DemConf_DemEventParameter_FLS_E_WRITE_FAILED   ((Dem_EventIdType) 0x3)

/** @brief Identifier for DEM error FLS_E_ERASE_FAILED*/
#define DemConf_DemEventParameter_FLS_E_ERASE_FAILED   ((Dem_EventIdType) 0x4)

/** @brief Identifier for DEM error FLS_E_READ_FAILED*/
#define DemConf_DemEventParameter_FLS_E_READ_FAILED   ((Dem_EventIdType) 0x5)

/** @brief Identifier for DEM error FLS_E_COMPARE_FAILED*/
#define DemConf_DemEventParameter_FLS_E_COMPARE_FAILED   ((Dem_EventIdType) 0x6)

/** @brief Identifier for DEM error FLS_E_UNEXPECTED_FLASH_ID*/
#define DemConf_DemEventParameter_FLS_E_UNEXPECTED_FLASH_ID   ((Dem_EventIdType) 0x7)

/** @brief Identifier for DEM error FR_E_ACCESS*/
#define DemConf_DemEventParameter_FR_E_ACCESS   ((Dem_EventIdType) 0x8)

/** @brief Identifier for DEM error LIN_E_TIMEOUT*/
#define DemConf_DemEventParameter_LIN_E_TIMEOUT   ((Dem_EventIdType) 0x9)

/** @brief Identifier for DEM error MCU_E_CLOCK_FAILURE*/
#define DemConf_DemEventParameter_MCU_E_CLOCK_FAILURE   ((Dem_EventIdType) 0xa)

/** @brief Identifier for DEM error MCU_E_LOCK_FAILURE*/
#define DemConf_DemEventParameter_MCU_E_LOCK_FAILURE   ((Dem_EventIdType) 0xb)

/** @brief Identifier for DEM error MCU_E_QUARTZ_FAILURE*/
#define DemConf_DemEventParameter_MCU_E_QUARTZ_FAILURE   ((Dem_EventIdType) 0xc)

/** @brief Identifier for DEM error MCU_E_TIMEOUT_TRANSITION*/
#define DemConf_DemEventParameter_MCU_E_TIMEOUT_TRANSITION   ((Dem_EventIdType) 0xd)

/** @brief Identifier for DEM error PWM_E_UNEXPECTED_IRQ*/
#define DemConf_DemEventParameter_PWM_E_UNEXPECTED_IRQ   ((Dem_EventIdType) 0xe)

/** @brief Identifier for DEM error SPI_E_HARDWARE_ERROR*/
#define DemConf_DemEventParameter_SPI_E_HARDWARE_ERROR   ((Dem_EventIdType) 0xf)

/** @brief Identifier for DEM error WDG_E_MODE_FAILED*/
#define DemConf_DemEventParameter_WDG_E_MODE_FAILED   ((Dem_EventIdType) 0x10)

/** @brief Identifier for DEM error WDG_E_DISABLE_REJECTED*/
#define DemConf_DemEventParameter_WDG_E_DISABLE_REJECTED   ((Dem_EventIdType) 0x11)

/** @brief Identifier for DEM error WDG_E_MISS_TRIGGER*/
#define DemConf_DemEventParameter_WDG_E_MISS_TRIGGER   ((Dem_EventIdType) 0x12)

/** @brief Identifier for DEM error DEM_E_GENERAL_FAILURE*/
#define DemConf_DemEventParameter_DEM_E_GENERAL_FAILURE   ((Dem_EventIdType) 0x13)



#endif /* DEM_H */
