/**
	******************************************************************************
	* @file
	* @author
	* @version
	* @date
	* @brief
	* @function List:
	******************************************************************************
	* @attention
	*
	*
	* <h2><center>&copy; COPYRIGHT 2021 </center></h2>
	******************************************************************************
	* @History:
	* @Author:
	* @Data:
	* @Version:
*/
#include "DEM_Cfg.h"
#include "Dcm_Cfg.h"


const u32 SupportedDTC[TOTAL_DTC_NUM] =
{

	/*0*/   0x911716u,		/*低於9v  500ms*/   //排序見宏  DTC_POWER_LOW_ID
	/*1*/   0x911717u,		/*超過16v  500ms*/
	
	/*2*/   0x9E0107u,		/*上一频道开关卡住*/
	/*3*/   0x9E0207u,		/*蓝牙电话开卡住故障*/
	/*4*/ {0x9E0507u},		/*语音开关卡住故障*/
	/*5*/ {0x9E0607u},		/*全景影像开关卡住故障*/

	/*6*/ {0x9E0807u},		/*下一频道开关卡住故障*/
	/*7*/ {0x9E1907u},		/*静音开关卡住故障*/
	/*8*/ {0x9E1A07u},		/*定制开关卡住故障*/

	/*9*/ {0x9E1C07u},		/*仪表菜单返回开关卡住故障*/

	/*10*/ {0x9E2D07u},		/*巡航开关卡住故障*/
	/*11*/ {0x9E2F07u},		/*速度+开关卡住故障*/

	/*12*/ {0x9E3007u},		/*速度-开关卡住故障*/

	/*13*/ {0x9E3307u},		/*时距减开关卡住故障*/
	/*14*/ {0x9E3407u},		/*时距+开关卡住故障*/
	/*15*/ {0x9E4500u},		/*左菜单卡滞*/
	/*16*/ {0x9E2C02u},		/*左拨片卡滞*/
	/*17*/ {0x9E2C03u},		/*右拨片卡滞*/
	/*18*/ {0x9E3900u},		/*加热丝过流保护*/
	/*19*/ {0x9E4114u},		/*加热丝短路*/
	/*20*/ {0x9E4113u},		/*加热丝断路*/
	/*21*/ {0x9E4214u},		/*NTC短路*/
	/*22*/ {0x9E4213u},		/*NTC断路*/
};

//dtc_drv_cfg_t  第一個參數是消抖時間，第二個參數是在什麼情況下消抖0是failed去抖，第三個參數是否保存在eeprom
const dtc_drv_cfg_t dtc_cfg_tbl[TOTAL_DTC_NUM] =
{

	{0, DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0, DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0, DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0, DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},

	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},

	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},

	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},

	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE},
	{0,DEM_DTC_DEBOUNCE_RST, DTC_STORAGE_TO_EE}
};


#if (DTC_SNAP_SHOT_DATA_ENABLE)   //支持快照的宏
const u8 c_dtc_snap_shot_data_id[TOTAL_DTC_SNAP_SHOT_ID_NUM][2] = {   //TOTAL_DTC_SNAP_SHOT_ID_NUM=3 見吉利矩陣文檔
  //DF00是 ECU POWER VOLTAGE //DF03 是The Odometer Of First Malfunction //DF04是 The Odometer Of last Malfunction
  {0xA5, 0x00}, {0xA5, 0x01}, {0xA5, 0x03},  {0xA5, 0x04}/*, {0xDD, 0x04}, {0xDD, 0x05},{0xDD, 0x06}, */
};

//各快照的內容長度
const u8 c_dtc_snap_shot_data_size[TOTAL_DTC_SNAP_SHOT_ID_NUM] = {
 _SnapShort_size_0, _SnapShort_size_1, _SnapShort_size_2, _SnapShort_size_3
};

#endif


#if (DTC_EXTENDED_DATA_ENABLE)   //支持外部數據---吉利矩陣文檔中，有兩個 01是DTC Occurrence Counter 0-255
					//02是 Self-Healing Counter
const u8 c_dtc_extended_data_id[TOTAL_DTC_EXTENDED_DATA_NUM] = {  //該數組好像沒有用到
  0x01 /*, 0x02, 0x03, 0x04, 0x10,*/
};
#endif
