Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
haoJin750TFT
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
时昊
haoJin750TFT
Commits
0e4e8eb5
Commit
0e4e8eb5
authored
Jul 11, 2024
by
时昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加can功能,外发,接收,初始化
parent
0fb7e3f4
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
272 additions
and
266 deletions
+272
-266
Can_User.c
Firmware/Source/Application/Can_User.c
+229
-229
Can_User.h
Firmware/Source/Application/Can_User.h
+33
-33
CommonInterface.c
Firmware/Source/Application/CommonInterface.c
+1
-1
Components.h
Firmware/Source/Component/Components.h
+2
-0
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+5
-3
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+2
-0
No files found.
Firmware/Source/Application/Can_User.c
View file @
0e4e8eb5
This diff is collapsed.
Click to expand it.
Firmware/Source/Application/Can_User.h
View file @
0e4e8eb5
//
#ifndef _CAN_USER_H_
//
#define _CAN_USER_H_
//
#include "RTE.h"
//
#include "Components.h"
#ifndef _CAN_USER_H_
#define _CAN_USER_H_
#include "RTE.h"
#include "Components.h"
/
/ /
******************************************************************************
//
Bus-off
//
******************************************************************************/
//
#define RSCAN0_BUS_STABLE 0x00U
//
#define RSCAN0_BUS_OFF_LV1 0x01U
//
#define RSCAN0_BUS_OFF_LV2 0x02U
//
#define RSCAN00_BUS_LIMP 0x03U
/
/ /
******************************************************************************
//
Bus-off
//
******************************************************************************/
/******************************************************************************
Bus-off
******************************************************************************/
#define RSCAN0_BUS_STABLE 0x00U
#define RSCAN0_BUS_OFF_LV1 0x01U
#define RSCAN0_BUS_OFF_LV2 0x02U
#define RSCAN00_BUS_LIMP 0x03U
/******************************************************************************
Bus-off
******************************************************************************/
//
#define RSCAN0_BUS_OFF_LV1_RECOVERY_TIME 90U
//
#define RSCAN0_BUS_OFF_LV2_RECOVERY_TIME 1000U
#define RSCAN0_BUS_OFF_LV1_RECOVERY_TIME 90U
#define RSCAN0_BUS_OFF_LV2_RECOVERY_TIME 1000U
//
typedef struct
//
{
//
uint8_t Status;
//
uint8_t Timer;
//
uint8_t Cnt;
//
uint8_t ReportDTCCnt;
//
} RSCAN0BusoffMonitorStruct;
typedef
struct
{
uint8_t
Status
;
uint8_t
Timer
;
uint8_t
Cnt
;
uint8_t
ReportDTCCnt
;
}
RSCAN0BusoffMonitorStruct
;
//
extern void Can_Tx_Apply_Buff(void);
//
extern void Can_RX_Apply_Buff(void);
//
extern void Can_BusOff_Recover(uint8_t deltaTime);
//
extern void COM_CAN_Init(void);
//
extern void Can_Init(void);
//
extern void Can_Rx_Cak(CanTxRxMsg *Msg);
//
extern void Busoff(void);
//
extern uint8_t COM_APP_Process(st_CAN_Msg *Msg);
//
extern void Can_Write(st_CAN_Msg *Msg);
extern
void
Can_Tx_Apply_Buff
(
void
);
extern
void
Can_RX_Apply_Buff
(
void
);
extern
void
Can_BusOff_Recover
(
uint8_t
deltaTime
);
extern
void
COM_CAN_Init
(
void
);
extern
void
Can_Init
(
void
);
extern
void
Can_Rx_Cak
(
CanTxRxMsg
*
Msg
);
extern
void
Busoff
(
void
);
extern
uint8_t
COM_APP_Process
(
st_CAN_Msg
*
Msg
);
extern
void
Can_Write
(
st_CAN_Msg
*
Msg
);
//
#endif
#endif
Firmware/Source/Application/CommonInterface.c
View file @
0e4e8eb5
...
...
@@ -4,7 +4,7 @@
uint32_t
PowerIgnOnTimeLine
;
uint32_t
PowerIgnOffTimeLine
;
uint32_t
PowerIgnOffTimeLine
;
static
uint32_t
PowerSocTimeLine
;
...
...
Firmware/Source/Component/Components.h
View file @
0e4e8eb5
...
...
@@ -28,5 +28,7 @@
#include "Data_VSpeed.h"
#include "BackLight.h"
#include "RTC\RTE_RTC.h"
#include "CAN_Signal\CAN_Lib.h"
#include "CAN_CH0_CAN_Communication_Matrix.h"
#endif
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
0e4e8eb5
...
...
@@ -64,14 +64,13 @@ static void Power_KL30_Init(void)
g_stRTCInformation
.
u8RTCYear
=
20
;
//RTE_RTC_Init(g_stRTCInformation);
Menu_User_Init
();
Can_Init
();
Protocol_KL30_Wakeup_Init
();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
KL15_AD_IN
,
Trigger_Rising
);
}
//extern uint32_t PowerIgnOffTimeLine;
static
void
Power_Wakeup_Init
(
void
)
{
// PowerIgnOffTimeLine = 0;
Gpio_Init
(
Gpio_WakeUp_Init
);
eeprom_StoreInfo_Init
();
Analog_Signal_Conv_Init
();
...
...
@@ -89,6 +88,7 @@ static void Power_Wakeup_Init(void)
//Telltales_Init();
Key_KL30_Init_EXample
();
Menu_User_WAKEUP
();
Can_Init
();
Protocol_KL30_Wakeup_Init
();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
KL15_AD_IN
,
Trigger_Rising
);
}
...
...
@@ -184,6 +184,7 @@ static Power_Status_em Power_Stay_Protect(void)
/* 关闭所有外设,坪保留AD采集,电溝状思切�? */
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
0
);
CAN_TX_SetEnable
(
&
CAN_CH0_CanMsgTxOp
,
CAN_N_TX_Disable
);
}
u8PowerSts
=
EM_IGN_OFF_Init
;
/* 电溝模弝正常 */
...
...
@@ -196,6 +197,7 @@ static Power_Status_em Power_Stay_Protect(void)
if
(
SYS_OPR_STAT_RUN
)
{
CAN_TX_SetEnable
(
&
CAN_CH0_CanMsgTxOp
,
CAN_N_TX_Enable
);
return
u8PowerSts
;
}
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
0e4e8eb5
...
...
@@ -15,6 +15,8 @@ void Sys_2ms_Tasks(void)
Sys_Status_Update_Service
();
Analog_Signal_Conv_Service
();
AMT630H_Main
();
Can_Write_Fun
(
&
CAN_CH0_CanMsgTxOp
,
2000u
);
CanMSg_XMS_Analysis
(
&
CAN_CH0_CanMsgOp
,
2u
);
}
void
Sys_5ms_Tasks
(
void
)
...
...
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