Commit 2ee99087 authored by hu's avatar hu

更换CAN驱动文件,增加工厂模式部分菜单项,修改了ODOBUG

parent c4d9c18b
......@@ -5,6 +5,7 @@
.\Analog_Signals\Analog_Circuits.c
.\Analog_Signals\Analog_Signals.c
.\CAN\RSCAN.c
.\CAN\RSCAN_Table.h
.\Clock\Clock.c
.\Clock\RTC.c
.\Common\debugger.c
......
......@@ -7,19 +7,19 @@ Platform_16Bit
*/
#ifdef Platform_16Bit
#define Millib_uint8_t unsigned char
#define Millib_uint16_t unsigned int
#define Millib_uint32_t unsigned long
#define Millib_uint8_t unsigned char
#define Millib_uint16_t unsigned int
#define Millib_uint32_t unsigned long
#else
#define Millib_uint8_t unsigned char
#define Millib_uint16_t unsigned short
#define Millib_uint32_t unsigned int
#define Millib_uint64_t unsigned long long
#define Millib_uint8_t unsigned char
#define Millib_uint16_t unsigned short
#define Millib_uint32_t unsigned int
#define Millib_uint64_t unsigned long long
#endif
#ifndef Millib_NULL
#define Millib_NULL (void *)0u
#define Millib_NULL (void *)0u
#endif /* NULL */
typedef enum
......@@ -54,25 +54,25 @@ typedef struct
Millib_uint16_t (*Get_Act_V_Speed)(void);
Millib_uint16_t (*Get_TireSize)(void);
EEPromWrite EEPromWrite_Cbk;
}Mileage_Func_t;
} Mileage_Func_t;
typedef struct
{
Millib_uint32_t Mileage;
}Mileage_Init_t;
} Mileage_Init_t;
typedef struct
{
Millib_uint32_t Stamp;
Millib_uint32_t Offset;
}ODO_Init_t;
} ODO_Init_t;
typedef struct
{
Millib_uint32_t Stamp;
Millib_uint32_t MaxValue;
Millib_uint8_t IsRestart;
}Trip_Init_t;
} Trip_Init_t;
#define Data_MEM_Block_Mileage ((Millib_uint8_t)12u)
#define Data_MEM_Block_ODO ((Millib_uint8_t)12u)
......@@ -85,7 +85,7 @@ void Data_Mileage_KL30_Init(Millib_uint8_t *pMemSpace, Mileage_Init_t *pInitData
void Data_Mileage_Wakeup_Init(Millib_uint8_t *pMemSpace, Mileage_Func_t *pFunc);
void Data_Mileage_ISR(void);
Millib_uint32_t Data_Mileage_Read(void);
Millib_uint8_t Data_Mileage_Write(Millib_uint32_t NewMileage);
Millib_uint8_t Data_Mileage_Write(Millib_uint32_t NewMileage);/*在初始化之后用 0.1KM*/
void Data_Mileage_Clear(void);
void Data_Mileage_Write_EEPROM(void);
......
......@@ -29,7 +29,7 @@ static void Data_User_EEPROM_Write(Data_EEPROM_Enum_t BlockID, uint32_t u32Data[
******************************************************************************/
void Data_User_Mileage_KL30Init(void)
{
uint32_t TempBuf[7] = {0};
uint32_t TempBuf[EM_TRIP_MAX + 3] = {0};
Mileage_Init_t MileInit = {0};
Mileage_Func_t Func = {0};
ODO_Init_t ODOInit = {0};
......@@ -50,7 +50,7 @@ void Data_User_Mileage_KL30Init(void)
ODOInit.Offset = TempBuf[2];
Data_ODO_KL30_Init(DataODOBuf, &ODOInit, Func.EEPromWrite_Cbk);
Data_User_EEPROM_Read(EEPROM_BLOCK_TRIP_STAMP, TempBuf + 3, 9);
Data_User_EEPROM_Read(EEPROM_BLOCK_TRIP_STAMP, TempBuf + 3, EM_TRIP_MAX);
TripInit[EM_TRIP_A].Stamp = TempBuf[3];
TripInit[EM_TRIP_A].MaxValue = 9999999u;
......
......@@ -218,7 +218,7 @@ void Test_LED_AllLight(void)
/*---------------------------------------------------------------------------*/
#define XXXX 0u
#define LED_BRIGHTNESS 0xff
#define LED_BRIGHTNESS 0x3Fu
/******************************************************************************
T1 INTER DIFF LOCK
......
......@@ -1153,7 +1153,7 @@ void Popup_Alone_Sound_Server(void)
{
if (u8IG_st == COMMON_POWER_ON)
{
#if 0
/*00 忘拔钥匙*/
Sound_Delete(SND_Key_Notremoved);
......@@ -1422,19 +1422,19 @@ void Popup_Alone_Sound_Server(void)
{
Sound_Delete(SND_Fuel_Saving);
}
#endif
/*音源测试程序*/
// if(Sound_test&0x001) Sound_Request (SND_Key_Notremoved, 1); else Sound_Delete(SND_Key_Notremoved );
// if(Sound_test&0x002) Sound_Request (SND_Braking, 1); else Sound_Delete(SND_Braking );
// if(Sound_test&0x004) Sound_Request (SND_Air_Brake, 1); else Sound_Delete(SND_Air_Brake );
// if(Sound_test&0x008) Sound_Request (SND_BRAKE_LOCK, 1); else Sound_Delete(SND_BRAKE_LOCK );
// if(Sound_test&0x010) Sound_Request (SND_Parking_Brake, 1); else Sound_Delete(SND_Parking_Brake );
// if(Sound_test&0x020) Sound_Request (SND_Car_Dump_SPEED, 1); else Sound_Delete(SND_Car_Dump_SPEED );
// if(Sound_test&0x040) Sound_Request (SND_Temp_High, 1); else Sound_Delete(SND_Temp_High );
// if(Sound_test&0x080) Sound_Request (SND_Coolant_Low, 1); else Sound_Delete(SND_Coolant_Low );
// if(Sound_test&0x100) Sound_Request (SND_Oil_pressure_Low, 1); else Sound_Delete(SND_Oil_pressure_Low );
// if(Sound_test&0x200) Sound_Request (SND_ACC_AIR, 1); else Sound_Delete(SND_ACC_AIR );
// if(Sound_test&0x400) Sound_Request (SND_BackUP_SPEED, 1); else Sound_Delete(SND_BackUP_SPEED );
if (Sound_test & 0x001) Sound_Request (SND_Key_Notremoved, 1); else Sound_Delete(SND_Key_Notremoved );
if (Sound_test & 0x002) Sound_Request (SND_Braking, 1); else Sound_Delete(SND_Braking );
if (Sound_test & 0x004) Sound_Request (SND_Air_Brake, 1); else Sound_Delete(SND_Air_Brake );
if (Sound_test & 0x008) Sound_Request (SND_BRAKE_LOCK, 1); else Sound_Delete(SND_BRAKE_LOCK );
if (Sound_test & 0x010) Sound_Request (SND_Parking_Brake, 1); else Sound_Delete(SND_Parking_Brake );
if (Sound_test & 0x020) Sound_Request (SND_Car_Dump_SPEED, 1); else Sound_Delete(SND_Car_Dump_SPEED );
if (Sound_test & 0x040) Sound_Request (SND_Temp_High, 1); else Sound_Delete(SND_Temp_High );
if (Sound_test & 0x080) Sound_Request (SND_Coolant_Low, 1); else Sound_Delete(SND_Coolant_Low );
if (Sound_test & 0x100) Sound_Request (SND_Oil_pressure_Low, 1); else Sound_Delete(SND_Oil_pressure_Low );
if (Sound_test & 0x200) Sound_Request (SND_ACC_AIR, 1); else Sound_Delete(SND_ACC_AIR );
if (Sound_test & 0x400) Sound_Request (SND_BackUP_SPEED, 1); else Sound_Delete(SND_BackUP_SPEED );
}
else /*IG-OFF*/
{
......
......@@ -54,68 +54,90 @@ typedef enum
_MN_DSP_LEVEL2_4_MENU_1, /* 26 设定日期*/
_MN_DSP_LEVEL2_4_MENU_2, /* 27 设定时间*/
_MN_DSP_LEVEL2_4_MENU_7, /* 亮度调节*/
_MN_DSP_LEVEL2_4_MENU_3, /* 28 语言设定*/
_MN_DSP_LEVEL2_4_MENU_4, /* 29 设定节油驾驶建议*/
_MN_DSP_LEVEL2_4_MENU_5, /* 30 TPMS轮胎设定*/
_MN_DSP_LEVEL2_4_MENU_6, /* 31 显示设定*/
_MN_DSP_LEVEL2_4_MENU_7, /* 28 亮度调节*/
_MN_DSP_LEVEL2_4_MENU_3, /* 29 语言设定*/
_MN_DSP_LEVEL2_4_MENU_4, /* 30 设定节油驾驶建议*/
_MN_DSP_LEVEL2_4_MENU_5, /* 31 TPMS轮胎设定*/
_MN_DSP_LEVEL2_4_MENU_6, /* 32 显示设定*/
_MN_DSP_LEVEL2_5_MENU_1, /* 32 LDWS 警报演示*/
_MN_DSP_LEVEL2_5_MENU_2, /* 33 AEBS第1警报演示*/
_MN_DSP_LEVEL2_5_MENU_3, /* 34 AEBS第2警报演示*/
_MN_DSP_LEVEL2_5_MENU_4, /* 35 AEBS全力制动警报演示*/
_MN_DSP_LEVEL2_5_MENU_1, /* 33 LDWS 警报演示*/
_MN_DSP_LEVEL2_5_MENU_2, /* 34 AEBS第1警报演示*/
_MN_DSP_LEVEL2_5_MENU_3, /* 35 AEBS第2警报演示*/
_MN_DSP_LEVEL2_5_MENU_4, /* 36 AEBS全力制动警报演示*/
_MN_DSP_LEVEL2_6_MENU_1, /* 36 轮胎气压*/
_MN_DSP_LEVEL2_6_MENU_2, /* 37 轮胎温度*/
_MN_DSP_LEVEL2_6_MENU_1, /* 37 轮胎气压*/
_MN_DSP_LEVEL2_6_MENU_2, /* 38 轮胎温度*/
/*三级菜单*/
_MN_DSP_LEVEL3_2_MENU_1, /* 38 发动机机油&滤清器*/
_MN_DSP_LEVEL3_2_MENU_2, /* 39 燃油滤清器*/
_MN_DSP_LEVEL3_2_MENU_3, /* 40 变速箱油*/
_MN_DSP_LEVEL3_2_MENU_4, /* 41 差速器油*/
_MN_DSP_LEVEL3_2_MENU_7, /* 42 动力转向液*/
_MN_DSP_LEVEL3_2_MENU_8, /* 43 轮胎*/
_MN_DSP_LEVEL3_3_MENU_1, /* 44 更换机油&机油滤清器*/
_MN_DSP_LEVEL3_3_MENU_2, /* 45 更换燃油滤清器*/
_MN_DSP_LEVEL3_3_MENU_3, /* 46 更换变速箱油*/
_MN_DSP_LEVEL3_3_MENU_4, /* 47 更换差速器油*/
_MN_DSP_LEVEL3_3_MENU_6, /* 48 更换动力转向液*/
_MN_DSP_LEVEL3_3_MENU_7, /* 49 轮胎换位・更换*/
_MN_DSP_LEVEL3_4_MENU_11, /* 50 设定日期-年*/
_MN_DSP_LEVEL3_4_MENU_12, /* 51 设定日期-月*/
_MN_DSP_LEVEL3_4_MENU_13, /* 52 设定日期-日*/
_MN_DSP_LEVEL3_4_MENU_21, /* 53 设定时间-时*/
_MN_DSP_LEVEL3_4_MENU_22, /* 54 设定时间-分*/
_MN_DSP_LEVEL3_4_MENU_3, /* 55 设定语言*/
_MN_DSP_LEVEL3_4_MENU_41, /* 56 速度设定-高速路*/
_MN_DSP_LEVEL3_4_MENU_42, /* 57 速度设定-一般路*/
_MN_DSP_LEVEL3_4_MENU_43, /* 58 发动机转速设定*/
_MN_DSP_LEVEL3_4_MENU_44, /* 59 急加速设定*/
_MN_DSP_LEVEL3_4_MENU_45, /* 60 急减速设定*/
_MN_DSP_LEVEL3_4_MENU_46, /* 61 长时间怠速设定*/
_MN_DSP_LEVEL3_4_MENU_47, /* 62 辅助驻车解除设定*/
_MN_DSP_LEVEL3_4_MENU_5, /* 63 轮胎匹配画面*/
_MN_DSP_LEVEL3_7_MENU_1, /* 亮度调节*/
_MN_DSP_LEVEL3_2_MENU_1, /* 39 发动机机油&滤清器*/
_MN_DSP_LEVEL3_2_MENU_2, /* 40 燃油滤清器*/
_MN_DSP_LEVEL3_2_MENU_3, /* 41 变速箱油*/
_MN_DSP_LEVEL3_2_MENU_4, /* 42 差速器油*/
_MN_DSP_LEVEL3_2_MENU_7, /* 43 动力转向液*/
_MN_DSP_LEVEL3_2_MENU_8, /* 44 轮胎*/
_MN_DSP_LEVEL3_3_MENU_1, /* 45 更换机油&机油滤清器*/
_MN_DSP_LEVEL3_3_MENU_2, /* 46 更换燃油滤清器*/
_MN_DSP_LEVEL3_3_MENU_3, /* 47 更换变速箱油*/
_MN_DSP_LEVEL3_3_MENU_4, /* 48 更换差速器油*/
_MN_DSP_LEVEL3_3_MENU_6, /* 49 更换动力转向液*/
_MN_DSP_LEVEL3_3_MENU_7, /* 50 轮胎换位・更换*/
_MN_DSP_LEVEL3_4_MENU_11, /* 51 设定日期-年*/
_MN_DSP_LEVEL3_4_MENU_12, /* 52 设定日期-月*/
_MN_DSP_LEVEL3_4_MENU_13, /* 53 设定日期-日*/
_MN_DSP_LEVEL3_4_MENU_21, /* 54 设定时间-时*/
_MN_DSP_LEVEL3_4_MENU_22, /* 55 设定时间-分*/
_MN_DSP_LEVEL3_4_MENU_3, /* 56 设定语言*/
_MN_DSP_LEVEL3_4_MENU_41, /* 57 速度设定-高速路*/
_MN_DSP_LEVEL3_4_MENU_42, /* 58 速度设定-一般路*/
_MN_DSP_LEVEL3_4_MENU_43, /* 59 发动机转速设定*/
_MN_DSP_LEVEL3_4_MENU_44, /* 60 急加速设定*/
_MN_DSP_LEVEL3_4_MENU_45, /* 61 急减速设定*/
_MN_DSP_LEVEL3_4_MENU_46, /* 62 长时间怠速设定*/
_MN_DSP_LEVEL3_4_MENU_47, /* 63 辅助驻车解除设定*/
_MN_DSP_LEVEL3_4_MENU_5, /* 64 轮胎匹配画面*/
_MN_DSP_LEVEL3_7_MENU_1, /* 65 亮度调节*/
/*四级菜单*/
_MN_DSP_LEVEL4_4_MENU_1, /* 64 速度设定-高速路*/
_MN_DSP_LEVEL4_4_MENU_2, /* 65 速度设定-一般路*/
_MN_DSP_LEVEL4_4_MENU_3, /* 66 发动机转速设定*/
_MN_DSP_LEVEL4_4_MENU_4, /* 67 急加速设定*/
_MN_DSP_LEVEL4_4_MENU_5, /* 68 急减速设定*/
_MN_DSP_LEVEL4_4_MENU_6, /* 69 长时间怠速设定*/
_MN_DSP_LEVEL4_4_MENU_7, /* 70 辅助驻车解除设定*/
_MN_DSP_LEVEL4_4_MENU_1, /* 66 速度设定-高速路*/
_MN_DSP_LEVEL4_4_MENU_2, /* 67 速度设定-一般路*/
_MN_DSP_LEVEL4_4_MENU_3, /* 68 发动机转速设定*/
_MN_DSP_LEVEL4_4_MENU_4, /* 69 急加速设定*/
_MN_DSP_LEVEL4_4_MENU_5, /* 70 急减速设定*/
_MN_DSP_LEVEL4_4_MENU_6, /* 71 长时间怠速设定*/
_MN_DSP_LEVEL4_4_MENU_7, /* 72 辅助驻车解除设定*/
/*特殊界面*/
_MN_DSP_ENTER_MENU, /* 71 确认*/
_MN_DSP_RETURN_MENU, /* 72 返回*/
_MN_DSP_LEVEL3_5_MENU_1, /* 73 LDWS 警报演示*/
_MN_DSP_LEVEL3_5_MENU_2, /* 74 AEBS第1警报演示*/
_MN_DSP_LEVEL3_5_MENU_3, /* 75 AEBS第2警报演示*/
_MN_DSP_LEVEL3_5_MENU_4, /* 76 AEBS全力制动警报演示*/
_MN_DSP_ENTER_MENU, /* 73 确认*/
_MN_DSP_RETURN_MENU, /* 74 返回*/
_MN_DSP_LEVEL3_5_MENU_1, /* 75 LDWS 警报演示*/
_MN_DSP_LEVEL3_5_MENU_2, /* 76 AEBS第1警报演示*/
_MN_DSP_LEVEL3_5_MENU_3, /* 77 AEBS第2警报演示*/
_MN_DSP_LEVEL3_5_MENU_4, /* 78 AEBS全力制动警报演示*/
/*工厂模式*/
_FAC_DSP_LEVEL1MENU_1, /* 79 DTC显示*/
_FAC_DSP_LEVEL1MENU_2, /* 80 DTC清除*/
_FAC_DSP_LEVEL1MENU_3, /* 81 仪表设定显示*/
_FAC_DSP_LEVEL1MENU_4, /* 82 暂时通常模式*/
_FAC_DSP_LEVEL1MENU_5, /* 83 结束工厂模式*/
_FAC_DSP_LEVEL1MENU_6, /* 84 HID自动水平初始化*/
_FAC_DSP_LEVEL1_1MENU_1, /* 85 发动机故障*/
_FAC_DSP_LEVEL1_1MENU_2, /* 86 SCR系统故障*/
_FAC_DSP_LEVEL1_1MENU_3, /* 87 EBS/ABS故障*/
_FAC_DSP_LEVEL1_1MENU_4, /* 88 仪表故障*/
_FAC_DSP_LEVEL1_2MENU_1, /* 89 清除所有DTC*/
_FAC_DSP_LEVEL1_2MENU_2, /* 90 清除所有DTC*/
_FAC_DSP_LEVEL1_3MENU_1, /* 91 L0-7 H2-A*/
_FAC_DSP_LEVEL1_3MENU_2, /* 92 L8-F H2-A*/
/*经销商模式*/
//_DIS_
} _MenuCode;
......
......@@ -56,68 +56,87 @@ const _MenuOptTab MenuOptTab[] =
/*26*/{ _MN_DSP_LEVEL3_4_MENU_11, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_2, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_1Enter, Level2_4Menu_1Do, Level2_4Menu_1Exit},
/*27*/{ _MN_DSP_LEVEL3_4_MENU_21, _MN_DSP_LEVEL2_4_MENU_1, _MN_DSP_LEVEL2_4_MENU_7, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_2Enter, Level2_4Menu_2Do, Level2_4Menu_2Exit},
/* */{ _MN_DSP_LEVEL3_7_MENU_1, _MN_DSP_LEVEL2_4_MENU_2, _MN_DSP_LEVEL2_4_MENU_3, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_7Enter, Level2_4Menu_7Do, Level2_4Menu_7Exit},
/*28*/{ _MN_DSP_LEVEL3_4_MENU_3, _MN_DSP_LEVEL2_4_MENU_7, _MN_DSP_LEVEL2_4_MENU_4, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_3Enter, Level2_4Menu_3Do, Level2_4Menu_3Exit},
/*29*/{ _MN_DSP_LEVEL3_4_MENU_41, _MN_DSP_LEVEL2_4_MENU_3, _MN_DSP_LEVEL2_4_MENU_5, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_4Enter, Level2_4Menu_4Do, Level2_4Menu_4Exit},
/*30*/{ _MN_DSP_LEVEL3_4_MENU_5, _MN_DSP_LEVEL2_4_MENU_4, _MN_DSP_LEVEL2_4_MENU_6, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_5Enter, Level2_4Menu_5Do, Level2_4Menu_5Exit},
/*31*/{ _MN_IDX_NULL , _MN_DSP_LEVEL2_4_MENU_5, _MN_IDX_NULL, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_6Enter, Level2_4Menu_6Do, Level2_4Menu_6Exit},
/*28*/{ _MN_DSP_LEVEL3_7_MENU_1, _MN_DSP_LEVEL2_4_MENU_2, _MN_DSP_LEVEL2_4_MENU_3, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_7Enter, Level2_4Menu_7Do, Level2_4Menu_7Exit},
/*29*/{ _MN_DSP_LEVEL3_4_MENU_3, _MN_DSP_LEVEL2_4_MENU_7, _MN_DSP_LEVEL2_4_MENU_4, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_3Enter, Level2_4Menu_3Do, Level2_4Menu_3Exit},
/*30*/{ _MN_DSP_LEVEL3_4_MENU_41, _MN_DSP_LEVEL2_4_MENU_3, _MN_DSP_LEVEL2_4_MENU_5, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_4Enter, Level2_4Menu_4Do, Level2_4Menu_4Exit},
/*31*/{ _MN_DSP_LEVEL3_4_MENU_5, _MN_DSP_LEVEL2_4_MENU_4, _MN_DSP_LEVEL2_4_MENU_6, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_5Enter, Level2_4Menu_5Do, Level2_4Menu_5Exit},
/*32*/{ _MN_IDX_NULL , _MN_DSP_LEVEL2_4_MENU_5, _MN_IDX_NULL, _MN_DSP_LEVEL2MENU_4, Level2_4Menu_6Enter, Level2_4Menu_6Do, Level2_4Menu_6Exit},
/*32*/{ _MN_DSP_LEVEL3_5_MENU_1, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_2, _MN_DSP_LEVEL2MENU_5, Level2_5Menu_1Enter, Level2_5Menu_1Do, Level2_5Menu_1Exit},
/*33*/{ _MN_DSP_LEVEL3_5_MENU_2, _MN_DSP_LEVEL2_5_MENU_1, _MN_DSP_LEVEL2_5_MENU_3, _MN_DSP_LEVEL2MENU_5, Level2_5Menu_2Enter, Level2_5Menu_2Do, Level2_5Menu_2Exit},
/*34*/{ _MN_DSP_LEVEL3_5_MENU_3, _MN_DSP_LEVEL2_5_MENU_2, _MN_DSP_LEVEL2_5_MENU_4, _MN_DSP_LEVEL2MENU_5, Level2_5Menu_3Enter, Level2_5Menu_3Do, Level2_5Menu_3Exit},
/*35*/{ _MN_DSP_LEVEL3_5_MENU_4, _MN_DSP_LEVEL2_5_MENU_3, _MN_IDX_NULL, _MN_DSP_LEVEL2MENU_5, Level2_5Menu_4Enter, Level2_5Menu_4Do, Level2_5Menu_4Exit},
/*33*/{ _MN_DSP_LEVEL3_5_MENU_1, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_2, _MN_DSP_LEVEL2MENU_5, Level2_5Menu_1Enter, Level2_5Menu_1Do, Level2_5Menu_1Exit},
/*34*/{ _MN_DSP_LEVEL3_5_MENU_2, _MN_DSP_LEVEL2_5_MENU_1, _MN_DSP_LEVEL2_5_MENU_3, _MN_DSP_LEVEL2MENU_5, Level2_5Menu_2Enter, Level2_5Menu_2Do, Level2_5Menu_2Exit},
/*35*/{ _MN_DSP_LEVEL3_5_MENU_3, _MN_DSP_LEVEL2_5_MENU_2, _MN_DSP_LEVEL2_5_MENU_4, _MN_DSP_LEVEL2MENU_5, Level2_5Menu_3Enter, Level2_5Menu_3Do, Level2_5Menu_3Exit},
/*36*/{ _MN_DSP_LEVEL3_5_MENU_4, _MN_DSP_LEVEL2_5_MENU_3, _MN_IDX_NULL, _MN_DSP_LEVEL2MENU_5, Level2_5Menu_4Enter, Level2_5Menu_4Do, Level2_5Menu_4Exit},
/*36*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_6_MENU_2, _MN_DSP_LEVEL2MENU_6, Level2_6Menu_1Enter, Level2_6Menu_1Do, Level2_6Menu_1Exit},
/*37*/{ _MN_IDX_NULL, _MN_DSP_LEVEL2_6_MENU_1, _MN_IDX_NULL, _MN_DSP_LEVEL2MENU_6, Level2_6Menu_2Enter, Level2_6Menu_2Do, Level2_6Menu_2Exit},
/*37*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_6_MENU_2, _MN_DSP_LEVEL2MENU_6, Level2_6Menu_1Enter, Level2_6Menu_1Do, Level2_6Menu_1Exit},
/*38*/{ _MN_IDX_NULL, _MN_DSP_LEVEL2_6_MENU_1, _MN_IDX_NULL, _MN_DSP_LEVEL2MENU_6, Level2_6Menu_2Enter, Level2_6Menu_2Do, Level2_6Menu_2Exit},
/*三级菜单*/
/*38*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_1, Level3_2Menu_1Enter, Level3_2Menu_1Do, Level3_2Menu_1Exit},
/*39*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_2, Level3_2Menu_2Enter, Level3_2Menu_2Do, Level3_2Menu_2Exit},
/*40*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_3, Level3_2Menu_3Enter, Level3_2Menu_3Do, Level3_2Menu_3Exit},
/*41*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_4, Level3_2Menu_4Enter, Level3_2Menu_4Do, Level3_2Menu_4Exit},
/*42*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_7, Level3_2Menu_7Enter, Level3_2Menu_7Do, Level3_2Menu_7Exit},
/*43*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_8, Level3_2Menu_8Enter, Level3_2Menu_8Do, Level3_2Menu_8Exit},
/*44*/{ _MN_DSP_LEVEL2_3_MENU_1, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_1, Level3_3Menu_1Enter, Level3_3Menu_1Do, Level3_3Menu_1Exit},
/*45*/{ _MN_DSP_LEVEL2_3_MENU_2, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_2, Level3_3Menu_2Enter, Level3_3Menu_2Do, Level3_3Menu_2Exit},
/*46*/{ _MN_DSP_LEVEL2_3_MENU_3, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_3, Level3_3Menu_3Enter, Level3_3Menu_3Do, Level3_3Menu_3Exit},
/*47*/{ _MN_DSP_LEVEL2_3_MENU_4, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_4, Level3_3Menu_4Enter, Level3_3Menu_4Do, Level3_3Menu_4Exit},
/*48*/{ _MN_DSP_LEVEL2_3_MENU_6, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_6, Level3_3Menu_6Enter, Level3_3Menu_6Do, Level3_3Menu_6Exit},
/*49*/{ _MN_DSP_LEVEL2_3_MENU_7, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_7, Level3_3Menu_7Enter, Level3_3Menu_7Do, Level3_3Menu_7Exit},
/*50*/{ _MN_DSP_LEVEL3_4_MENU_12, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_1, Level3_4Menu_1Enter_1, Level3_4Menu_1Do_1, Level3_4Menu_1Exit_1},
/*51*/{ _MN_DSP_LEVEL3_4_MENU_13, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_1, Level3_4Menu_1Enter_2, Level3_4Menu_1Do_2, Level3_4Menu_1Exit_2},
/*52*/{ _MN_DSP_LEVEL2_4_MENU_1, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_1, Level3_4Menu_1Enter_3, Level3_4Menu_1Do_3, Level3_4Menu_1Exit_3},
/*53*/{ _MN_DSP_LEVEL3_4_MENU_22, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_2, Level3_4Menu_2Enter_1, Level3_4Menu_2Do_1, Level3_4Menu_2Exit_1},
/*54*/{ _MN_DSP_LEVEL2_4_MENU_2, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_2, Level3_4Menu_2Enter_2, Level3_4Menu_2Do_2, Level3_4Menu_2Exit_2},
/*55*/{ _MN_DSP_LEVEL2_4_MENU_3, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_3, Level3_4Menu_3Enter, Level3_4Menu_3Do, Level3_4Menu_3Exit},
/*56*/{ _MN_DSP_LEVEL4_4_MENU_1, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_42, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_1, Level3_4Menu_4Do_1, Level3_4Menu_4Exit_1},
/*57*/{ _MN_DSP_LEVEL4_4_MENU_2, _MN_DSP_LEVEL3_4_MENU_41, _MN_DSP_LEVEL3_4_MENU_43, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_2, Level3_4Menu_4Do_2, Level3_4Menu_4Exit_2},
/*58*/{ _MN_DSP_LEVEL4_4_MENU_3, _MN_DSP_LEVEL3_4_MENU_42, _MN_DSP_LEVEL3_4_MENU_44, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_3, Level3_4Menu_4Do_3, Level3_4Menu_4Exit_3},
/*59*/{ _MN_DSP_LEVEL4_4_MENU_4, _MN_DSP_LEVEL3_4_MENU_43, _MN_DSP_LEVEL3_4_MENU_45, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_4, Level3_4Menu_4Do_4, Level3_4Menu_4Exit_4},
/*60*/{ _MN_DSP_LEVEL4_4_MENU_5, _MN_DSP_LEVEL3_4_MENU_44, _MN_DSP_LEVEL3_4_MENU_46, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_5, Level3_4Menu_4Do_5, Level3_4Menu_4Exit_5},
/*61*/{ _MN_DSP_LEVEL4_4_MENU_6, _MN_DSP_LEVEL3_4_MENU_45, _MN_DSP_LEVEL3_4_MENU_47, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_6, Level3_4Menu_4Do_6, Level3_4Menu_4Exit_6},
/*62*/{ _MN_DSP_LEVEL4_4_MENU_7, _MN_DSP_LEVEL3_4_MENU_46, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_7, Level3_4Menu_4Do_7, Level3_4Menu_4Exit_7},
/*63*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_5, Level3_4Menu_5Enter, Level3_4Menu_5Do, Level3_4Menu_5Exit},
/* */{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_7, Level3_4Menu_7Enter, Level3_4Menu_7Do, Level3_4Menu_7Exit},
/*39*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_1, Level3_2Menu_1Enter, Level3_2Menu_1Do, Level3_2Menu_1Exit},
/*40*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_2, Level3_2Menu_2Enter, Level3_2Menu_2Do, Level3_2Menu_2Exit},
/*41*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_3, Level3_2Menu_3Enter, Level3_2Menu_3Do, Level3_2Menu_3Exit},
/*42*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_4, Level3_2Menu_4Enter, Level3_2Menu_4Do, Level3_2Menu_4Exit},
/*43*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_7, Level3_2Menu_7Enter, Level3_2Menu_7Do, Level3_2Menu_7Exit},
/*44*/{_MN_DSP_ENTER_MENU, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_2_MENU_8, Level3_2Menu_8Enter, Level3_2Menu_8Do, Level3_2Menu_8Exit},
/*45*/{ _MN_DSP_LEVEL2_3_MENU_1, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_1, Level3_3Menu_1Enter, Level3_3Menu_1Do, Level3_3Menu_1Exit},
/*46*/{ _MN_DSP_LEVEL2_3_MENU_2, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_2, Level3_3Menu_2Enter, Level3_3Menu_2Do, Level3_3Menu_2Exit},
/*47*/{ _MN_DSP_LEVEL2_3_MENU_3, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_3, Level3_3Menu_3Enter, Level3_3Menu_3Do, Level3_3Menu_3Exit},
/*48*/{ _MN_DSP_LEVEL2_3_MENU_4, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_4, Level3_3Menu_4Enter, Level3_3Menu_4Do, Level3_3Menu_4Exit},
/*49*/{ _MN_DSP_LEVEL2_3_MENU_6, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_6, Level3_3Menu_6Enter, Level3_3Menu_6Do, Level3_3Menu_6Exit},
/*50*/{ _MN_DSP_LEVEL2_3_MENU_7, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_3_MENU_7, Level3_3Menu_7Enter, Level3_3Menu_7Do, Level3_3Menu_7Exit},
/*51*/{ _MN_DSP_LEVEL3_4_MENU_12, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_1, Level3_4Menu_1Enter_1, Level3_4Menu_1Do_1, Level3_4Menu_1Exit_1},
/*52*/{ _MN_DSP_LEVEL3_4_MENU_13, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_1, Level3_4Menu_1Enter_2, Level3_4Menu_1Do_2, Level3_4Menu_1Exit_2},
/*53*/{ _MN_DSP_LEVEL2_4_MENU_1, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_1, Level3_4Menu_1Enter_3, Level3_4Menu_1Do_3, Level3_4Menu_1Exit_3},
/*54*/{ _MN_DSP_LEVEL3_4_MENU_22, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_2, Level3_4Menu_2Enter_1, Level3_4Menu_2Do_1, Level3_4Menu_2Exit_1},
/*55*/{ _MN_DSP_LEVEL2_4_MENU_2, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_2, Level3_4Menu_2Enter_2, Level3_4Menu_2Do_2, Level3_4Menu_2Exit_2},
/*56*/{ _MN_DSP_LEVEL2_4_MENU_3, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_3, Level3_4Menu_3Enter, Level3_4Menu_3Do, Level3_4Menu_3Exit},
/*57*/{ _MN_DSP_LEVEL4_4_MENU_1, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_42, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_1, Level3_4Menu_4Do_1, Level3_4Menu_4Exit_1},
/*58*/{ _MN_DSP_LEVEL4_4_MENU_2, _MN_DSP_LEVEL3_4_MENU_41, _MN_DSP_LEVEL3_4_MENU_43, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_2, Level3_4Menu_4Do_2, Level3_4Menu_4Exit_2},
/*59*/{ _MN_DSP_LEVEL4_4_MENU_3, _MN_DSP_LEVEL3_4_MENU_42, _MN_DSP_LEVEL3_4_MENU_44, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_3, Level3_4Menu_4Do_3, Level3_4Menu_4Exit_3},
/*60*/{ _MN_DSP_LEVEL4_4_MENU_4, _MN_DSP_LEVEL3_4_MENU_43, _MN_DSP_LEVEL3_4_MENU_45, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_4, Level3_4Menu_4Do_4, Level3_4Menu_4Exit_4},
/*61*/{ _MN_DSP_LEVEL4_4_MENU_5, _MN_DSP_LEVEL3_4_MENU_44, _MN_DSP_LEVEL3_4_MENU_46, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_5, Level3_4Menu_4Do_5, Level3_4Menu_4Exit_5},
/*62*/{ _MN_DSP_LEVEL4_4_MENU_6, _MN_DSP_LEVEL3_4_MENU_45, _MN_DSP_LEVEL3_4_MENU_47, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_6, Level3_4Menu_4Do_6, Level3_4Menu_4Exit_6},
/*63*/{ _MN_DSP_LEVEL4_4_MENU_7, _MN_DSP_LEVEL3_4_MENU_46, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_4, Level3_4Menu_4Enter_7, Level3_4Menu_4Do_7, Level3_4Menu_4Exit_7},
/*64*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_5, Level3_4Menu_5Enter, Level3_4Menu_5Do, Level3_4Menu_5Exit},
/*65*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_4_MENU_7, Level3_4Menu_7Enter, Level3_4Menu_7Do, Level3_4Menu_7Exit},
/*四级菜单*/
/*64*/{ _MN_DSP_LEVEL3_4_MENU_41, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_41, Level4_4Menu_1Enter, Level4_4Menu_1Do, Level4_4Menu_1Exit},
/*65*/{ _MN_DSP_LEVEL3_4_MENU_42, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_42, Level4_4Menu_2Enter, Level4_4Menu_2Do, Level4_4Menu_2Exit},
/*66*/{ _MN_DSP_LEVEL3_4_MENU_43, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_43, Level4_4Menu_3Enter, Level4_4Menu_3Do, Level4_4Menu_3Exit},
/*67*/{ _MN_DSP_LEVEL3_4_MENU_44, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_44, Level4_4Menu_4Enter, Level4_4Menu_4Do, Level4_4Menu_4Exit},
/*68*/{ _MN_DSP_LEVEL3_4_MENU_45, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_45, Level4_4Menu_5Enter, Level4_4Menu_5Do, Level4_4Menu_5Exit},
/*69*/{ _MN_DSP_LEVEL3_4_MENU_46, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_46, Level4_4Menu_6Enter, Level4_4Menu_6Do, Level4_4Menu_6Exit},
/*70*/{ _MN_DSP_LEVEL3_4_MENU_47, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_47, Level4_4Menu_7Enter, Level4_4Menu_7Do, Level4_4Menu_7Exit},
/*71*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, Level_Enter_Menu_Enter, Level_Enter_Menu_Do, Level_Enter_Menu_Exit},
/*72*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, Level_Return_Menu_Enter, Level_Return_Menu_Do, Level_Return_Menu_Exit},
/*73*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_1, Level3_5Menu_1Enter, Level3_5Menu_1Do, Level3_5Menu_1Exit},
/*74*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_2, Level3_5Menu_2Enter, Level3_5Menu_2Do, Level3_5Menu_2Exit},
/*75*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_3, Level3_5Menu_3Enter, Level3_5Menu_3Do, Level3_5Menu_3Exit},
/*76*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_4, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*66*/{ _MN_DSP_LEVEL3_4_MENU_41, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_41, Level4_4Menu_1Enter, Level4_4Menu_1Do, Level4_4Menu_1Exit},
/*67*/{ _MN_DSP_LEVEL3_4_MENU_42, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_42, Level4_4Menu_2Enter, Level4_4Menu_2Do, Level4_4Menu_2Exit},
/*68*/{ _MN_DSP_LEVEL3_4_MENU_43, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_43, Level4_4Menu_3Enter, Level4_4Menu_3Do, Level4_4Menu_3Exit},
/*69*/{ _MN_DSP_LEVEL3_4_MENU_44, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_44, Level4_4Menu_4Enter, Level4_4Menu_4Do, Level4_4Menu_4Exit},
/*70*/{ _MN_DSP_LEVEL3_4_MENU_45, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_45, Level4_4Menu_5Enter, Level4_4Menu_5Do, Level4_4Menu_5Exit},
/*71*/{ _MN_DSP_LEVEL3_4_MENU_46, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_46, Level4_4Menu_6Enter, Level4_4Menu_6Do, Level4_4Menu_6Exit},
/*72*/{ _MN_DSP_LEVEL3_4_MENU_47, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL3_4_MENU_47, Level4_4Menu_7Enter, Level4_4Menu_7Do, Level4_4Menu_7Exit},
/*73*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, Level_Enter_Menu_Enter, Level_Enter_Menu_Do, Level_Enter_Menu_Exit},
/*74*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, Level_Return_Menu_Enter, Level_Return_Menu_Do, Level_Return_Menu_Exit},
/*75*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_1, Level3_5Menu_1Enter, Level3_5Menu_1Do, Level3_5Menu_1Exit},
/*76*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_2, Level3_5Menu_2Enter, Level3_5Menu_2Do, Level3_5Menu_2Exit},
/*77*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_3, Level3_5Menu_3Enter, Level3_5Menu_3Do, Level3_5Menu_3Exit},
/*78*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _MN_DSP_LEVEL2_5_MENU_4, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*工厂模式*/
/*79*/{ _FAC_DSP_LEVEL1_1MENU_1, _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_2, _MN_IDX_NULL, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*80*/{ _FAC_DSP_LEVEL1MENU_2, _FAC_DSP_LEVEL1MENU_1, _FAC_DSP_LEVEL1MENU_3, _MN_IDX_NULL, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*81*/{ _FAC_DSP_LEVEL1_3MENU_1, _FAC_DSP_LEVEL1MENU_2, _FAC_DSP_LEVEL1MENU_4, _MN_IDX_NULL, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*82*/{ _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_3, _FAC_DSP_LEVEL1MENU_5, _MN_IDX_NULL, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*83*/{ _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_4, _FAC_DSP_LEVEL1MENU_6, _MN_IDX_NULL, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*84*/{ _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_5, _MN_IDX_NULL, _MN_IDX_NULL, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*85*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_1, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*86*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_1, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*87*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_1, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*88*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_1, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*89*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_2, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*90*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_2, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*91*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_3, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
/*92*/{ _MN_IDX_NULL, _MN_IDX_NULL, _MN_IDX_NULL, _FAC_DSP_LEVEL1MENU_3, Level3_5Menu_4Enter, Level3_5Menu_4Do, Level3_5Menu_4Exit},
};
void NextMenu(_MENU_IDX idx)
......
#include "RSCAN_Table.h"
#if 0
const canfd_filter_type RX_RULE_TABLE_LIST[33] = {
/* CAN 0 reception rules */
{0x000002E5ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x0000064Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x0000028Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000313ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000314ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000315ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000234ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x0000045Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000245ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000291ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000323ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000326ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000455ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x000003D2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000328ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000329ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x000003B8ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x000003BBul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x000003ACul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x000003A6ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x000004A8ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000123ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000238ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000318ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000145ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000225ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000231ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000469ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x0000046Bul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000680ul, 0xDFFFFF80UL, 0x00000000ul, 0x00000200ul},
{0x000007DFul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x0000046Ful, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x00000743ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
};
#endif
const canfd_filter_type RX_RULE_TABLE_LIST[RX_RULE_SIZE] = {
/* CAN 0 reception rules */
{0x84FF021Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8C010305ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CF00203ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CF00300ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CF00400ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CF02FA0ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CFE5A2Ful, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CFE6CEEul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CFF0F27ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CFF50F3ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CFF61F5ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x8CFF7A02ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x90FE6F2Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x90FF94DDul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x90FFDDF2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x90FFF4F2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x98CCAAEBul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x98F00000ul, 0xDFF00000UL, 0x00000000ul, 0x00000200ul},
{0x9CFE8100ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x9CFEAF00ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x9CFFEAF2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x9CFFFEF2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x98DA17FAul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
{0x98DBFFFAul, 0xDFFFFFFFUL, 0x00000000ul, 0x00000200ul},
#if 0
{0x98DA17FAul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98DBFFFAul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFC825ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFC325ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF3625ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF3325ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF3525ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x9CFFEAF2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x9CFFFEF2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x90FFF4F2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFF6F2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x90FFDDF2ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF02E7ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFDA21ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFDC21ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFDB21ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF1C7Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF14E8ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF9B3Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF9A19ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FD7E16ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFF752ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CFE5A2Ful, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CF00300ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98F00010ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8C010305ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FD9503ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CF00203ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98F00503ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CF00400ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF0800ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98F0000Ful, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x9CFEAF00ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFFF00ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x9CFE8100ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FD7C00ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98F0010Bul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FDC40Bul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x90FE6F2Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CF02FA0ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CFF0F27ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF9727ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FD0700ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFD09Eul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF9625ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF2227ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF107Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF1500ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF2A27ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF2B27ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF2C27ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF43F0ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CFF50F3ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF51F3ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF52F3ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CFF61F5ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF62F5ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF63F5ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CFF7A02ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF9F02ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF88DEul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF75F7ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x90FF94DDul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF9CE0ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF8503ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFB970ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFB971ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFD916ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFD462ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFDE16ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF9627ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98F533A9ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x84FF021Aul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FF8238ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FFCEA4ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98CCAAEBul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x8CFE6CEEul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEE6EEul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEF3FDul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEF433ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEF533ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FE5B33ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FE4EECul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEEA2Ful, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEF100ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FE4F0Bul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FE4A03ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEF803ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEE400ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEEE00ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEE500ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEE900ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEF200ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEF121ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEBF0Bul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FEF500ul, 0xDFFFFFFFUL, 0x00000000ul, 0x00020000ul},
{0x98FECA00ul, 0xDFFFFF00UL, 0x00000000ul, 0x00020000ul},
{0x98FFE000ul, 0xDFFFF000UL, 0x00000000ul, 0x00020000ul},
#endif
};
\ No newline at end of file
#ifndef RSCAN_TABLE_H
#define RSCAN_TABLE_H
#include "r_typedefs.h"
/* structure */
typedef struct {
uint32_t data[4];
}canfd_filter_type;
#define RX_RULE_SIZE 24U
extern const canfd_filter_type RX_RULE_TABLE_LIST[RX_RULE_SIZE] ;
#endif
......@@ -44,7 +44,8 @@ Includes <System Includes> , �gProject Includes�h
#include "CAN_Lib.h"
//#include "CAN_Signal_Tx.h"
#include "DoCAN_ISO15765.h"
#include "UDS_Common.h"
#include "RSCAN_Table.h"
#include <stdio.h>
/******************************************************************************
......@@ -61,6 +62,8 @@ Imported global variables and functions (from other files)
//#define RSCAN0_CH2_EXT
//#define RSCAN0_CH2_STD
void RSCAN_Global_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum);
#if defined RSCAN0_CH0_EXT
#define RSCAN0_CH0_IDE (1U)
#else
......@@ -91,13 +94,15 @@ Macro definitions
(reg) = (value); \
} while ((pstatus) == 1u)
CAN0_Data_Ind_Func pfCAN0DataIndCb;
CAN1_Data_Ind_Func pfCAN1DataIndCb;
CAN2_Data_Ind_Func pfCAN2DataIndCb;
CAN_Data_Ind_Func pfCAN0DataIndCb;
CAN_Data_Ind_Func pfCAN1DataIndCb;
CAN_Data_Ind_Func pfCAN2DataIndCb;
CAN_Data_Confirm_Func pfCAN0DataConfirmCb;
CAN_Data_Confirm_Func pfCAN1DataConfirmCb;
CAN_Data_Confirm_Func pfCAN2DataConfirmCb;
void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum)
{
uint8_t i, j;
uint32_t i, j;
uint8_t FilterNum;
uint8_t FilterPageNum;
......@@ -111,12 +116,14 @@ void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum)
uint8_t CH1_IDFilterNum = 0U;
uint8_t CH2_IDFilterNum = 0U;
CANFD_Filter_Cfg_st_t *pFilterCfg;
CANFD_ID_Filter_st_t *pIDFilter;
volatile CANFD_ID_Filter_st_t *pIDFilter;
pfCAN0DataIndCb = pFilterInit->pfCAN0DataIndCb;
pfCAN1DataIndCb = pFilterInit->pfCAN1DataIndCb;
pfCAN2DataIndCb = pFilterInit->pfCAN2DataIndCb;
pfCAN0DataConfirmCb = pFilterInit->pfCAN0DataConfirmCb;
pfCAN1DataConfirmCb = pFilterInit->pfCAN1DataConfirmCb;
pfCAN2DataConfirmCb = pFilterInit->pfCAN2DataConfirmCb;
/* Waiting for C_ISO_CAN to set. */
protected_write(SYSPROTCMDD1, SYSPROTSD1, SYSCKSC_IRSCAND_CTL, 0x00000003); //PLLFIXCLK /60 PLLFIXCLK = PLL1CLK PLL1CLK=480 MHz 480/6=8M 为什么设置 目前不知道 徐瑞
......@@ -138,7 +145,9 @@ void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum)
{
}
#ifdef RSCAN0_CH0
if (pFilterInit->CH0_Enable == 1u)
{
CH0_IDFilterNum = (uint8_t)(IDFilterNum & 0xFFU);
/* Waiting for CAN0 entry channel reset mdoe */
RSCAN0C0CTR &= ~CAN_CSLPR_MASK; /* CSLPR=0 , CAN_CSLPR_MASK = 0x4UL */
......@@ -146,237 +155,95 @@ void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum)
{
}
/* Set Channel Control register */
RSCAN0C0CTR |= 0x00400000UL; // BUSOFF end occur recover by user
RSCAN0C0CTR |= 0x00400000UL;
/* Set Channel Configuration register */
RSCAN0C0CFG = 0x023A0000UL; /* 500K 75%*/
//RSCAN0C0CFG = 0x023A0001UL; /* 250K 75%*/
#endif
/* Set Global Configuration register */
RSCAN0GCFG = 0x00000018UL; /* CAN Clock Source Select */
/* Set receive rule */
RSCAN0GAFLCFG0 |= (uint32_t)(CH0_IDFilterNum << 24U); /* Channel0 Filter num */
RSCAN0GAFLCFG0 |= (uint32_t)(CH1_IDFilterNum << 16U); /* Channel1 Filter num */
RSCAN0GAFLCFG0 |= (uint32_t)(CH2_IDFilterNum << 8U); /* Channel2 Filter num */
RSCAN0GAFLECTR &= 0U; /* Configuration Page0 */
RSCAN0GAFLECTR |= CAN_AFLDAE_ON; /* Enable receive rule */
/*12个 page 每个page 16个rule*/
FilterNum = 0U;
FilterPageNum = 0U;
#ifdef RSCAN0_CH0
/* Step 1 : Configure standard ID filters(Nsg) */
pFilterCfg = &(pFilterInit->Msg0StdFilter);
MsgFilterNum = pFilterCfg->IDNum;
if ((MsgFilterNum % 16U) > 0U)
{
MsgFilterPageNum = (MsgFilterNum / 16U) + 1U;
RSCAN0C0CFG = 0x023A0000UL;
}
else if ((MsgFilterNum % 16U) == 0U)
if (pFilterInit->CH1_Enable == 1u)
{
MsgFilterPageNum = MsgFilterNum / 16U;
}
MsgFilterCycle = 16U;
for (j = 0U; j < MsgFilterPageNum; j++)
CH1_IDFilterNum = (uint8_t)((IDFilterNum >> 8U) & 0xFFU);
/* Waiting for CAN1 entry channel reset mdoe */
RSCAN0C1CTR &= ~CAN_CSLPR_MASK; /* CSLPR=0 , CAN_CSLPR_MASK = 0x4UL */
while ((RSCAN0C1STS & CAN_CSLPSTS_ON) != 0UL)
{
if (FilterNum == 0U)
{
RSCAN0GAFLECTR &= 0x100UL;
RSCAN0GAFLECTR |= FilterPageNum; /* Configuration Page N */
}
if ((pFilterCfg->CfgType == CANFD_FILTER_ID_LIST) && (pFilterCfg->pIDs != NULL))
{
for (i = 0U; i < MsgFilterCycle; i++)
{
pIDFilter = (CANFD_ID_Filter_st_t *)((uint32_t *)(CANFD_CH0_MSG_RAM_ADDR + (0x0010U * FilterNum)));
pIDFilter->F0_f.GAFLID = pFilterCfg->pIDs[i + j * 16U];
pIDFilter->F0_f.GAFLLB = 0U;
pIDFilter->F0_f.GAFLRTR = 0U;
pIDFilter->F0_f.GAFLIDE = RSCAN0_CH0_IDE;
pIDFilter->F1_f.GAFLIDM = 0x1FFFFFFFUL; //所有位都比较
pIDFilter->F1_f.GAFLRTRM = 1U;
pIDFilter->F1_f.GAFLIDEM = 1U;
pIDFilter->F2_f.GAFLRMDP = 0U;
pIDFilter->F2_f.GAFLRMV = 0U;
pIDFilter->F2_f.GAFLPTR = 0U;
pIDFilter->F2_f.GAFLDLC = 0U;
pIDFilter->F3_f.GAFLFDP1 = 0U;
pIDFilter->F3_f.GAFLFDP2 = 0x02U;
FilterNum++;
if (FilterNum >= 16U)
{
FilterNum = 0U;
FilterPageNum++;
}
MsgFilterNum--;
if (MsgFilterNum == 0U)
{
break;
}
}
}
}
/* Step 2 : Configure own standard ID filters(Diag) */
Ext_FilterNum = 0U;
pFilterCfg = &(pFilterInit->Diag0StdFilter);
MsgFilterNum = pFilterCfg->IDNum;
if (FilterNum == 0U)
{
if ((MsgFilterNum % 16U) > 0U)
{
MsgFilterPageNum = (MsgFilterNum / 16U) + 1U;
}
else if ((MsgFilterNum % 16U) == 0U)
{
MsgFilterPageNum = MsgFilterNum / 16U;
}
MsgFilterCycle = 16U;
}
else if (FilterNum != 0U)
{
Ext_FilterNum = 16U - FilterNum;
if (MsgFilterNum > Ext_FilterNum)
{
MsgFilterNum = MsgFilterNum - Ext_FilterNum;
if ((MsgFilterNum % 16U) > 0U)
{
MsgFilterPageNum = (MsgFilterNum / 16U) + 2U;
}
else if ((MsgFilterNum % 16U) == 0U)
{
MsgFilterPageNum = MsgFilterNum / 16U + 1U;
}
MsgFilterCycle = Ext_FilterNum;
}
else
{
MsgFilterNum = MsgFilterNum;
MsgFilterPageNum = 1U;
MsgFilterCycle = MsgFilterNum;
}
}
for (j = 0U; j < MsgFilterPageNum; j++)
{
if (FilterNum == 0U)
{
RSCAN0GAFLECTR &= 0x100UL;
RSCAN0GAFLECTR |= FilterPageNum;
}
if (j > 0U)
{
// Ext_FilterNum = 0U;
MsgFilterCycle = 16U;
/* Set Channel Control register */
RSCAN0C1CTR |= 0x00401800UL;
/* Set Channel Configuration register */
RSCAN0C1CFG = 0x023A0000UL;
}
if ((pFilterCfg->CfgType == CANFD_FILTER_ID_LIST) && (pFilterCfg->pIDs != NULL))
if (pFilterInit->CH2_Enable == 1u)
{
for (i = 0U; i < MsgFilterCycle; i++)
CH2_IDFilterNum = (uint8_t)((IDFilterNum >> 16U) & 0xFFU);
/* Waiting for CAN1 entry channel reset mdoe */
RSCAN0C2CTR &= ~CAN_CSLPR_MASK; /* CSLPR=0 , CAN_CSLPR_MASK = 0x4UL */
while ((RSCAN0C2STS & CAN_CSLPSTS_ON) != 0UL)
{
pIDFilter = (CANFD_ID_Filter_st_t *)((uint32 *)(CANFD_CH0_MSG_RAM_ADDR + (0x0010U * FilterNum)));
if ((j > 0U) && (Ext_FilterNum != 0U))
{
pIDFilter->F0_f.GAFLID = pFilterCfg->pIDs[i + (j - 1U) * 16U + Ext_FilterNum];
}
else
{
pIDFilter->F0_f.GAFLID = pFilterCfg->pIDs[i + j * 16U];
/* Set Channel Control register */
RSCAN0C2CTR |= 0x00401800UL;
/* Set Channel Configuration register */
RSCAN0C2CFG = 0x023A0000UL;
}
/* Set Global Configuration register */
RSCAN0GCFG = 0x00000010UL; /* CAN Clock Source Select */
pIDFilter->F0_f.GAFLLB = 1U;
pIDFilter->F0_f.GAFLRTR = 0U;
pIDFilter->F0_f.GAFLIDE = RSCAN0_CH0_IDE;
pIDFilter->F1_f.GAFLIDM = 0x1FFFFFFFUL;
pIDFilter->F1_f.GAFLRTRM = 1U;
pIDFilter->F1_f.GAFLIDEM = 1U;
/* Set receive rule */
RSCAN0GAFLCFG0 |= (uint32_t)(CH0_IDFilterNum << 24U); /* Channel0 Filter num */
RSCAN0GAFLCFG0 |= (uint32_t)(CH1_IDFilterNum << 16U); /* Channel1 Filter num */
RSCAN0GAFLCFG0 |= (uint32_t)(CH2_IDFilterNum << 8U); /* Channel2 Filter num */
pIDFilter->F2_f.GAFLRMDP = 0U;
pIDFilter->F2_f.GAFLRMV = 0U;
pIDFilter->F2_f.GAFLPTR = 0U;
pIDFilter->F2_f.GAFLDLC = 0U;
RSCAN0GAFLECTR &= 0U; /* Configuration Page0 */
RSCAN0GAFLECTR |= CAN_AFLDAE_ON; /* Enable receive rule */
pIDFilter->F3_f.GAFLFDP1 = 0U;
pIDFilter->F3_f.GAFLFDP2 = 0x02U;
RSCAN0GAFLECTR &= 0x100UL;
RSCAN0GAFLECTR |= 0; /* Configuration Page N */
FilterNum++;
if (FilterNum >= 16U)
{
FilterNum = 0U;
FilterPageNum++;
}
// pIDFilter = (volatile canfd_filter_type *)(( uint32_t * )(CANFD_CH0_MSG_RAM_ADDR));
pIDFilter = (CANFD_ID_Filter_st_t *)((uint32_t *)(CANFD_CH0_MSG_RAM_ADDR));
if (MsgFilterCycle == 16U)
for (i = 0u; i < RX_RULE_SIZE; i++)
{
MsgFilterNum--;
}
if (MsgFilterNum == 0U)
j = (uint8_t)(i & 0x0000000FUL);
if (j == 0ul)
{
break;
RSCAN0GAFLECTR |= (i >> 4u);
}
pIDFilter[j].F0_f.Msg = RX_RULE_TABLE_LIST[i].data[0];
pIDFilter[j].F1_f.Msg = RX_RULE_TABLE_LIST[i].data[1];
pIDFilter[j].F2_f.Msg = RX_RULE_TABLE_LIST[i].data[2];
pIDFilter[j].F3_f.Msg = RX_RULE_TABLE_LIST[i].data[3];
}
}
}
/* Step 3 : Configure range standard ID filters(NM) */
if (FilterNum == 0U)
{
RSCAN0GAFLECTR &= 0x100UL;
RSCAN0GAFLECTR |= FilterPageNum; /* Configuration Page N */
}
pFilterCfg = &(pFilterInit->NM0StdFilter);
if ((pFilterCfg->CfgType == CANFD_FILTER_ID_RANGE) && (pFilterCfg->pIDs != NULL))
{
for (i = 0U; i < pFilterCfg->IDNum; i++)
{
pIDFilter = (CANFD_ID_Filter_st_t *)((uint32_t *)(CANFD_CH0_MSG_RAM_ADDR + (0x0010U * FilterNum)));
pIDFilter->F0_f.GAFLID = pFilterCfg->pIDs[i * 2U + 1U];
pIDFilter->F0_f.GAFLLB = 0U;
pIDFilter->F0_f.GAFLRTR = 0U;
pIDFilter->F0_f.GAFLIDE = RSCAN0_CH0_IDE;
pIDFilter->F1_f.GAFLIDM = 0x1FFFFF80UL;
pIDFilter->F1_f.GAFLRTRM = 1U;
pIDFilter->F1_f.GAFLIDEM = 1U;
pIDFilter->F2_f.GAFLRMDP = 0U;
pIDFilter->F2_f.GAFLRMV = 0U;
pIDFilter->F2_f.GAFLPTR = 0U;
pIDFilter->F2_f.GAFLDLC = 0U;
pIDFilter->F3_f.GAFLFDP1 = 0U;
pIDFilter->F3_f.GAFLFDP2 = 0x02U;
FilterNum++;
if (FilterNum >= 16U)
j = i % 16;
if (j > 0)
{
FilterNum = 0U;
FilterPageNum++;
}
j = i / 16u + 1u;
RSCAN0GAFLECTR |= j;
}
}
#endif
RSCAN0GAFLECTR &= ~CAN_AFLDAE_ON; /* Disable receive rule */
//每个通道有16个 发送buffer
#ifdef RSCAN0_CH0
//每个通道有16个 发送buffer
/* Set transmit Buffer configuration */
RSCAN0TMC0 |= 0x05U; /* enable Txbuffer0 abort function */
RSCAN0TMC1 |= 0x05U; /* enable Txbuffer1 abort function */
RSCAN0TMIEC0 |= 0x00000003UL; /* enable Txbuffer0.1 interrup num */
RSCAN0TMC0 = 0x00u;
RSCAN0TMC1 = 0x00u;
RSCAN0TMC2 = 0x00u;
RSCAN0TMC3 = 0x00u;
RSCAN0TMC4 = 0x00u;
RSCAN0TMC5 = 0x00u;
RSCAN0TMC6 = 0x00u;
RSCAN0TMC7 = 0x00u;
RSCAN0TMC8 = 0x00u;
RSCAN0TMC9 = 0x00u;
RSCAN0TMC10 = 0x00u;
RSCAN0TMC11 = 0x00u;
RSCAN0TMC12 = 0x00u;
RSCAN0TMC13 = 0x00u;
RSCAN0TMC14 = 0x00u;
RSCAN0TMC15 = 0x00u;
RSCAN0TMIEC0 |= 0x0000FFFFUL; /* enable Txbuffer0-15 interrup num */
/* Set transmint/receive buffer configuration(Tx) */
/* Set transmint/receive buffer configuration(Tx) */
RSCAN0CFCC0 &= ~CAN_CFE_MASK; /* clear CFE first */
while ((RSCAN0CFCC0 & CAN_CFE_MASK) != 0UL)
......@@ -388,14 +255,13 @@ void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum)
while ((RSCAN0CFCC1 & CAN_CFE_MASK) != 0UL)
{
} /* Waiting for CFE cleared */
RSCAN0CFCC1 |= 0x000C1402UL;
RSCAN0CFCC1 |= 0x000C1502UL;
/* Set interrupt configuration */
PBGFSGD0BPROT0 = 0x07FFFFFFUL; /* must-operate , page384 */
INTC2EIC70 = 0x0047UL; /* channel0-2 RX FIFO interrupt */
//INTC2EIC71 = 0x0047UL; /* error interrupt */
INTC2EIC72 = 0x0047UL; /* rx interrupt */
INTC2EIC73 = 0x0047UL; /* tx interrupt */
#endif
/* Set Receive_Buffer Number */
RSCAN0RMNB = 0U;
......@@ -411,7 +277,6 @@ void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum)
} /* While reset mode */
}
#ifdef RSCAN0_CH0
if (RSCAN0C0STS & 0x03UL) /* If Channel0 in halt or reset mode */
{
RSCAN0C0CTR &= 0xFFFFFFFCUL; /* Switch to communication mode */
......@@ -422,10 +287,9 @@ void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum)
{
} /* While reset mode */
}
/* transmint/receive buffer Enable */
RSCAN0CFCC0 |= CAN_CFE_ON; /* CFE Enable transmint/receive buffer Enable��Modify the bit only in channel halt/communication mode */
RSCAN0CFCC1 |= CAN_CFE_ON; /* CFE Enable transmint/receive buffer Enable��Modify the bit only in channel halt/communication mode */
#endif
}
/******************************************************************************
......@@ -839,7 +703,8 @@ uint8_t CAN0_Receive_FIFO1(void)
CAN_Set_ERROR_OverMaxLen,
CAN_Set_ERROR_MsgFull,
******************************************************************************/
CAN_SetState CAN_CH0_Data_Request(uint32_t Identifier, uint8_t MsgStd, uint8_t MsgRTR, uint8_t DLC, uint8_t *Data)
#if 1
CAN_SetState CAN_CH0_Data_Request( uint32_t Identifier, uint8_t MsgStd, uint8_t MsgRTR, uint8_t DLC, uint8_t *Data )
{
uint8_t i;
uint32_t Word;
......@@ -905,6 +770,7 @@ CAN_SetState CAN_CH0_Data_Request(uint32_t Identifier, uint8_t MsgStd, uint8_t M
return CAN_Set_ERROR_MsgFull;
}
}
#endif
/******************************************************************************
* Function Name : Get_CAN0_Status
* Description : Get_CAN0_Status_Register
......@@ -964,6 +830,12 @@ void CAN0_Global_To_StopMode(void)
RSCAN0GCTR |= 0x00000001UL; /* first goto ResetMode */
RSCAN0GCTR |= 0x00000004UL; /* next goto StopMode */
}
void CAN0_Global_To_NORMAL(void)
{
RSCAN0GCTR &= 0xFFFFFFF8UL;
RSCAN0GCTR &= ~CAN_GSLPR_MASK; /* GSLPR=0 , CAN_GSLPR_MASK = 0x4UL */
RSCAN0GCTR = 0x00000000UL; /* first goto ResetMode */
}
/******************************************************************************
* Function Name : CANFD_SetTX_Abort
* Description : Set CANFD_SetTX_Abort
......@@ -976,55 +848,6 @@ void CANFD_SetTX_Abort(void)
RSCAN0TMC1 |= 0X02U; /* transmit Buffer1 abort */
}
uint8_t Get_CH0_BusOffStatus(void)
{
uint32_t ret;
ret = RSCAN0C0ERFL;
if (ret & 0x00000008UL)
{
return 1;
}
else
{
return 0;
}
}
uint8_t Get_CH0_RecStatus(void)
{
uint32_t ret;
ret = RSCAN0C0STS;
if (ret & 0x40UL)
{
return 1;
}
else
{
return 0;
}
}
void CH0_BusOff_Recovery(void)
{
uint8_t ret;
ret = Get_CH0_BusOffStatus();
if (ret == 1U)
{
RSCAN0C0ERFL &= 0xFFFFFFF7UL;
CAN0_Channel0_To_CommunicationMode();
}
}
uint8_t Get_CH0_ErrPassiveStatus(void)
{
uint32_t ret;
ret = RSCAN0C0STS;
if (ret & 0x00000008UL)
{
return 1;
}
else
{
return 0;
}
}
void RSCan0_CH0_Write(CAN_Msg_t *Msg)
{
CAN_CH0_Data_Request(Msg->MsgID, Msg->MsgStd, Msg->MsgRTR, Msg->MsgDLC, Msg->Msg);
......@@ -1165,9 +988,165 @@ void RSCAN0_CH1_Rx_ISR(void)
void RSCAN0_CH1_Tx_ISR(void)
{
}
void RSCAN0_CH2_Tx_ISR(void)
{
}
void RSCAN_Global_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum)
{
uint32_t i;
/* select can clock source 8M */
/* Waiting for C_ISO_CAN to set. */
protected_write(SYSPROTCMDD1, SYSPROTSD1, SYSCKSC_IRSCAND_CTL, 0x00000003); // PLLFIXCLK /60 PLLFIXCLK = PLL1CLK PLL1CLK=480 MHz 480/6=8M 为什么设置 目前不知道 徐瑞
while (SYSCKSC_IRSCAND_ACT != 0x3UL)
{
}
/* Waiting for C_ISO_IRSCANXIN to set. */
protected_write(SYSPROTCMDD1, SYSPROTSD1, SYSCKSC_IRSCANXINS_CTL, 0x00000001); // MainOsc 8M
while (SYSCKSC_IRSCANXINS_ACT != 0x1UL)
{
}
/* Waiting for CAN RAM initialization is completed */
while ((RSCAN0GSTS & CAN_GRAMINIT_ON) != 0UL)
{
} //复位之后 由mcu自动设置成0
/* channel mode form stop to reset */
RSCAN0GCTR &= ~CAN_GSLPR_MASK; /* GSLPR=0 , CAN_GSLPR_MASK = 0x4UL */
while ((RSCAN0GSTS & CAN_GSLPSTS_ON) != 0UL)
{
}
/*
after chip reset default mode :reset mode
config bus off mode :
10b: Entry to channel halt mode automatically at bus-off end
*/
RSCAN0C0CTR |= 0x00400000UL;
/*
Set Global Configuration register
1.CAN Clock Source Select to clk xincan
2.Enable Mirror Function
3.disable dlc check
4. transmit priority : ID
*/
RSCAN0GCFG = 0x00000018UL;
/*
Set Channel Configuration register
config btr 500k/s
*/
RSCAN0C0CFG = 0x023A0000UL;
/*-------------------BEGIN--setting receive rule----------------------------*/
/*-------------------END----setting receive rule----------------------------*/
/*
Set Receive_Buffer Number
receive buffer =48
*/
RSCAN0RMNB = 0x00000030UL;
/*
Set Receive_FIFO Number
FIFO 8Msg enable interrupt
*/
RSCAN0RFCC0 &= ~CAN_RFE_MASK;
while ((RSCAN0RFCC0 & CAN_RFE_MASK) != 0UL)
{
} /* Waiting for CFE cleared */
RSCAN0RFCC0 = 0x00001203UL;
/* Set transmit Buffer configuration */
RSCAN0TMC0 = 0x00u;
RSCAN0TMC1 = 0x00u;
RSCAN0TMC2 = 0x00u;
RSCAN0TMC3 = 0x00u;
RSCAN0TMC4 = 0x00u;
RSCAN0TMC5 = 0x00u;
RSCAN0TMC6 = 0x00u;
RSCAN0TMC7 = 0x00u;
RSCAN0TMC8 = 0x00u;
RSCAN0TMC9 = 0x00u;
RSCAN0TMC10 = 0x00u;
RSCAN0TMC11 = 0x00u;
RSCAN0TMC12 = 0x00u;
RSCAN0TMC13 = 0x00u;
RSCAN0TMC14 = 0x00u;
RSCAN0TMC15 = 0x00u;
RSCAN0TMIEC0 |= 0x000000FFUL; /* enable Txbuffer0-15 interrup num */
}
uint8_t Rscan_TEC_Counter(void)
{
uint8_t Ret = 0u;
Ret = (uint8_t)((RSCAN0C0STS >> 24u) & 0x000000ffu);
}
uint8_t Rscan_REC_Counter(void)
{
uint8_t Ret = 0u;
Ret = (uint8_t)((RSCAN0C0STS >> 16u) & 0x000000ffu);
}
uint8_t Get_CH0_BusOffStatus(void)
{
uint32_t ret;
ret = RSCAN0C0ERFL;
if (ret & 0x00000008UL)
{
return 1;
}
else
{
return 0;
}
}
/******************************************************************************
* Function Name     : Get_CH0_RecStatus
* Description       : Get_CH0_RecStatus
* Argument          : None
* Return Value      : 1 or 0
******************************************************************************/
uint8_t Get_CH0_RecStatus(void)
{
uint32_t ret;
ret = RSCAN0C0STS;
if (ret & 0x40UL)
{
return 1;
}
else
{
return 0;
}
}
/******************************************************************************
* Function Name     : CH0_BusOff_Recovery
* Description       : CH0_BusOff_Recovery
* Argument          : None
* Return Value      : None
******************************************************************************/
void CH0_BusOff_Recovery(void)
{
uint8_t ret;
ret = Get_CH0_BusOffStatus();
if (ret == 1U)
{
RSCAN0C0ERFL &= 0xFFFFFFF7UL;
CAN0_Channel0_To_CommunicationMode();
}
}
uint8_t Get_CH0_ErrPassiveStatus(void)
{
uint32_t ret;
ret = RSCAN0C0STS;
if (ret & 0x00000008UL)
{
return 1;
}
else
{
return 0;
}
}
......@@ -118,11 +118,9 @@ Baud rate = 1 / [(Sync_Seg + Prop_Seg + Phase_Seg1 + Phase_Seg2) Tq)]
= Source Clock Freq / [PRESCALER * (1 + T_SEG1 + T_SEG2)]
******************************************************************************/
#define DIM( X ) (sizeof(X) / sizeof((X)[0]))
typedef void (*CAN0_Data_Ind_Func)(uint32_t Identifier, uint8_t DLC, uint8_t Data[]);
typedef void (*CAN1_Data_Ind_Func)(uint32_t Identifier, uint8_t DLC, uint8_t Data[]);
typedef void (*CAN2_Data_Ind_Func)(uint32_t Identifier, uint8_t DLC, uint8_t Data[]);
#define DIM(X) (sizeof(X) / sizeof((X)[0]))
typedef void (*CAN_Data_Ind_Func)(uint32_t Identifier, uint8_t DLC, uint8_t Data[]);
typedef void (*CAN_Data_Confirm_Func)(uint32_t Identifier, uint8_t TransferStatus);
typedef enum
{
CAN_Set_Complete = 0,
......@@ -147,33 +145,22 @@ typedef struct
typedef struct
{
CANFD_Filter_Cfg_st_t NM0StdFilter;
CANFD_Filter_Cfg_st_t Diag0StdFilter;
CANFD_Filter_Cfg_st_t Msg0StdFilter;
CANFD_Filter_Cfg_st_t NM0ExtFilter;
CANFD_Filter_Cfg_st_t Diag0ExtFilter;
CANFD_Filter_Cfg_st_t Msg0ExtFilter;
uint8_t CH0_Enable;
uint8_t CH0_Std_Ext;
CANFD_Filter_Cfg_st_t NM1StdFilter;
CANFD_Filter_Cfg_st_t Diag1StdFilter;
CANFD_Filter_Cfg_st_t Msg1StdFilter;
uint8_t CH1_Enable;
uint8_t CH1_Std_Ext;
CANFD_Filter_Cfg_st_t NM1ExtFilter;
CANFD_Filter_Cfg_st_t Diag1ExtFilter;
CANFD_Filter_Cfg_st_t Msg1ExtFilter;
uint8_t CH2_Enable;
uint8_t CH2_Std_Ext;
CANFD_Filter_Cfg_st_t NM2StdFilter;
CANFD_Filter_Cfg_st_t Diag2StdFilter;
CANFD_Filter_Cfg_st_t Msg2StdFilter;
CAN_Data_Ind_Func pfCAN0DataIndCb;
CAN_Data_Ind_Func pfCAN1DataIndCb;
CAN_Data_Ind_Func pfCAN2DataIndCb;
CANFD_Filter_Cfg_st_t NM2ExtFilter;
CANFD_Filter_Cfg_st_t Diag2ExtFilter;
CANFD_Filter_Cfg_st_t Msg2ExtFilter;
CAN0_Data_Ind_Func pfCAN0DataIndCb;
CAN1_Data_Ind_Func pfCAN1DataIndCb;
CAN2_Data_Ind_Func pfCAN2DataIndCb;
CAN_Data_Confirm_Func pfCAN0DataConfirmCb;
CAN_Data_Confirm_Func pfCAN1DataConfirmCb;
CAN_Data_Confirm_Func pfCAN2DataConfirmCb;
} CANFD_Filter_Init_st_t;
......@@ -235,12 +222,36 @@ typedef struct
volatile uint32_t Reserved : 6; /*!< Reserved bits */
} CANFD_ID_F3_st_t;
typedef struct stc_extid_filter
typedef union
{
uint32_t Msg;
CANFD_ID_F0_st_t st;
} CANFD_ID_F0_st_tt;
typedef union
{
uint32_t Msg;
CANFD_ID_F1_st_t st;
} CANFD_ID_F1_st_tt;
typedef union
{
CANFD_ID_F0_st_t F0_f; /*!< Message ID Filter Element for F0. See #stc_canfd_f0_t. */
CANFD_ID_F1_st_t F1_f; /*!< Message ID Filter Element for F1. See #stc_canfd_f1_t. */
CANFD_ID_F2_st_t F2_f; /*!< Message ID Filter Element for F2. See #stc_canfd_f2_t. */
CANFD_ID_F3_st_t F3_f; /*!< Message ID Filter Element for F3. See #stc_canfd_f3_t. */
uint32_t Msg;
CANFD_ID_F2_st_t st;
} CANFD_ID_F2_st_tt;
typedef union
{
uint32_t Msg;
CANFD_ID_F3_st_t st;
} CANFD_ID_F3_st_tt;
typedef struct stc_extid_filter
{
CANFD_ID_F0_st_tt F0_f; /*!< Message ID Filter Element for F0. See #stc_canfd_f0_t. */
CANFD_ID_F1_st_tt F1_f; /*!< Message ID Filter Element for F1. See #stc_canfd_f1_t. */
CANFD_ID_F2_st_tt F2_f; /*!< Message ID Filter Element for F2. See #stc_canfd_f2_t. */
CANFD_ID_F3_st_tt F3_f; /*!< Message ID Filter Element for F3. See #stc_canfd_f3_t. */
} CANFD_ID_Filter_st_t;
#define CANFD_CH0_MSG_RAM_ADDR ((uint32_t)(&RSCAN0) + 0x00000500UL)
......@@ -279,14 +290,9 @@ typedef struct
uint8_t Msg[8];
} CAN_Msg_t;
//#define usetx_buffer
#define userx_buffer
#define usetxrx_buffer
/******************************************************************************
Exported global variables and functions (to be accessed by other files)
******************************************************************************/
uint8_t CAN_Send_TxBuf0(uint32_t can_id, uint8_t dlc, uint8_t msg[8]);
uint8_t CAN_Receive_RxBuf0(uint32_t * p_can_id, uint8_t * p_dlc, uint8_t msg[8]);
void CANFD_SetTX_Abort(void);
uint8_t RSCAN0_SendCH0_TxBuf0(uint32_t can_id, uint8_t dlc, uint8_t ide, uint8_t msg[8]);
uint8_t RSCAN0_SendCH0_TxBuf1(uint32_t can_id, uint8_t dlc, uint8_t ide, uint8_t msg[8]);
......@@ -305,32 +311,38 @@ uint8_t RSCAN0_SendCH0_TxBuf13(uint32_t can_id, uint8_t dlc, uint8_t ide, uint8_
uint8_t RSCAN0_SendCH0_TxBuf14(uint32_t can_id, uint8_t dlc, uint8_t ide, uint8_t msg[8]);
uint8_t RSCAN0_SendCH0_TxBuf15(uint32_t can_id, uint8_t dlc, uint8_t ide, uint8_t msg[8]);
uint8_t CAN0_Receive_FIFOBuf0(void);
uint32_t Get_CAN0_Status(void);
uint8_t Get_CAN0_TxBuf1_Status(void);
void CAN0_Channel0_To_StopMode(void);
extern void RSCAN0_Init( void );
void RSCAN0_CH_Init (CANFD_Filter_Init_st_t *pFilterInit , uint32_t IDFilterNum);
extern void RSCan0_CH0_Write(CAN_Msg_t * Msg);
extern uint8_t CAN0_Receive_FIFO7(void);
extern void RSCAN0_Init(void);
void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum);
extern void RSCan0_CH0_Write(CAN_Msg_t *Msg);
extern uint8_t Get_CH0_ErrPassiveStatus(void);
extern void RSCAN0_FIFO_Rx_ISR(void);
extern void RSCAN0_CH0_Tx_ISR(void);
CAN_SetState CAN_CH0_Data_Request( uint32_t Identifier, uint8_t MsgStd, uint8_t MsgRTR, uint8_t DLC, uint8_t *Data );
extern void RSCAN0_CH0_Tx_ISR(void);
extern void RSCAN0_CH0_Rx_ISR(void);
extern void RSCAN0_CH0_Err_ISR(void);
extern uint8_t Get_CH0_BusOffStatus(void);
extern void CH0_BusOff_Recovery(void);
extern void RSCAN0_CH0_Wakeup_ISR(void);
extern CAN_SetState CAN_CH0_Data_Request(uint32_t Identifier, uint8_t MsgStd, uint8_t MsgRTR, uint8_t DLC, uint8_t *Data);
extern uint8_t Get_CH0_BusOffStatus(void);
extern void RSCAN0_CH1_Err_ISR(void);
extern void RSCAN0_CH2_Err_ISR(void);
extern void RSCAN0_CH1_Rx_ISR(void);
extern void RSCAN0_CH2_Rx_ISR(void);
extern void RSCAN0_CH1_Tx_ISR(void);
extern void RSCAN0_CH1_Rx_ISR(void);
extern void RSCAN0_CH1_Err_ISR(void);
extern void RSCAN0_CH2_Tx_ISR(void);
extern void RSCAN0_CH2_Rx_ISR(void);
extern void RSCAN0_CH2_Err_ISR(void);
uint8_t Get_CH0_RecStatus(void);
uint8_t Rscan_TEC_Counter(void);
uint8_t Rscan_REC_Counter(void);
void CAN0_Global_To_StopMode(void);
void CAN0_Channel0_To_StopMode(void);
void CAN0_Channel0_To_CommunicationMode(void);
void CAN0_Global_To_NORMAL(void);
#endif
......@@ -43,17 +43,17 @@ uint32_t g_u32EEPROMBlock10Buffer[EEPROM_BLOCK10_BUFFER_SIZE / 4U];
static const EEPROM_Block_st_t g_stEEPROMBlockTable[] =
{
/* u32StartAddr u32EndAddr u32DataSize pu32DataBuffer */
{0xFF200000UL, 0xFF20007FUL, EEPROM_BLOCK0_BUFFER_SIZE, g_u32EEPROMBlock0Buffer,},
{0xFF200080UL, 0xFF2000FFUL, EEPROM_BLOCK1_BUFFER_SIZE, g_u32EEPROMBlock1Buffer,},
{0xFF200100UL, 0xFF2002FFUL, EEPROM_BLOCK2_BUFFER_SIZE, g_u32EEPROMBlock2Buffer,},
{0xFF200300UL, 0xFF2004FFUL, EEPROM_BLOCK3_BUFFER_SIZE, g_u32EEPROMBlock3Buffer,},
{0xFF200500UL, 0xFF20057FUL, EEPROM_BLOCK4_BUFFER_SIZE, g_u32EEPROMBlock4Buffer,},
{0xFF200580UL, 0xFF20067FUL, EEPROM_BLOCK5_BUFFER_SIZE, g_u32EEPROMBlock5Buffer,},
{0xFF200680UL, 0xFF200A7FUL, EEPROM_BLOCK6_BUFFER_SIZE, g_u32EEPROMBlock6Buffer,},
{0xFF200A80UL, 0xFF200F7FUL, EEPROM_BLOCK7_BUFFER_SIZE, g_u32EEPROMBlock7Buffer,},
{0xFF200F80UL, 0xFF20377FUL, EEPROM_BLOCK8_BUFFER_SIZE, g_u32EEPROMBlock8Buffer,},
{0xFF203780UL, 0xFF2037FFUL, EEPROM_BLOCK9_BUFFER_SIZE, g_u32EEPROMBlock9Buffer,},
{0xFF203800UL, 0xFF2038FFUL, EEPROM_BLOCK10_BUFFER_SIZE, g_u32EEPROMBlock10Buffer,},
{0xFF200000UL, 0xFF20007FUL, EEPROM_BLOCK0_BUFFER_SIZE, g_u32EEPROMBlock0Buffer,}, /*EEPROM_BLOCK_UDS_FLAG*/
{0xFF200080UL, 0xFF2000FFUL, EEPROM_BLOCK1_BUFFER_SIZE, g_u32EEPROMBlock1Buffer,}, /*EEPROM_BLOCK_UDS_S27*/
{0xFF200100UL, 0xFF2002FFUL, EEPROM_BLOCK2_BUFFER_SIZE, g_u32EEPROMBlock2Buffer,}, /*EEPROM_BLOCK_UDS_S2E0*/
{0xFF200300UL, 0xFF2004FFUL, EEPROM_BLOCK3_BUFFER_SIZE, g_u32EEPROMBlock3Buffer,}, /*EEPROM_BLOCK_UDS_S2E*/
{0xFF200500UL, 0xFF20057FUL, EEPROM_BLOCK4_BUFFER_SIZE, g_u32EEPROMBlock4Buffer,}, /*EEPROM_BLOCK_UDS_CONFIG*/
{0xFF200580UL, 0xFF20067FUL, EEPROM_BLOCK5_BUFFER_SIZE, g_u32EEPROMBlock5Buffer,}, /*EEPROM_BLOCK_UDS_DTC*/
{0xFF200680UL, 0xFF200A7FUL, EEPROM_BLOCK6_BUFFER_SIZE, g_u32EEPROMBlock6Buffer,}, /*EEPROM_BLOCK_ODO*/
{0xFF200A80UL, 0xFF200F7FUL, EEPROM_BLOCK7_BUFFER_SIZE, g_u32EEPROMBlock7Buffer,}, /*EEPROM_BLOCK_ODO_STAMP*/
{0xFF200F80UL, 0xFF20377FUL, EEPROM_BLOCK8_BUFFER_SIZE, g_u32EEPROMBlock8Buffer,}, /*EEPROM_BLOCK_TRIP_STAMP*/
{0xFF203780UL, 0xFF2037FFUL, EEPROM_BLOCK9_BUFFER_SIZE, g_u32EEPROMBlock9Buffer,}, /*EEPROM_BLOCK_SERVICE_INFO*/
{0xFF203800UL, 0xFF2038FFUL, EEPROM_BLOCK10_BUFFER_SIZE, g_u32EEPROMBlock10Buffer,}, /*EEPROM_BLOCK_EOL_K_LINE*/
};
/****************************************************************************
......
......@@ -10,8 +10,8 @@ typedef union
{
uint16_t u16Index;
uint16_t u16IndexInv;
}stField;
}EEPROM_Ctrl_Data_un_t;
} stField;
} EEPROM_Ctrl_Data_un_t;
typedef struct
{
......@@ -20,7 +20,7 @@ typedef struct
uint16_t u16ProgLen;
uint32_t u32ProgAddr;
uint32_t* pu32ProgData;
}EEPROM_Access_Ctrl_st_t;
} EEPROM_Access_Ctrl_st_t;
......@@ -213,7 +213,7 @@ void EEPROM_Access_Init(const EEPROM_Block_st_t * pstBlockTable,
EEPROM_Ctrl_Data_un_t unCtrlData;
if ((pstBlockTable != NULL) && (pstBlockAccess != NULL) &&\
if ((pstBlockTable != NULL) && (pstBlockAccess != NULL) && \
(pstMediaAccess != NULL) && (u16BlockNum != 0U))
{
/*** Step 1 : Setup media(data flash) access functions ***/
......@@ -458,7 +458,7 @@ void EEPROM_Access_Init(const EEPROM_Block_st_t * pstBlockTable,
u16Result = u16IndexBkup + (0xFFFFU - u16Index) + 1U;
}
if ((u16Result <= u16MaxRecordNum[0U] + u16MaxRecordNum[1U]) &&\
if ((u16Result <= u16MaxRecordNum[0U] + u16MaxRecordNum[1U]) && \
(u16Result <= EEPROM_OVER_SEARCH_RECORD_NUM))
{
if (u16RecordNum == 0U) /* Cross sector access */
......@@ -504,7 +504,8 @@ void EEPROM_Access_Init(const EEPROM_Block_st_t * pstBlockTable,
g_pstEEPROMBlock[i].u8Status = EEPROM_BLOCK_ERROR;
}
}
}while(u8Loop);
}
while (u8Loop);
}
}
}
......
......@@ -142,7 +142,7 @@ void Sys_Run_Mode_10ms_Tasks(void)
Popup_Alone_Sound_Server();
Telltales_Left_Right_Management_Service();
Telltales_Management();
// Test_LED_AllLight();
//Test_LED_AllLight();
Key_Service();
CAN_BUSOFF_Recover();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment