Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RT_RMR42E
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
时昊
RT_RMR42E
Commits
dc5851a6
Commit
dc5851a6
authored
Feb 18, 2025
by
李冠华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:根据G54-A01混动通讯矩阵重做报文库和CAN相关文件,将原有的纯电相关信号改为预编译。后续添加混动相关信号
parent
95b03818
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1232 additions
and
293 deletions
+1232
-293
CAN_CH0_CAN_Communication_Matrix.c
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
+673
-1
CAN_CH0_CAN_Communication_Matrix.h
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.h
+177
-12
Can_App.c
Firmware/Source/Application/CAN_User/Can_App.c
+14
-12
Can_RX_User.c
Firmware/Source/Application/CAN_User/Can_RX_User.c
+64
-62
Can_User.c
Firmware/Source/Application/CAN_User/Can_User.c
+154
-96
CommonInterface.h
...ware/Source/Application/CommonInterface/CommonInterface.h
+1
-1
Data_Fuel.c
Firmware/Source/Application/Data_Fuel/Data_Fuel.c
+12
-1
Data_Soc.c
Firmware/Source/Application/Data_Soc/Data_Soc.c
+33
-16
GUI_Display.c
Firmware/Source/Application/GUI_Display/GUI_Display.c
+22
-18
SEG_DISPLAY.c
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
+82
-74
No files found.
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
View file @
dc5851a6
...
@@ -6,6 +6,7 @@ st_CanMsgOp CAN_CH0_CanMsgOp;
...
@@ -6,6 +6,7 @@ st_CanMsgOp CAN_CH0_CanMsgOp;
st_CanMsgTxOp
CAN_CH0_CanMsgTxOp
;
st_CanMsgTxOp
CAN_CH0_CanMsgTxOp
;
#define CAN_CH0 &CAN_CH0_CanMsgOp
#define CAN_CH0 &CAN_CH0_CanMsgOp
#if (PART_NUMBER == RMR42E_60)
const
st_CAN_SendAttribute
CAN_CH0_CANSendAttr
[
CAN_CH0_ID_SEND_TOTAL
]
=
const
st_CAN_SendAttribute
CAN_CH0_CANSendAttr
[
CAN_CH0_ID_SEND_TOTAL
]
=
{
{
{
0x3A2ul
,
200ul
*
1000ul
,
0ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_3A2
,
(
void
*
)
0
},
{
0x3A2ul
,
200ul
*
1000ul
,
0ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_3A2
,
(
void
*
)
0
},
...
@@ -140,7 +141,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
...
@@ -140,7 +141,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
5
00ul
,
10
00ul
,
0x220ul
,
0x220ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
...
@@ -488,3 +489,674 @@ uint8_t Co_Can_ConvertSubID_CAN_CH0(uint32_t MsgID)
...
@@ -488,3 +489,674 @@ uint8_t Co_Can_ConvertSubID_CAN_CH0(uint32_t MsgID)
}
}
return
u8Result
;
return
u8Result
;
}
}
#else
uint8_t
System_Indicator_CANFlag
=
0
;
const
st_CAN_SendAttribute
CAN_CH0_CANSendAttr
[
CAN_CH0_ID_SEND_TOTAL
]
=
{
{
0x3A2ul
,
200ul
*
1000ul
,
0ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_3A2
,
(
void
*
)
0
},
{
0x3A7ul
,
200ul
*
1000ul
,
0ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_3A7
,
(
void
*
)
0
},
{
0x393ul
,
2000ul
*
1000ul
,
0ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_393
,
(
void
*
)
0
},
};
const
st_CANMsgAttribute
CAN_CH0_CAN_MSG_CONST_ARRAY
[
CAN_CH0_ID_TOTAL_MAX
]
=
{
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
1000ul
,
0x225ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
1000ul
,
0x220ul
,
((
void
*
)
0
),
(
System_Indicator_ON_callback
),
(
System_Indicator_OFF_callback
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
2000ul
,
0x361ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
500ul
,
0x134ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
2000ul
,
0x33Eul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
20000ul
,
0x339ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
500ul
,
0x125ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
500ul
,
0x11Bul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
2000ul
,
0x31Aul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
2000ul
,
0x315ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
500ul
,
0x17Aul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
500ul
,
0x175ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
500ul
,
0x170ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
500ul
,
0x16Bul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
500ul
,
0x161ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
1000ul
,
0x22Aul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
1000ul
,
0x234ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
1000ul
,
0x22Ful
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
500ul
,
0x18Eul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
5000ul
,
0x3B1ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
2000ul
,
0x38Eul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
{
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
{
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
,
0x00u
},
20000ul
,
0x389ul
,
((
void
*
)
0
),
((
void
*
)
0
),
((
void
*
)
0
),
},
};
void
System_Indicator_ON_callback
(
canlib_uint8_t
CopyData
[])
{
System_Indicator_CANFlag
=
0
;
}
void
System_Indicator_OFF_callback
(
canlib_uint8_t
CopyData
[])
{
System_Indicator_CANFlag
=
1
;
uint8_t
i
=
0
;
BUZZER_Init
();
Clear_Bu98
();
for
(
i
=
0
;
i
<
LampCh0_MAX
;
i
++
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
i
,
LED_OFF
);
}
}
uint8_t
Get_CAN_CH0_ID_225_Sig_VCU_VoltLow
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Error_Msg_Count
,
3u
)
>>
3u
)
&
0x01u
));
}
uint16_t
Get_CAN_CH0_ID_225_Sig_VCU_FaultCode
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Error_Msg_Count
,
0u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Error_Msg_Count
,
1u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_225_Sig_VCU_EmsFltLv3
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Error_Msg_Count
,
7u
)
>>
1u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_225_Sig_VCU_BmsFltLv4
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Error_Msg_Count
,
6u
)
>>
6u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_225_Sig_VCU_BmsFltLv3
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Error_Msg_Count
,
6u
)
>>
5u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_SysFltLamp
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
4u
)
>>
0u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_SeatSts
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
1u
)
>>
6u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_ReadySts
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
0u
)
>>
4u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_PtoSwSts
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
2u
)
>>
1u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_KeySts
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
0u
)
>>
3u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_HvSts
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
0u
)
>>
0u
)
&
0x07u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_GrassSwSts
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
1u
)
>>
3u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_DrvSpdGear
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
2u
)
>>
4u
)
&
0x03u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_ChgMode
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
4u
)
>>
1u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_BladeSpdGear
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
2u
)
>>
6u
)
&
0x03u
));
}
uint16_t
Get_CAN_CH0_ID_361_Sig_SMCU_FaultCode
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_SMCU_Error_Msg_Count
,
0u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_SMCU_Error_Msg_Count
,
1u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_WorkState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_SMCU_StateInfo_134h_Msg_Count
,
0u
)
>>
0u
)
&
0x03u
));
}
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_ParkingGearState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_SMCU_StateInfo_134h_Msg_Count
,
1u
)
>>
0u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_LockMotoState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_SMCU_StateInfo_134h_Msg_Count
,
0u
)
>>
6u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_EBSState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_SMCU_StateInfo_134h_Msg_Count
,
0u
)
>>
4u
)
&
0x03u
));
}
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_ChgProtectState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_SMCU_StateInfo_134h_Msg_Count
,
1u
)
>>
1u
)
&
0x01u
));
}
uint16_t
Get_CAN_CH0_ID_33E_Sig_MMCU_FaultCode
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_Error_Msg_Count
,
0u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_Error_Msg_Count
,
1u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_339_Sig_MMCU_SingleWorkingHours
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_RunStatistics_339h_Msg_Count
,
5u
)
>>
0u
)
&
0xFFu
));
}
uint16_t
Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_RunStatistics_339h_Msg_Count
,
6u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_RunStatistics_339h_Msg_Count
,
7u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_WorkState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_StateInfo_125h_Msg_Count
,
0u
)
>>
0u
)
&
0x03u
));
}
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_ParkingGearState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_StateInfo_125h_Msg_Count
,
1u
)
>>
0u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_LockMotoState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_StateInfo_125h_Msg_Count
,
0u
)
>>
6u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_EBSState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_StateInfo_125h_Msg_Count
,
0u
)
>>
4u
)
&
0x03u
));
}
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_ChgProtectState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_StateInfo_125h_Msg_Count
,
1u
)
>>
1u
)
&
0x01u
));
}
uint16_t
Get_CAN_CH0_ID_11B_Sig_MMCU_Speed
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg_Count
,
0u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg_Count
,
1u
)
>>
0u
)
&
0xFFu
));
}
uint16_t
Get_CAN_CH0_ID_11B_Sig_MMCU_Rpm
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg_Count
,
4u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg_Count
,
5u
)
>>
0u
)
&
0xFFu
));
}
uint16_t
Get_CAN_CH0_ID_11B_Sig_MMCU_MotorPower
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg_Count
,
6u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg_Count
,
7u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_31A_Sig_MBMS_StatBattChargeState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_DynamicParamTotal_Msg_Count
,
1u
)
>>
0u
)
&
0x07u
));
}
uint16_t
Get_CAN_CH0_ID_315_Sig_MBMS_StatRemainTime
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_DChgCtrl_Msg_Count
,
5u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_DChgCtrl_Msg_Count
,
6u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_17A_Sig_MBMS_StatSoc
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_VoltCurrSocALL_Msg_Count
,
4u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_175_Sig_MBMS_Soc
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_VoltCurrSoc_Msg_Count
,
4u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_170_Sig_MBMS_TOTALSigDisCharge
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_SignalStateInfo_Msg_Count
,
0u
)
>>
3u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_170_Sig_MBMS_TOTALSigCharge
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_SignalStateInfo_Msg_Count
,
0u
)
>>
0u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_170_Sig_MBMS_TOTALSigAcc
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_SignalStateInfo_Msg_Count
,
0u
)
>>
1u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_16B_Sig_MBMS_SafeBattWorkState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_SafeDataStat_Msg_Count
,
7u
)
>>
4u
)
&
0x07u
));
}
uint16_t
Get_CAN_CH0_ID_161_Sig_MBMS_FaultNum
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_DynamicParam1_Msg_Count
,
6u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_MBMS_DynamicParam1_Msg_Count
,
7u
)
>>
0u
)
&
0xFFu
));
}
uint16_t
Get_CAN_CH0_ID_22A_Sig_GCU_FaultCode
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_GCU_Error_Msg_Count
,
0u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_GCU_Error_Msg_Count
,
1u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_234_Sig_EMS_EngineOilLow
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_EMS_Error_Msg_Count
,
3u
)
>>
4u
)
&
0x01u
));
}
uint16_t
Get_CAN_CH0_ID_234_Sig_EMS_FaultCode
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_EMS_Error_Msg_Count
,
0u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_EMS_Error_Msg_Count
,
1u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_22F_Sig_EMS_WorkSts
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_EMS_Status_Msg_Count
,
0u
)
>>
0u
)
&
0x07u
));
}
uint8_t
Get_CAN_CH0_ID_22F_Sig_EMS_SvsLamp
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_EMS_Status_Msg_Count
,
3u
)
>>
0u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_22F_Sig_EMS_MilLamp
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_EMS_Status_Msg_Count
,
1u
)
>>
6u
)
&
0x03u
));
}
uint8_t
Get_CAN_CH0_ID_22F_Sig_EMS_EgnOilLvLow
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_EMS_Status_Msg_Count
,
0u
)
>>
7u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_18E_Sig_EMS_FuelSensorVld
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_EMS_Parameter2_Msg_Count
,
4u
)
>>
0u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_18E_Sig_EMS_FuelRemainLevel
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_EMS_Parameter2_Msg_Count
,
0u
)
>>
0u
)
&
0x0Fu
));
}
uint16_t
Get_CAN_CH0_ID_3B1_Sig_CHG_TotalChargeTime
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_CHG_DynamicParam0_Msg_Count
,
5u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_CHG_DynamicParam0_Msg_Count
,
6u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_StartState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_CHG_DynamicParam0_Msg_Count
,
0u
)
>>
4u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_InputVoltState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_CHG_DynamicParam0_Msg_Count
,
0u
)
>>
7u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_HardFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_CHG_DynamicParam0_Msg_Count
,
0u
)
>>
6u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_CommState
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_CHG_DynamicParam0_Msg_Count
,
0u
)
>>
5u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_ChargeStage
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_CHG_DynamicParam0_Msg_Count
,
0u
)
>>
0u
)
&
0x0Fu
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_SoftOverCurrentFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
3u
)
>>
7u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_Locked_RotorFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
3u
)
>>
4u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2HWOverCurrentFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
4u
)
>>
1u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_SoftOverCurrentFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
3u
)
>>
6u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_Locked_RotorFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
3u
)
>>
3u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1HWOverCurrentFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
4u
)
>>
0u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_SoftOverCurrentFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
3u
)
>>
5u
)
&
0x01u
));
}
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_Locked_RotorFault
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
3u
)
>>
2u
)
&
0x01u
));
}
uint16_t
Get_CAN_CH0_ID_38E_Sig_BMCU_FaultCode
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
0u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
1u
)
>>
0u
)
&
0xFFu
));
}
uint16_t
Get_CAN_CH0_ID_389_Sig_BMCU_AccumulatedWorkHour
(
void
)
{
return
(((
uint16_t
)((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_RunStatistics_389h_Msg_Count
,
0u
)
>>
0u
)
&
0xFFu
)
<<
8u
)
+
\
((
uint16_t
)((
uint16_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_BMCU_RunStatistics_389h_Msg_Count
,
1u
)
>>
0u
)
&
0xFFu
));
}
uint8_t
Co_Can_ConvertSubID_CAN_CH0
(
uint32_t
MsgID
)
{
uint8_t
u8Result
=
CAN_CH0_ID_TOTAL_MAX
;
switch
(
MsgID
)
{
case
CAN_CH0_ID_VCU_Error_Msg
:
u8Result
=
CAN_CH0_ID_VCU_Error_Msg_Count
;
break
;
case
CAN_CH0_ID_VCU_Status_Msg
:
u8Result
=
CAN_CH0_ID_VCU_Status_Msg_Count
;
break
;
case
CAN_CH0_ID_SMCU_Error_Msg
:
u8Result
=
CAN_CH0_ID_SMCU_Error_Msg_Count
;
break
;
case
CAN_CH0_ID_SMCU_StateInfo_134h_Msg
:
u8Result
=
CAN_CH0_ID_SMCU_StateInfo_134h_Msg_Count
;
break
;
case
CAN_CH0_ID_MMCU_Error_Msg
:
u8Result
=
CAN_CH0_ID_MMCU_Error_Msg_Count
;
break
;
case
CAN_CH0_ID_MMCU_RunStatistics_339h_Msg
:
u8Result
=
CAN_CH0_ID_MMCU_RunStatistics_339h_Msg_Count
;
break
;
case
CAN_CH0_ID_MMCU_StateInfo_125h_Msg
:
u8Result
=
CAN_CH0_ID_MMCU_StateInfo_125h_Msg_Count
;
break
;
case
CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg
:
u8Result
=
CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg_Count
;
break
;
case
CAN_CH0_ID_MBMS_DynamicParamTotal_Msg
:
u8Result
=
CAN_CH0_ID_MBMS_DynamicParamTotal_Msg_Count
;
break
;
case
CAN_CH0_ID_MBMS_DChgCtrl_Msg
:
u8Result
=
CAN_CH0_ID_MBMS_DChgCtrl_Msg_Count
;
break
;
case
CAN_CH0_ID_MBMS_VoltCurrSocALL_Msg
:
u8Result
=
CAN_CH0_ID_MBMS_VoltCurrSocALL_Msg_Count
;
break
;
case
CAN_CH0_ID_MBMS_VoltCurrSoc_Msg
:
u8Result
=
CAN_CH0_ID_MBMS_VoltCurrSoc_Msg_Count
;
break
;
case
CAN_CH0_ID_MBMS_SignalStateInfo_Msg
:
u8Result
=
CAN_CH0_ID_MBMS_SignalStateInfo_Msg_Count
;
break
;
case
CAN_CH0_ID_MBMS_SafeDataStat_Msg
:
u8Result
=
CAN_CH0_ID_MBMS_SafeDataStat_Msg_Count
;
break
;
case
CAN_CH0_ID_MBMS_DynamicParam1_Msg
:
u8Result
=
CAN_CH0_ID_MBMS_DynamicParam1_Msg_Count
;
break
;
case
CAN_CH0_ID_GCU_Error_Msg
:
u8Result
=
CAN_CH0_ID_GCU_Error_Msg_Count
;
break
;
case
CAN_CH0_ID_EMS_Error_Msg
:
u8Result
=
CAN_CH0_ID_EMS_Error_Msg_Count
;
break
;
case
CAN_CH0_ID_EMS_Status_Msg
:
u8Result
=
CAN_CH0_ID_EMS_Status_Msg_Count
;
break
;
case
CAN_CH0_ID_EMS_Parameter2_Msg
:
u8Result
=
CAN_CH0_ID_EMS_Parameter2_Msg_Count
;
break
;
case
CAN_CH0_ID_CHG_DynamicParam0_Msg
:
u8Result
=
CAN_CH0_ID_CHG_DynamicParam0_Msg_Count
;
break
;
case
CAN_CH0_ID_BMCU_Error_Msg
:
u8Result
=
CAN_CH0_ID_BMCU_Error_Msg_Count
;
break
;
case
CAN_CH0_ID_BMCU_RunStatistics_389h_Msg
:
u8Result
=
CAN_CH0_ID_BMCU_RunStatistics_389h_Msg_Count
;
break
;
default
:
u8Result
=
CAN_CH0_ID_TOTAL_MAX
;
break
;
}
return
u8Result
;
}
#endif
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.h
View file @
dc5851a6
...
@@ -9,6 +9,19 @@ extern st_CanMsgOp CAN_CH0_CanMsgOp;
...
@@ -9,6 +9,19 @@ extern st_CanMsgOp CAN_CH0_CanMsgOp;
extern
st_CanMsgTxOp
CAN_CH0_CanMsgTxOp
;
extern
st_CanMsgTxOp
CAN_CH0_CanMsgTxOp
;
typedef
enum
{
KEY_OFF
=
0
,
PKEY_ON
,
KEY_ACC
,
READY
,
CHRG_PLUGIN
,
CHRGING
,
CHRGEND
,
POWER_CHECK_NULL
,
}
POWER_CHECK_STATE_t
;
#if (PART_NUMBER == RMR42E_60)
typedef
enum
typedef
enum
{
{
CAN_CH0_ID_CAN_0x398_Msg_Count
,
CAN_CH0_ID_CAN_0x398_Msg_Count
,
...
@@ -32,18 +45,6 @@ typedef enum
...
@@ -32,18 +45,6 @@ typedef enum
CAN_CH0_ID_TOTAL_MAX
,
CAN_CH0_ID_TOTAL_MAX
,
}
CAN_CH0_CAN_MSG_ID_t
;
}
CAN_CH0_CAN_MSG_ID_t
;
typedef
enum
{
KEY_OFF
=
0
,
PKEY_ON
,
KEY_ACC
,
READY
,
CHRG_PLUGIN
,
CHRGING
,
CHRGEND
,
POWER_CHECK_NULL
,
}
POWER_CHECK_STATE_t
;
typedef
enum
typedef
enum
{
{
...
@@ -129,5 +130,169 @@ extern uint8_t System_Indicator_CANFlag;
...
@@ -129,5 +130,169 @@ extern uint8_t System_Indicator_CANFlag;
void
System_Indicator_ON_callback
(
canlib_uint8_t
CopyData
[]);
void
System_Indicator_ON_callback
(
canlib_uint8_t
CopyData
[]);
void
System_Indicator_OFF_callback
(
canlib_uint8_t
CopyData
[]);
void
System_Indicator_OFF_callback
(
canlib_uint8_t
CopyData
[]);
#else
typedef
enum
{
CAN_CH0_ID_VCU_Error_Msg_Count
,
CAN_CH0_ID_VCU_Status_Msg_Count
,
CAN_CH0_ID_SMCU_Error_Msg_Count
,
CAN_CH0_ID_SMCU_StateInfo_134h_Msg_Count
,
CAN_CH0_ID_MMCU_Error_Msg_Count
,
CAN_CH0_ID_MMCU_RunStatistics_339h_Msg_Count
,
CAN_CH0_ID_MMCU_StateInfo_125h_Msg_Count
,
CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg_Count
,
CAN_CH0_ID_MBMS_DynamicParamTotal_Msg_Count
,
CAN_CH0_ID_MBMS_DChgCtrl_Msg_Count
,
CAN_CH0_ID_MBMS_VoltCurrSocALL_Msg_Count
,
CAN_CH0_ID_MBMS_VoltCurrSoc_Msg_Count
,
CAN_CH0_ID_MBMS_SignalStateInfo_Msg_Count
,
CAN_CH0_ID_MBMS_SafeDataStat_Msg_Count
,
CAN_CH0_ID_MBMS_DynamicParam1_Msg_Count
,
CAN_CH0_ID_GCU_Error_Msg_Count
,
CAN_CH0_ID_EMS_Error_Msg_Count
,
CAN_CH0_ID_EMS_Status_Msg_Count
,
CAN_CH0_ID_EMS_Parameter2_Msg_Count
,
CAN_CH0_ID_CHG_DynamicParam0_Msg_Count
,
CAN_CH0_ID_BMCU_Error_Msg_Count
,
CAN_CH0_ID_BMCU_RunStatistics_389h_Msg_Count
,
CAN_CH0_ID_TOTAL_MAX
,
}
CAN_CH0_CAN_MSG_ID_t
;
typedef
enum
{
CAN_CH0_ID_SEND_3A2_TOTAL
,
CAN_CH0_ID_SEND_3A7_TOTAL
,
CAN_CH0_ID_SEND_393_TOTAL
,
CAN_CH0_ID_SEND_TOTAL
,
}
CAN_CH0_CAN_MSG_SEND_ID_t
;
extern
const
st_CANMsgAttribute
CAN_CH0_CAN_MSG_CONST_ARRAY
[
CAN_CH0_ID_TOTAL_MAX
]
;
extern
const
st_CAN_SendAttribute
CAN_CH0_CANSendAttr
[
CAN_CH0_ID_SEND_TOTAL
]
;
#define CAN_CH0_ID_VCU_Error_Msg 0x225ul
#define CAN_CH0_ID_VCU_Status_Msg 0x220ul
#define CAN_CH0_ID_SMCU_Error_Msg 0x361ul
#define CAN_CH0_ID_SMCU_StateInfo_134h_Msg 0x134ul
#define CAN_CH0_ID_MMCU_Error_Msg 0x33Eul
#define CAN_CH0_ID_MMCU_RunStatistics_339h_Msg 0x339ul
#define CAN_CH0_ID_MMCU_StateInfo_125h_Msg 0x125ul
#define CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg 0x11Bul
#define CAN_CH0_ID_MBMS_DynamicParamTotal_Msg 0x31Aul
#define CAN_CH0_ID_MBMS_DChgCtrl_Msg 0x315ul
#define CAN_CH0_ID_MBMS_VoltCurrSocALL_Msg 0x17Aul
#define CAN_CH0_ID_MBMS_VoltCurrSoc_Msg 0x175ul
#define CAN_CH0_ID_MBMS_SignalStateInfo_Msg 0x170ul
#define CAN_CH0_ID_MBMS_SafeDataStat_Msg 0x16Bul
#define CAN_CH0_ID_MBMS_DynamicParam1_Msg 0x161ul
#define CAN_CH0_ID_GCU_Error_Msg 0x22Aul
#define CAN_CH0_ID_EMS_Error_Msg 0x234ul
#define CAN_CH0_ID_EMS_Status_Msg 0x22Ful
#define CAN_CH0_ID_EMS_Parameter2_Msg 0x18Eul
#define CAN_CH0_ID_CHG_DynamicParam0_Msg 0x3B1ul
#define CAN_CH0_ID_BMCU_Error_Msg 0x38Eul
#define CAN_CH0_ID_BMCU_RunStatistics_389h_Msg 0x389ul
#define CAN_CH0_ID_CAN_0x225_Msg CAN_CH0_ID_VCU_Error_Msg
#define CAN_CH0_ID_CAN_0x220_Msg CAN_CH0_ID_VCU_Status_Msg
#define CAN_CH0_ID_CAN_0x361_Msg CAN_CH0_ID_SMCU_Error_Msg
#define CAN_CH0_ID_CAN_0x134_Msg CAN_CH0_ID_SMCU_StateInfo_134h_Msg
#define CAN_CH0_ID_CAN_0x33E_Msg CAN_CH0_ID_MMCU_Error_Msg
#define CAN_CH0_ID_CAN_0x339_Msg CAN_CH0_ID_MMCU_RunStatistics_339h_Msg
#define CAN_CH0_ID_CAN_0x125_Msg CAN_CH0_ID_MMCU_StateInfo_125h_Msg
#define CAN_CH0_ID_CAN_0x11B_Msg CAN_CH0_ID_MMCU_DynamicParam_11Bh_Msg
#define CAN_CH0_ID_CAN_0x31A_Msg CAN_CH0_ID_MBMS_DynamicParamTotal_Msg
#define CAN_CH0_ID_CAN_0x315_Msg CAN_CH0_ID_MBMS_DChgCtrl_Msg
#define CAN_CH0_ID_CAN_0x17A_Msg CAN_CH0_ID_MBMS_VoltCurrSocALL_Msg
#define CAN_CH0_ID_CAN_0x175_Msg CAN_CH0_ID_MBMS_VoltCurrSoc_Msg
#define CAN_CH0_ID_CAN_0x170_Msg CAN_CH0_ID_MBMS_SignalStateInfo_Msg
#define CAN_CH0_ID_CAN_0x16B_Msg CAN_CH0_ID_MBMS_SafeDataStat_Msg
#define CAN_CH0_ID_CAN_0x161_Msg CAN_CH0_ID_MBMS_DynamicParam1_Msg
#define CAN_CH0_ID_CAN_0x22A_Msg CAN_CH0_ID_GCU_Error_Msg
#define CAN_CH0_ID_CAN_0x234_Msg CAN_CH0_ID_EMS_Error_Msg
#define CAN_CH0_ID_CAN_0x22F_Msg CAN_CH0_ID_EMS_Status_Msg
#define CAN_CH0_ID_CAN_0x18E_Msg CAN_CH0_ID_EMS_Parameter2_Msg
#define CAN_CH0_ID_CAN_0x3B1_Msg CAN_CH0_ID_CHG_DynamicParam0_Msg
#define CAN_CH0_ID_CAN_0x38E_Msg CAN_CH0_ID_BMCU_Error_Msg
#define CAN_CH0_ID_CAN_0x389_Msg CAN_CH0_ID_BMCU_RunStatistics_389h_Msg
extern
uint8_t
Get_CAN_CH0_ID_225_Sig_VCU_VoltLow
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_225_Sig_VCU_FaultCode
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_225_Sig_VCU_EmsFltLv3
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_225_Sig_VCU_BmsFltLv4
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_225_Sig_VCU_BmsFltLv3
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_SysFltLamp
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_SeatSts
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_ReadySts
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_PtoSwSts
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_KeySts
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_HvSts
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_GrassSwSts
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_DrvSpdGear
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_ChgMode
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_220_Sig_VCU_BladeSpdGear
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_361_Sig_SMCU_FaultCode
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_WorkState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_ParkingGearState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_LockMotoState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_EBSState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_134_Sig_SMCU_ChgProtectState
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_33E_Sig_MMCU_FaultCode
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_339_Sig_MMCU_SingleWorkingHours
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_WorkState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_ParkingGearState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_LockMotoState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_EBSState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_125_Sig_MMCU_ChgProtectState
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_11B_Sig_MMCU_Speed
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_11B_Sig_MMCU_Rpm
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_11B_Sig_MMCU_MotorPower
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_31A_Sig_MBMS_StatBattChargeState
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_315_Sig_MBMS_StatRemainTime
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_17A_Sig_MBMS_StatSoc
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_175_Sig_MBMS_Soc
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_170_Sig_MBMS_TOTALSigDisCharge
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_170_Sig_MBMS_TOTALSigCharge
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_170_Sig_MBMS_TOTALSigAcc
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_16B_Sig_MBMS_SafeBattWorkState
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_161_Sig_MBMS_FaultNum
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_22A_Sig_GCU_FaultCode
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_234_Sig_EMS_EngineOilLow
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_234_Sig_EMS_FaultCode
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_22F_Sig_EMS_WorkSts
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_22F_Sig_EMS_SvsLamp
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_22F_Sig_EMS_MilLamp
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_22F_Sig_EMS_EgnOilLvLow
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_18E_Sig_EMS_FuelSensorVld
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_18E_Sig_EMS_FuelRemainLevel
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_3B1_Sig_CHG_TotalChargeTime
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_StartState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_InputVoltState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_HardFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_CommState
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_3B1_Sig_CHG_ChargeStage
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_SoftOverCurrentFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto3_Locked_RotorFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2HWOverCurrentFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_SoftOverCurrentFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_Locked_RotorFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1HWOverCurrentFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_SoftOverCurrentFault
(
void
);
extern
uint8_t
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_Locked_RotorFault
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_38E_Sig_BMCU_FaultCode
(
void
);
extern
uint16_t
Get_CAN_CH0_ID_389_Sig_BMCU_AccumulatedWorkHour
(
void
);
extern
uint8_t
Co_Can_ConvertSubID_CAN_CH0
(
uint32_t
MsgID
);
extern
uint8_t
System_Indicator_CANFlag
;
void
System_Indicator_ON_callback
(
canlib_uint8_t
CopyData
[]);
void
System_Indicator_OFF_callback
(
canlib_uint8_t
CopyData
[]);
#endif
#endif
#endif
Firmware/Source/Application/CAN_User/Can_App.c
View file @
dc5851a6
...
@@ -52,18 +52,20 @@ void Can_Set_Buff_3A7(canlib_uint8_t CopyData[])
...
@@ -52,18 +52,20 @@ void Can_Set_Buff_3A7(canlib_uint8_t CopyData[])
p3A7
=
(
CANMsg3A7Union
*
)
CopyData
;
p3A7
=
(
CANMsg3A7Union
*
)
CopyData
;
if
(
p3A7
!=
(
void
*
)
0
)
if
(
p3A7
!=
(
void
*
)
0
)
{
{
p3A7
->
Sig
.
ICU_MasterBMSCommunicatlost
=
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
);
#if (PART_NUMBER == RMR42E_60)
p3A7
->
Sig
.
ICU_SlaveBMSCommunicatlost
=
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A21_Msg
))
==
CAN_SIG_NORMAL
);
p3A7
->
Sig
.
ICU_MasterBMSCommunicatlost
=
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
);
p3A7
->
Sig
.
ICU_MCUCommunicatlost
=
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x157_Msg
))
==
CAN_SIG_NORMAL
);
p3A7
->
Sig
.
ICU_SlaveBMSCommunicatlost
=
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A21_Msg
))
==
CAN_SIG_NORMAL
);
p3A7
->
Sig
.
ICU_VCUCommunicatlost
=
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x125_Msg
))
==
CAN_SIG_NORMAL
);
p3A7
->
Sig
.
ICU_MCUCommunicatlost
=
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x157_Msg
))
==
CAN_SIG_NORMAL
);
p3A7
->
Sig
.
Res0
=
0x0
;
p3A7
->
Sig
.
ICU_VCUCommunicatlost
=
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x125_Msg
))
==
CAN_SIG_NORMAL
);
p3A7
->
Sig
.
Res1
=
0x00
;
p3A7
->
Sig
.
Res0
=
0x0
;
p3A7
->
Sig
.
Res2
=
0x00
;
p3A7
->
Sig
.
Res1
=
0x00
;
p3A7
->
Sig
.
Res3
=
0x00
;
p3A7
->
Sig
.
Res2
=
0x00
;
p3A7
->
Sig
.
Res4
=
0x00
;
p3A7
->
Sig
.
Res3
=
0x00
;
p3A7
->
Sig
.
Res5
=
0x00
;
p3A7
->
Sig
.
Res4
=
0x00
;
p3A7
->
Sig
.
Res6
=
0x00
;
p3A7
->
Sig
.
Res5
=
0x00
;
p3A7
->
Sig
.
Res7
=
0x00
;
p3A7
->
Sig
.
Res6
=
0x00
;
p3A7
->
Sig
.
Res7
=
0x00
;
#endif
}
}
}
}
...
...
Firmware/Source/Application/CAN_User/Can_RX_User.c
View file @
dc5851a6
...
@@ -38,68 +38,70 @@ static uint8_t SBMS_Soc = 0;
...
@@ -38,68 +38,70 @@ static uint8_t SBMS_Soc = 0;
static
uint8_t
SMCU_ErrorGrage
=
0
;
static
uint8_t
SMCU_ErrorGrage
=
0
;
void
Set_CAN_ALL_Signal
(
void
)
void
Set_CAN_ALL_Signal
(
void
)
{
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x157_Msg
))
==
CAN_SIG_NORMAL
)
#if (PART_NUMBER == RMR42E_60)
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x157_Msg
))
==
CAN_SIG_NORMAL
)
BMCU_ErrorGrage
=
Get_CAN_CH0_ID_157_Sig_BMCU_ErrorGrage
();
{
BMCU_BladeSpeedGear
=
Get_CAN_CH0_ID_157_Sig_BMCU_BladeSpeedGear
();
BMCU_ErrorGrage
=
Get_CAN_CH0_ID_157_Sig_BMCU_ErrorGrage
();
BMCU_PTOSwicthState
=
Get_CAN_CH0_ID_157_Sig_BMCU_PTOSwicthState
();
BMCU_BladeSpeedGear
=
Get_CAN_CH0_ID_157_Sig_BMCU_BladeSpeedGear
();
}
BMCU_PTOSwicthState
=
Get_CAN_CH0_ID_157_Sig_BMCU_PTOSwicthState
();
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x38E_Msg
))
==
CAN_SIG_NORMAL
)
}
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x38E_Msg
))
==
CAN_SIG_NORMAL
)
BMCU_Moto1_Locked_RotorFault
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_Locked_RotorFault
();
{
BMCU_Moto2_Locked_RotorFault
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_Locked_RotorFault
();
BMCU_Moto1_Locked_RotorFault
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_Locked_RotorFault
();
}
BMCU_Moto2_Locked_RotorFault
=
Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_Locked_RotorFault
();
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
}
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
MBMS_Soc
=
Get_CAN_CH0_ID_18200A20_Sig_MBMS_Soc
();
{
}
MBMS_Soc
=
Get_CAN_CH0_ID_18200A20_Sig_MBMS_Soc
();
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18202922_Msg
))
==
CAN_SIG_NORMAL
)
}
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18202922_Msg
))
==
CAN_SIG_NORMAL
)
MBMS_TOTALWorkState
=
Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALWorkState
();
{
MBMS_TOTALSigOn
=
Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigOn
();
MBMS_TOTALWorkState
=
Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALWorkState
();
MBMS_TOTALSigAcc
=
Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigAcc
();
MBMS_TOTALSigOn
=
Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigOn
();
MBMS_TOTALSigCharge
=
Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigCharge
();
MBMS_TOTALSigAcc
=
Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigAcc
();
}
MBMS_TOTALSigCharge
=
Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigCharge
();
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203020_Msg
))
==
CAN_SIG_NORMAL
)
}
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203020_Msg
))
==
CAN_SIG_NORMAL
)
MBMS_StatSoc
=
Get_CAN_CH0_ID_18203020_Sig_MBMS_StatSoc
();
{
}
MBMS_StatSoc
=
Get_CAN_CH0_ID_18203020_Sig_MBMS_StatSoc
();
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
)
}
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
)
MBMS_StatBattChargeState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattChargeState
();
{
MBMS_StatBattWorkState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState
();
MBMS_StatBattChargeState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattChargeState
();
}
MBMS_StatBattWorkState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState
();
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x125_Msg
))
==
CAN_SIG_NORMAL
)
}
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x125_Msg
))
==
CAN_SIG_NORMAL
)
MMCU_ErrorGrage
=
Get_CAN_CH0_ID_125_Sig_MMCU_ErrorGrage
();
{
MMCU_ChgProtectState
=
Get_CAN_CH0_ID_125_Sig_MMCU_ChgProtectState
();
MMCU_ErrorGrage
=
Get_CAN_CH0_ID_125_Sig_MMCU_ErrorGrage
();
MMCU_DCDCEnableState
=
Get_CAN_CH0_ID_125_Sig_MMCU_DCDCEnableState
();
MMCU_ChgProtectState
=
Get_CAN_CH0_ID_125_Sig_MMCU_ChgProtectState
();
MMCU_ParkingGearState
=
Get_CAN_CH0_ID_125_Sig_MMCU_ParkingGearState
();
MMCU_DCDCEnableState
=
Get_CAN_CH0_ID_125_Sig_MMCU_DCDCEnableState
();
MMCU_SeatDetectState
=
Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState
();
// 掉线需要做处理
MMCU_ParkingGearState
=
Get_CAN_CH0_ID_125_Sig_MMCU_ParkingGearState
();
MMCU_LockMotoState
=
Get_CAN_CH0_ID_125_Sig_MMCU_LockMotoState
();
MMCU_SeatDetectState
=
Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState
();
// 掉线需要做处理
MMCU_EBSState
=
Get_CAN_CH0_ID_125_Sig_MMCU_EBSState
();
MMCU_LockMotoState
=
Get_CAN_CH0_ID_125_Sig_MMCU_LockMotoState
();
MMCU_TravelSpeedGear
=
Get_CAN_CH0_ID_125_Sig_MMCU_TravelSpeedGear
();
MMCU_EBSState
=
Get_CAN_CH0_ID_125_Sig_MMCU_EBSState
();
MMCU_PowerMode
=
Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode
();
MMCU_TravelSpeedGear
=
Get_CAN_CH0_ID_125_Sig_MMCU_TravelSpeedGear
();
MMCU_WorkState
=
Get_CAN_CH0_ID_125_Sig_MMCU_WorkState
();
MMCU_PowerMode
=
Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode
();
}
MMCU_WorkState
=
Get_CAN_CH0_ID_125_Sig_MMCU_WorkState
();
else
}
{
else
MMCU_SeatDetectState
=
Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState
();
// 掉线需要做处理
{
MMCU_PowerMode
=
POWER_CHECK_NULL
;
MMCU_SeatDetectState
=
Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState
();
// 掉线需要做处理
}
MMCU_PowerMode
=
POWER_CHECK_NULL
;
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x339_Msg
))
==
CAN_SIG_NORMAL
)
}
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x339_Msg
))
==
CAN_SIG_NORMAL
)
MMCU_AccumulatedWorkHours
=
Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours
();
{
MMCU_SingleWorkingHours
=
Get_CAN_CH0_ID_339_Sig_MMCU_SingleWorkingHours
();
MMCU_AccumulatedWorkHours
=
Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours
();
}
MMCU_SingleWorkingHours
=
Get_CAN_CH0_ID_339_Sig_MMCU_SingleWorkingHours
();
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A21_Msg
))
==
CAN_SIG_NORMAL
)
}
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A21_Msg
))
==
CAN_SIG_NORMAL
)
SBMS_Soc
=
Get_CAN_CH0_ID_18200A21_Sig_SBMS_Soc
();
{
}
SBMS_Soc
=
Get_CAN_CH0_ID_18200A21_Sig_SBMS_Soc
();
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x134_Msg
))
==
CAN_SIG_NORMAL
)
}
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x134_Msg
))
==
CAN_SIG_NORMAL
)
SMCU_ErrorGrage
=
Get_CAN_CH0_ID_134_Sig_SMCU_ErrorGrage
();
{
}
SMCU_ErrorGrage
=
Get_CAN_CH0_ID_134_Sig_SMCU_ErrorGrage
();
}
#endif
}
}
...
...
Firmware/Source/Application/CAN_User/Can_User.c
View file @
dc5851a6
...
@@ -15,10 +15,17 @@ void Can_Init(void)
...
@@ -15,10 +15,17 @@ void Can_Init(void)
can_config_st_t
Can_Config
;
can_config_st_t
Can_Config
;
Can_Config
.
ch
=
CAN_CH_0
;
Can_Config
.
ch
=
CAN_CH_0
;
Can_Config
.
freq
=
CAN_500Kbps
;
Can_Config
.
freq
=
CAN_500Kbps
;
Can_Config
.
MASK
[
0
]
=
0x001fffffU
;
#if (PART_NUMBER == RMR42E_60)
Can_Config
.
MASK
[
1
]
=
0x000fffffU
;
Can_Config
.
MASK
[
0
]
=
0x001fffffU
;
Can_Config
.
MASK
[
2
]
=
0x1fffffffU
;
Can_Config
.
MASK
[
1
]
=
0x000fffffU
;
Can_Config
.
MASK
[
3
]
=
0x1fffffffU
;
Can_Config
.
MASK
[
2
]
=
0x1fffffffU
;
Can_Config
.
MASK
[
3
]
=
0x1fffffffU
;
#else
Can_Config
.
MASK
[
0
]
=
0x1FFU
;
Can_Config
.
MASK
[
1
]
=
0x2FFU
;
Can_Config
.
MASK
[
2
]
=
0x3FFU
;
Can_Config
.
MASK
[
3
]
=
0x7FFU
;
#endif
Can_Config
.
rx_callback
=
Can_Rx_Cak
;
Can_Config
.
rx_callback
=
Can_Rx_Cak
;
COM_CAN_Init
();
COM_CAN_Init
();
rte_can_init
(
&
Can_Config
);
rte_can_init
(
&
Can_Config
);
...
@@ -36,95 +43,146 @@ void Can_Init(void)
...
@@ -36,95 +43,146 @@ void Can_Init(void)
*/
*/
void
Can_RX_Apply_Buff
(
void
)
void
Can_RX_Apply_Buff
(
void
)
{
{
CAN_RecvMsg
.
Id
=
0x125
;
CAN_RecvMsg
.
DLC
=
8
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_RecvMsg
.
Data
[
0
]
=
0
;
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
Data
[
1
]
=
0
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Data
[
2
]
=
0
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
Data
[
3
]
=
0
;
CAN_MessageCache_DeInit
(
CAN0MSG00
);
CAN_RecvMsg
.
Data
[
4
]
=
0
;
CAN_MessageCache_Init
(
CAN0MSG00
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
Data
[
5
]
=
0
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG00
,
ENABLE
);
CAN_RecvMsg
.
Data
[
6
]
=
0
;
CAN_RecvMsg
.
Data
[
7
]
=
0
;
CAN_RecvMsg
.
Id
=
0x134
;
// CAN_RecvMsg.OverWriteConfig = 0;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
#if (PART_NUMBER == RMR42E_60)
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Id
=
0x125
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_MessageCache_DeInit
(
CAN0MSG01
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_MessageCache_Init
(
CAN0MSG01
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG01
,
ENABLE
);
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG00
);
CAN_RecvMsg
.
Id
=
0x157
;
CAN_MessageCache_Init
(
CAN0MSG00
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG00
,
ENABLE
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Id
=
0x134
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_MessageCache_DeInit
(
CAN0MSG02
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_MessageCache_Init
(
CAN0MSG02
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG02
,
ENABLE
);
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG01
);
CAN_RecvMsg
.
Id
=
0x38E
;
CAN_MessageCache_Init
(
CAN0MSG01
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG01
,
ENABLE
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Id
=
0x157
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_MessageCache_DeInit
(
CAN0MSG03
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_MessageCache_Init
(
CAN0MSG03
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG03
,
ENABLE
);
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG02
);
CAN_RecvMsg
.
Id
=
0x339
;
CAN_MessageCache_Init
(
CAN0MSG02
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG02
,
ENABLE
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Id
=
0x38E
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_MessageCache_DeInit
(
CAN0MSG04
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_MessageCache_Init
(
CAN0MSG04
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG04
,
ENABLE
);
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG03
);
CAN_RecvMsg
.
Id
=
0x18202922
;
CAN_MessageCache_Init
(
CAN0MSG03
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG03
,
ENABLE
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Id
=
0x339
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_MessageCache_DeInit
(
CAN0MSG05
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_MessageCache_Init
(
CAN0MSG05
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG05
,
ENABLE
);
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG04
);
CAN_RecvMsg
.
Id
=
0x18200A20
;
CAN_MessageCache_Init
(
CAN0MSG04
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG04
,
ENABLE
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Id
=
0x18202922
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_MessageCache_DeInit
(
CAN0MSG06
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_MessageCache_Init
(
CAN0MSG06
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG06
,
ENABLE
);
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG05
);
CAN_RecvMsg
.
Id
=
0x18200A21
;
CAN_MessageCache_Init
(
CAN0MSG05
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG05
,
ENABLE
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Id
=
0x18200A20
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_MessageCache_DeInit
(
CAN0MSG07
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_MessageCache_Init
(
CAN0MSG07
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG07
,
ENABLE
);
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG06
);
CAN_RecvMsg
.
Id
=
0x18203220
;
CAN_MessageCache_Init
(
CAN0MSG06
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG06
,
ENABLE
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Id
=
0x18200A21
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_MessageCache_DeInit
(
CAN0MSG08
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_MessageCache_Init
(
CAN0MSG08
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG08
,
ENABLE
);
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG07
);
CAN_RecvMsg
.
Id
=
0x18203020
;
CAN_MessageCache_Init
(
CAN0MSG07
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG07
,
ENABLE
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Id
=
0x18203220
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_MessageCache_DeInit
(
CAN0MSG09
);
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_MessageCache_Init
(
CAN0MSG09
,
&
CAN_RecvMsg
);
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_MessageCache_OverWriteConfig
(
CAN0MSG09
,
ENABLE
);
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG08
);
CAN_MessageCache_Init
(
CAN0MSG08
,
&
CAN_RecvMsg
);
CAN_MessageCache_OverWriteConfig
(
CAN0MSG08
,
ENABLE
);
CAN_RecvMsg
.
Id
=
0x18203020
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Extended
;
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_NoMask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG09
);
CAN_MessageCache_Init
(
CAN0MSG09
,
&
CAN_RecvMsg
);
CAN_MessageCache_OverWriteConfig
(
CAN0MSG09
,
ENABLE
);
#else
CAN_RecvMsg
.
Id
=
0x1FF
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_1Mask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG00
);
CAN_MessageCache_Init
(
CAN0MSG00
,
&
CAN_RecvMsg
);
CAN_MessageCache_OverWriteConfig
(
CAN0MSG00
,
ENABLE
);
CAN_RecvMsg
.
Id
=
0x2FF
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_1Mask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG01
);
CAN_MessageCache_Init
(
CAN0MSG01
,
&
CAN_RecvMsg
);
CAN_MessageCache_OverWriteConfig
(
CAN0MSG01
,
ENABLE
);
CAN_RecvMsg
.
Id
=
0x3FF
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_1Mask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG02
);
CAN_MessageCache_Init
(
CAN0MSG02
,
&
CAN_RecvMsg
);
CAN_MessageCache_OverWriteConfig
(
CAN0MSG02
,
ENABLE
);
CAN_RecvMsg
.
Id
=
0x7FF
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_RecvMsg
.
CacheType
=
CAN_CacheType_Rx_1Mask
;
CAN_RecvMsg
.
RTR
=
CAN_RTR_Data
;
CAN_RecvMsg
.
Interrupt
=
ENABLE
;
CAN_MessageCache_DeInit
(
CAN0MSG03
);
CAN_MessageCache_Init
(
CAN0MSG03
,
&
CAN_RecvMsg
);
CAN_MessageCache_OverWriteConfig
(
CAN0MSG03
,
ENABLE
);
#endif
CAN_RecvMsg
.
Id
=
DIAG_ID_Rx_PHY
;
CAN_RecvMsg
.
Id
=
DIAG_ID_Rx_PHY
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
CAN_RecvMsg
.
IDE
=
CAN_Id_Standard
;
...
@@ -157,7 +215,7 @@ void Can_Tx_Apply_Buff(void)
...
@@ -157,7 +215,7 @@ void Can_Tx_Apply_Buff(void)
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_
Recv
Msg
.
Interrupt
=
DISABLE
;
CAN_
Send
Msg
.
Interrupt
=
DISABLE
;
CAN_SendMsg
.
DLC
=
8
;
CAN_SendMsg
.
DLC
=
8
;
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
{
{
...
@@ -171,7 +229,7 @@ void Can_Tx_Apply_Buff(void)
...
@@ -171,7 +229,7 @@ void Can_Tx_Apply_Buff(void)
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_
Recv
Msg
.
Interrupt
=
DISABLE
;
CAN_
Send
Msg
.
Interrupt
=
DISABLE
;
CAN_SendMsg
.
DLC
=
8
;
CAN_SendMsg
.
DLC
=
8
;
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
{
{
...
@@ -185,7 +243,7 @@ void Can_Tx_Apply_Buff(void)
...
@@ -185,7 +243,7 @@ void Can_Tx_Apply_Buff(void)
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
IDE
=
CAN_Id_Standard
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
CacheType
=
CAN_CacheType_Tx
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_SendMsg
.
RTR
=
CAN_RTR_Data
;
CAN_
Recv
Msg
.
Interrupt
=
DISABLE
;
CAN_
Send
Msg
.
Interrupt
=
DISABLE
;
CAN_SendMsg
.
DLC
=
8
;
CAN_SendMsg
.
DLC
=
8
;
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
CAN_SendMsg
.
DLC
;
i
++
)
{
{
...
...
Firmware/Source/Application/CommonInterface/CommonInterface.h
View file @
dc5851a6
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#define RMR42E_60 (0U)
/*纯电动零件号*/
#define RMR42E_60 (0U)
/*纯电动零件号*/
#define G54_A01 (1U)
/*混动零件号*/
#define G54_A01 (1U)
/*混动零件号*/
#define PART_NUMBER
RMR42E_60
/*当前程序零件号*/
#define PART_NUMBER
G54_A01
/*当前程序零件号*/
/*COMMON INTERFACE*/
/*COMMON INTERFACE*/
...
...
Firmware/Source/Application/Data_Fuel/Data_Fuel.c
View file @
dc5851a6
...
@@ -20,7 +20,18 @@ void MsgID_0x18E_Receive(void)
...
@@ -20,7 +20,18 @@ void MsgID_0x18E_Receive(void)
void
Data_Fuel_Service
(
void
)
void
Data_Fuel_Service
(
void
)
{
{
uint8_t
FuelRemainLevel
=
0U
;
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18E_Msg
))
==
CAN_SIG_NORMAL
)
{
FuelRemainLevel
=
Get_CAN_CH0_ID_18E_Sig_EMS_FuelRemainLevel
();
Fuel
.
FuelValid
=
1U
;
}
else
{
Fuel
.
FuelValid
=
0U
;
}
}
}
/******************************************************************************
/******************************************************************************
...
...
Firmware/Source/Application/Data_Soc/Data_Soc.c
View file @
dc5851a6
...
@@ -47,16 +47,20 @@ static void Data_Soc_Battery_Level_Service(void)
...
@@ -47,16 +47,20 @@ static void Data_Soc_Battery_Level_Service(void)
{
{
if
((
Get_CAN_Power_State
()
>=
KEY_ACC
)
&&
(
Get_CAN_Power_State
()
<=
CHRGEND
))
if
((
Get_CAN_Power_State
()
>=
KEY_ACC
)
&&
(
Get_CAN_Power_State
()
<=
CHRGEND
))
{
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
#if (PART_NUMBER == RMR42E_60)
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
Soc
.
Value1
=
Get_CAN_CH0_ID_18200A20_Sig_MBMS_Soc
();
{
Soc
.
Valid1
=
1U
;
Soc
.
Value1
=
Get_CAN_CH0_ID_18200A20_Sig_MBMS_Soc
();
}
Soc
.
Valid1
=
1U
;
else
}
{
else
Soc
.
Value1
=
0U
;
{
Soc
.
Valid1
=
0U
;
Soc
.
Value1
=
0U
;
}
Soc
.
Valid1
=
0U
;
}
#else
#endif
if
(
Soc
.
Valid1
!=
0U
)
if
(
Soc
.
Valid1
!=
0U
)
{
{
...
@@ -339,7 +343,11 @@ static void Data_Soc_Battery_Icon_Service(void)
...
@@ -339,7 +343,11 @@ static void Data_Soc_Battery_Icon_Service(void)
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
System_Indicator_CANFlag
!=
1
))
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
System_Indicator_CANFlag
!=
1
))
{
{
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
Soc
.
Value1
!=
0U
))
#if (PART_NUMBER == RMR42E_60)
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
Soc
.
Value1
!=
0U
))
#else
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x17A_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
Soc
.
Value1
!=
0U
))
#endif
{
{
Soc
.
Battery1Icon
=
1U
;
Soc
.
Battery1Icon
=
1U
;
}
}
...
@@ -350,10 +358,15 @@ static void Data_Soc_Battery_Icon_Service(void)
...
@@ -350,10 +358,15 @@ static void Data_Soc_Battery_Icon_Service(void)
}
}
else
else
{
{
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
&&
#if (PART_NUMBER == RMR42E_60)
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
))
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
))
#else
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x17A_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x220_Msg
))
==
CAN_SIG_NORMAL
))
#endif
{
{
MBMSStatBattWorkState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState
();
//
MBMSStatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if
((
MBMSStatBattWorkState
==
0x1U
)
||
(
MBMSStatBattWorkState
==
0x7U
))
if
((
MBMSStatBattWorkState
==
0x1U
)
||
(
MBMSStatBattWorkState
==
0x7U
))
{
{
Soc
.
Battery1Icon
=
1U
;
Soc
.
Battery1Icon
=
1U
;
...
@@ -408,9 +421,13 @@ static void Data_Soc_All_Soc_Service(void)
...
@@ -408,9 +421,13 @@ static void Data_Soc_All_Soc_Service(void)
{
{
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
Get_CAN_Power_State
()
!=
KEY_OFF
)
&&
(
Get_CAN_Power_State
()
!=
PKEY_ON
)
&&
(
System_Indicator_CANFlag
!=
1
))
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
Get_CAN_Power_State
()
!=
KEY_OFF
)
&&
(
Get_CAN_Power_State
()
!=
PKEY_ON
)
&&
(
System_Indicator_CANFlag
!=
1
))
{
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203020_Msg
))
==
CAN_SIG_NORMAL
)
#if (PART_NUMBER == RMR42E_60)
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203020_Msg
))
==
CAN_SIG_NORMAL
)
#else
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x17A_Msg
))
==
CAN_SIG_NORMAL
)
#endif
{
{
Soc
.
AllSocValue
=
Get_CAN_CH0_ID_18203020_Sig_MBMS_StatSoc
();
//
Soc.AllSocValue = Get_CAN_CH0_ID_18203020_Sig_MBMS_StatSoc();
}
}
else
else
{
{
...
...
Firmware/Source/Application/GUI_Display/GUI_Display.c
View file @
dc5851a6
...
@@ -8,21 +8,27 @@ uint8_t Charge_OFF_Flag = 0;
...
@@ -8,21 +8,27 @@ uint8_t Charge_OFF_Flag = 0;
void
TYW_Clear_Eeprom_Service
(
void
)
void
TYW_Clear_Eeprom_Service
(
void
)
{
{
uint8_t
u8MBMS_StatBattChargeState
=
0
;
#if (PART_NUMBER == RMR42E_60)
uint8_t
u8MBMS_StatBattWorkState
=
0
;
uint8_t
u8MBMS_StatBattChargeState
=
0
;
uint8_t
u8BMCU_BladeSpeedGear
=
0
;
uint8_t
u8MBMS_StatBattWorkState
=
0
;
uint16_t
u16MMCU_AccumulatedWorkHours
=
0
;
uint8_t
u8BMCU_BladeSpeedGear
=
0
;
if
(
Get_CAN_Power_State
()
==
READY
)
uint16_t
u16MMCU_AccumulatedWorkHours
=
0
;
{
if
(
Get_CAN_Power_State
()
==
READY
)
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x157_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x339_Msg
))
==
CAN_SIG_NORMAL
))
{
{
u8MBMS_StatBattChargeState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattChargeState
();
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x157_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x339_Msg
))
==
CAN_SIG_NORMAL
))
u8MBMS_StatBattWorkState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState
();
u16MMCU_AccumulatedWorkHours
=
Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours
();
u8BMCU_BladeSpeedGear
=
Get_CAN_CH0_ID_157_Sig_BMCU_BladeSpeedGear
();
if
((
u8MBMS_StatBattChargeState
==
0x7U
)
&&
(
u8MBMS_StatBattWorkState
==
0xfU
)
&&
(
u8BMCU_BladeSpeedGear
==
0x7U
)
&&
(
u16MMCU_AccumulatedWorkHours
>=
60000UL
))
{
{
g_u8TYWClearEepromFlag
=
1
;
u8MBMS_StatBattChargeState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattChargeState
();
u8MBMS_StatBattWorkState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState
();
u16MMCU_AccumulatedWorkHours
=
Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours
();
u8BMCU_BladeSpeedGear
=
Get_CAN_CH0_ID_157_Sig_BMCU_BladeSpeedGear
();
if
((
u8MBMS_StatBattChargeState
==
0x7U
)
&&
(
u8MBMS_StatBattWorkState
==
0xfU
)
&&
(
u8BMCU_BladeSpeedGear
==
0x7U
)
&&
(
u16MMCU_AccumulatedWorkHours
>=
60000UL
))
{
g_u8TYWClearEepromFlag
=
1
;
}
else
{
g_u8TYWClearEepromFlag
=
0
;
}
}
}
else
else
{
{
...
@@ -33,11 +39,9 @@ void TYW_Clear_Eeprom_Service(void)
...
@@ -33,11 +39,9 @@ void TYW_Clear_Eeprom_Service(void)
{
{
g_u8TYWClearEepromFlag
=
0
;
g_u8TYWClearEepromFlag
=
0
;
}
}
}
#else
else
{
#endif
g_u8TYWClearEepromFlag
=
0
;
}
}
}
void
Gauge_Power_SOC_pull_Display
(
void
)
void
Gauge_Power_SOC_pull_Display
(
void
)
...
...
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
View file @
dc5851a6
...
@@ -566,7 +566,11 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG)
...
@@ -566,7 +566,11 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG)
_Fun_Res
m_Res
;
_Fun_Res
m_Res
;
uint8_t
Num
;
uint8_t
Num
;
uint8_t
m8
;
uint8_t
m8
;
#if (PART_NUMBER == RMR42E_60)
if
(((
m_Flag
==
1u
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
))
||
(
checkself_seg_Flag
==
1
))
if
(((
m_Flag
==
1u
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
))
||
(
checkself_seg_Flag
==
1
))
#else
if
(((
m_Flag
==
1u
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x17A_Msg
))
==
CAN_SIG_NORMAL
))
||
(
checkself_seg_Flag
==
1
))
#endif
{
{
IC1_SEG136
=
IC_SEG_GREY
;
IC1_SEG136
=
IC_SEG_GREY
;
IC1_SEG137
=
IC_SEG_GREY
;
IC1_SEG137
=
IC_SEG_GREY
;
...
@@ -655,87 +659,91 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG)
...
@@ -655,87 +659,91 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG)
*/
*/
_Fun_Res
SEG_SET_EleDial_2SOC
(
uint8_t
m_Flag
,
uint8_t
m_SEG
)
_Fun_Res
SEG_SET_EleDial_2SOC
(
uint8_t
m_Flag
,
uint8_t
m_SEG
)
{
{
_Fun_Res
m_Res
;
#if (PART_NUMBER == RMR42E_60)
uint8_t
Num
;
_Fun_Res
m_Res
;
uint8_t
m8
;
uint8_t
Num
;
if
(((
m_Flag
==
1u
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A21_Msg
))
==
CAN_SIG_NORMAL
))
||
(
checkself_seg_Flag
==
1
))
uint8_t
m8
;
{
if
(((
m_Flag
==
1u
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A21_Msg
))
==
CAN_SIG_NORMAL
))
||
(
checkself_seg_Flag
==
1
))
IC1_SEG124
=
IC_SEG_ON
;
IC1_SEG123
=
IC_SEG_ON
;
IC1_SEG134
=
IC_SEG_GREY
;
IC1_SEG125
=
IC_SEG_GREY
;
IC1_SEG126
=
IC_SEG_GREY
;
IC1_SEG127
=
IC_SEG_GREY
;
IC1_SEG128
=
IC_SEG_GREY
;
IC1_SEG129
=
IC_SEG_GREY
;
IC1_SEG130
=
IC_SEG_GREY
;
IC1_SEG131
=
IC_SEG_GREY
;
IC1_SEG132
=
IC_SEG_GREY
;
IC1_SEG133
=
IC_SEG_GREY
;
IC1_SEG134
=
IC_SEG_GREY
;
if
((
m_SEG
==
1
)
&&
(
Common_GetIgnOnTime
()
>=
1500
)
&&
(
SOC_charge_seg_Flag
!=
1
))
{
{
if
(
FLASH_SYNC_1Hz
)
IC1_SEG124
=
IC_SEG_ON
;
{
IC1_SEG123
=
IC_SEG_ON
;
IC1_SEG134
=
IC_SEG_ON
;
IC1_SEG134
=
IC_SEG_GREY
;
}
IC1_SEG125
=
IC_SEG_GREY
;
else
IC1_SEG126
=
IC_SEG_GREY
;
{
IC1_SEG127
=
IC_SEG_GREY
;
IC1_SEG134
=
IC_SEG_GREY
;
IC1_SEG128
=
IC_SEG_GREY
;
IC1_SEG129
=
IC_SEG_GREY
;
IC1_SEG130
=
IC_SEG_GREY
;
IC1_SEG131
=
IC_SEG_GREY
;
IC1_SEG132
=
IC_SEG_GREY
;
IC1_SEG133
=
IC_SEG_GREY
;
IC1_SEG134
=
IC_SEG_GREY
;
if
((
m_SEG
==
1
)
&&
(
Common_GetIgnOnTime
()
>=
1500
)
&&
(
SOC_charge_seg_Flag
!=
1
))
{
if
(
FLASH_SYNC_1Hz
)
{
IC1_SEG134
=
IC_SEG_ON
;
}
else
{
IC1_SEG134
=
IC_SEG_GREY
;
}
}
else
{
switch
(
m_SEG
)
{
case
10u
:
IC1_SEG125
=
IC_SEG_ON
;
case
9u
:
IC1_SEG126
=
IC_SEG_ON
;
case
8u
:
IC1_SEG127
=
IC_SEG_ON
;
case
7u
:
IC1_SEG128
=
IC_SEG_ON
;
case
6u
:
IC1_SEG129
=
IC_SEG_ON
;
case
5u
:
IC1_SEG130
=
IC_SEG_ON
;
case
4u
:
IC1_SEG131
=
IC_SEG_ON
;
case
3u
:
IC1_SEG132
=
IC_SEG_ON
;
case
2u
:
IC1_SEG133
=
IC_SEG_ON
;
case
1u
:
IC1_SEG134
=
IC_SEG_ON
;
case
0u
:
break
;
default:
break
;
}
}
}
}
}
else
else
{
{
switch
(
m_SEG
)
IC1_SEG134
=
IC_SEG_OFF
;
{
IC1_SEG125
=
IC_SEG_OFF
;
IC1_SEG126
=
IC_SEG_OFF
;
case
10u
:
IC1_SEG127
=
IC_SEG_OFF
;
IC1_SEG125
=
IC_SEG_ON
;
IC1_SEG128
=
IC_SEG_OFF
;
case
9u
:
IC1_SEG129
=
IC_SEG_OFF
;
IC1_SEG126
=
IC_SEG_ON
;
IC1_SEG130
=
IC_SEG_OFF
;
case
8u
:
IC1_SEG131
=
IC_SEG_OFF
;
IC1_SEG127
=
IC_SEG_ON
;
IC1_SEG132
=
IC_SEG_OFF
;
case
7u
:
IC1_SEG133
=
IC_SEG_OFF
;
IC1_SEG128
=
IC_SEG_ON
;
IC1_SEG134
=
IC_SEG_OFF
;
case
6u
:
// 小电池
IC1_SEG129
=
IC_SEG_ON
;
IC1_SEG124
=
IC_SEG_OFF
;
case
5u
:
IC1_SEG123
=
IC_SEG_OFF
;
IC1_SEG130
=
IC_SEG_ON
;
case
4u
:
IC1_SEG131
=
IC_SEG_ON
;
case
3u
:
IC1_SEG132
=
IC_SEG_ON
;
case
2u
:
IC1_SEG133
=
IC_SEG_ON
;
case
1u
:
IC1_SEG134
=
IC_SEG_ON
;
case
0u
:
break
;
default:
break
;
}
}
}
}
else
{
IC1_SEG134
=
IC_SEG_OFF
;
IC1_SEG125
=
IC_SEG_OFF
;
IC1_SEG126
=
IC_SEG_OFF
;
IC1_SEG127
=
IC_SEG_OFF
;
IC1_SEG128
=
IC_SEG_OFF
;
IC1_SEG129
=
IC_SEG_OFF
;
IC1_SEG130
=
IC_SEG_OFF
;
IC1_SEG131
=
IC_SEG_OFF
;
IC1_SEG132
=
IC_SEG_OFF
;
IC1_SEG133
=
IC_SEG_OFF
;
IC1_SEG134
=
IC_SEG_OFF
;
// 小电池
IC1_SEG124
=
IC_SEG_OFF
;
IC1_SEG123
=
IC_SEG_OFF
;
}
return
m_Res
;
return
m_Res
;
#else
return
EX_OK
;
#endif
}
}
/**@brief 电量表盘2SOC显示函数
/**@brief 电量表盘2SOC显示函数
* @param[in] m_Flag 段与数字是否显示 -1 显示 -0 不显示
* @param[in] m_Flag 段与数字是否显示 -1 显示 -0 不显示
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment