Commit b3e26d59 authored by hu's avatar hu

增加K-LINE 波特率配置功能

parent 0963d6d4
......@@ -40,7 +40,14 @@ void Can_Init(void)
RSCAN0_Config_st_t CANLLCCh0Filter;
CANLLCCh0Filter.stRSCANCh0.u32RSCANChEn = 1u; /*通道是否使能*/
CANLLCCh0Filter.stRSCANCh0.enRSCANChBps = RSCAN_Baud_Rate_500K; /*通道波特率*/
if (K_Line_Set.K_Line_LID52 == 0x00u)
{
CANLLCCh0Filter.stRSCANCh0.enRSCANChBps = RSCAN_Baud_Rate_500K; /*通道波特率*/
}
else if (K_Line_Set.K_Line_LID52 == 0x01u)
{
CANLLCCh0Filter.stRSCANCh0.enRSCANChBps = RSCAN_Baud_Rate_250K; /*通道波特率*/
}
CANLLCCh0Filter.stRSCANCh0.u32RSCANChRuleSize = CANFD0_CH0_RX_RULE_SIZE; /*通道接收规则条数*/
CANLLCCh0Filter.stRSCANCh0.pfnRSCANConfirmCallBack = Can_Confirm; /*发送确认*/
CANLLCCh0Filter.stRSCANCh0.pfnRSCANAbortConfirmCallBack = 0u; /*发送中止确认*/
......@@ -60,13 +67,13 @@ void Can_Init(void)
CANLLCCh0Filter.stRSCANCh2.pfnRSCANAbortConfirmCallBack = 0u; /*发送中止确认*/
CANLLCCh0Filter.stRSCANCh2.pfnRSCANReadMsgCallBack = Can_Read_Msg2; /*接收完成*/
CANSTB_OUT = 1U; //CANSTB_OUT
CANSTB2_OUT = 1U; //CANSTB2_OUT
CANSTB_OUT = 1U; /*CANSTB_OUT*/
CANSTB2_OUT = 1U; /*CANSTB2_OUT*/
RSCAN0_CH_Init(CANFD_RX_RULE_TABLE_LIST, &CANLLCCh0Filter);
CANSTB_OUT = 0U; //CANSTB_OUT
CANSTB2_OUT = 0U; //CANSTB2_OUT
CANSTB_OUT = 0U; /*CANSTB_OUT*/
CANSTB2_OUT = 0U; /*CANSTB2_OUT*/
}
void Can_DeInit(void)
......@@ -236,4 +243,5 @@ void CAN_BUSOFF_Recover(void)
{
//CH0_BusOff_Recovery();
RSCAN0_CH0_Busoff_Recover();
RSCAN0_CH2_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