Commit 538724af authored by 时昊's avatar 时昊

:sparkles: feat:增加车速转速水温功能

parent 0a780149
......@@ -668,6 +668,46 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\Source\Application\Protocol_User.c</FilePath>
</File>
<File>
<FileName>CAN_CH0_CAN_Communication_Matrix.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\Source\Application\CAN_CH0_CAN_Communication_Matrix.c</FilePath>
</File>
<File>
<FileName>CAN_CH0_CAN_Communication_Matrix.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\CAN_CH0_CAN_Communication_Matrix.h</FilePath>
</File>
<File>
<FileName>Data_ESpeed.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\Source\Application\Data_ESpeed.c</FilePath>
</File>
<File>
<FileName>Data_ESpeed.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\Data_ESpeed.h</FilePath>
</File>
<File>
<FileName>Data_VSpeed.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\Source\Application\Data_VSpeed.c</FilePath>
</File>
<File>
<FileName>Data_VSpeed.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\Data_VSpeed.h</FilePath>
</File>
<File>
<FileName>Data_Coolant.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\Source\Application\Data_Coolant.c</FilePath>
</File>
<File>
<FileName>Data_Coolant.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\Data_Coolant.h</FilePath>
</File>
</Files>
</Group>
<Group>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
#ifndef CAN_CH0_CAN_COMMUNICATION_MATRIX_H_
#define CAN_CH0_CAN_COMMUNICATION_MATRIX_H_
#include "Components.h"
#include "CAN_Signal\CAN_Lib.h"
extern st_CanMsgOp CAN_CH0_CanMsgOp;
extern st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
typedef enum
{
CAN_CH0_ID_CH0_101_Msg_Count,
CAN_CH0_ID_CH0_111_Msg_Count,
CAN_CH0_ID_CH0_401_Msg_Count,
CAN_CH0_ID_CH0_402_Msg_Count,
CAN_CH0_ID_CH0_37B_Msg_Count,
CAN_CH0_ID_CH0_12B_Msg_Count,
CAN_CH0_ID_CH0_450_Msg_Count,
CAN_CH0_ID_TOTAL_MAX,
} CAN_CH0_CAN_MSG_ID_t;
typedef enum
{
TEST,
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_CH0_101_Msg 0x101ul
#define CAN_CH0_ID_CH0_111_Msg 0x111ul
#define CAN_CH0_ID_CH0_401_Msg 0x401ul
#define CAN_CH0_ID_CH0_402_Msg 0x402ul
#define CAN_CH0_ID_CH0_37B_Msg 0x37Bul
#define CAN_CH0_ID_CH0_12B_Msg 0x12Bul
#define CAN_CH0_ID_CH0_450_Msg 0x450ul
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_101_Checksum(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_101_Livecounter(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature_State(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Throttle_Position_State(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Vehicle_Speed_State(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Engine_Speed_State(void);
extern uint16_t Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Throttle_Position(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Vehicle_Speed(void);
extern uint16_t Get_CAN_CH0_ID_101_Sig_ECU_Engine_Speed(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_111_Checksum(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_111_Livecounter(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Tair_Enable(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Power_Enable(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_SideStand(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Power(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Ready(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Batt(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Engine_Autostop_State(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Engine_InjIgn_Cutoff_State(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Engine_Autostop(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Engine_InjIgn_Cutoff(void);
extern uint8_t Get_CAN_CH0_ID_401_Sig_ECU_401_Checksum(void);
extern uint8_t Get_CAN_CH0_ID_401_Sig_ECU_401_Livecounter(void);
extern uint16_t Get_CAN_CH0_ID_401_Sig_ECU_Fuel_Consumption(void);
extern uint8_t Get_CAN_CH0_ID_401_Sig_ECU_Battery_Voltage(void);
extern uint16_t Get_CAN_CH0_ID_401_Sig_ECU_Environment_Presure(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_Warning_Lamp(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCL2(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCM2(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCH2(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTC1Amnt(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCL1(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCM1(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCH1(void);
extern uint8_t Get_CAN_CH0_ID_37B_Sig_TCS_37B_Checksum(void);
extern uint8_t Get_CAN_CH0_ID_37B_Sig_TCS_37B_Livecounter(void);
extern uint8_t Get_CAN_CH0_ID_37B_Sig_TCS_Control(void);
extern uint16_t Get_CAN_CH0_ID_37B_Sig_TCS_Target_Torque(void);
extern uint8_t Get_CAN_CH0_ID_12B_Sig_Abs_warning_lamp(void);
extern uint8_t Get_CAN_CH0_ID_450_Sig_Dashboard_TCSFunSwitch(void);
extern uint8_t Get_CAN_CH0_ID_450_Sig_ABSOFF_Selection(void);
extern uint8_t Co_Can_ConvertSubID_CAN_CH0(uint32_t MsgID);
#endif
This diff is collapsed.
#ifndef DATA_COOLANT_H
#define DATA_COOLANT_H
#include "stdint.h"
typedef enum{
FuelSensorNormal = 0,
FuelSensorShortCircuit,
FuelSensorOpenCircuit,
}FuelSensorSts_t;
extern void Fuel_KL15_Init(void);
extern void Fuel_KL30_Init(void);
extern void Fuel_Cal_Sevice(uint8_t deltaTime);
extern uint8_t Get_CurFuelSetp(void);
extern FuelSensorSts_t Get_Fuel_Sensor_State(void);
void Fuel_R_Cal(uint8_t deltaTime);
#endif
This diff is collapsed.
#ifndef _Data_Espeed_H_
#define _Data_Espeed_H_
#include "common.h"
/******************************************************************************
发动机转速
******************************************************************************/
/*** 参数设置 ***/
#define DATA_ENGINE_RUNNING_THRESHOLD 400 //发动机运转阈值
#define DATA_ENGINE_STOP_THRESHOLD 300 //发动机停止阈值
#define DATA_ESPEED_DAMPING_FACTOR 4 //阻尼系数
#define DATA_ESPEED_INC_STEP 10 //速度增加时慢加速速度变化步长
#define DATA_ESPEED_DEC_STEP 20 //方向改变时急减速速度变化步长
#define DATA_ESPEED_APPR_SPEED_MIN 10 //最小逼近速度
#define DATA_ESPEED_HYSTERESIS 80 //回差
/*** 控制结构 ***/
typedef struct
{
uint16_t Buffer[5];
uint8_t Cnt;
} DataESpeedSamplerStruct; //转速采样结构
typedef struct
{
uint16_t Speed;
uint16_t Delta;
uint8_t Dir;
} DataESPeedDampingStruct; //转速阻尼结构
typedef struct
{
uint16_t ESpeedBackup;
uint16_t Timer;
uint8_t Mode;
} DataESpeedIdleStruct; //怠速处理结构
/******************************************************************************
函数名:Data_Engine_Speed_KL30_Wakeup_Init
功 能:发动机转速初始化函数
参 数:无
返回值:无
******************************************************************************
注 意:该函数KL30初始化/Wakeup初始化被调用一次
******************************************************************************/
void Data_Engine_Speed_KL30_Wakeup_Init (void);
/******************************************************************************
函数名:Data_Engine_Speed_Processing_Service
功 能:发动机转速数据处理函数
参 数:无
返回值:无
******************************************************************************
注 意:该函数必须每20ms被调用一次
******************************************************************************/
void Data_Engine_Speed_Processing_Service ( void );
uint8_t Get_EngineValid(void);
uint16_t Get_ActualEngineSpeed(void);
uint16_t Get_DispEngineSpeed(void);
#endif
This diff is collapsed.
#ifndef _Data_Vspeed_H_
#define _Data_Vspeed_H_
#include "common.h"
/*** 参数设置 ***/
#define DATA_VEHICLE_RUNNING_THRESHOLD 25 //汽车行进阈值
#define DATA_VEHICLE_STOP_THRESHOLD 20 //汽车停止阈值
#define DATA_VSPEED_DAMPING_FACTOR 3 //阻尼系数
#define DATA_VSPEED_INC_STEP 2 //速度增加时慢加速速度变化步长
#define DATA_VSPEED_DEC_STEP 6 //方向改变时急减速速度变化步长
#define DATA_VSPEED_APPR_SPEED_MIN 2 //最小逼近速度
#define DATA_VSPEED_HYSTERESIS 10 //回差
/*** 控制结构 ***/
typedef struct
{
uint16_t Timer;
uint16_t Timer1;
uint16_t Backup;
uint16_t Buffer[3];
uint8_t Cnt;
} DataVSpeedSamplerStruct; //车速采样结构
typedef struct
{
uint16_t Speed;
uint16_t Delta;
uint8_t Dir;
} DataVSPeedDampingStruct; //车速阻尼结构
/******************************************************************************
Data_Vehicle_Speed_KL30_Wakeup_Init
功 能:车速数据KL30_Wakeup_Init
参 数:无
返回值:无
******************************************************************************
注 意:该函数KL30_Wakeup_Init被调用一次
******************************************************************************/
void Data_Vehicle_Speed_KL30_Wakeup_Init(void);
/******************************************************************************
函数名:Data_Vehicle_Speed_Processing_Service
功 能:车速数据处理函数
参 数:无
返回值:无
******************************************************************************
注 意:该函数必须每20ms被调用一次
******************************************************************************/
void Data_Vehicle_Speed_Processing_Service(void);
uint8_t Get_VechileSpeedValid(void);
/*真实的车速,精度10倍,*/
uint16_t Get_ActualVechileSpeed(void);
/*显示车速,精度10倍,取整,舍去小数点*/
uint16_t Get_DispVechileSpeed(void);
uint16_t Get_DispVechileSpeed_Mile(void);
#endif
......@@ -20,7 +20,8 @@
#include "CommonInterface.h"
#include "Menu\Menu.h"
#include "Flash_synchronizer\Flash_synchronizer.h"
#include "Data_ESpeed.h"
#include "Data_VSpeed.h"
#endif
......@@ -50,18 +50,18 @@ static void Power_KL30_Init(void)
BackLight_Init();
// Sys_KL30_Init();
// Checkself_Init();
//Data_Vehicle_Speed_KL30_Init();
//Data_Engine_Speed_KL30_Init();
Data_Vehicle_Speed_KL30_Wakeup_Init();
Data_Engine_Speed_KL30_Wakeup_Init();
// LINE_IN_Init();
Key_KL30_Init_EXample();
//Light_Sensor_Init_Example();//注意顺序1
Data_User_Mileage_KL30Init();
Fuel_KL30_Init();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
// Telltales_Auto_Start_Stop();
// Telltales_Init();
// MenuData_Unit_Init();
// g_stRTCInformation.u8RTCSecond = 0;
......@@ -87,12 +87,11 @@ static void Power_Wakeup_Init(void)
BackLight_Init();
// Sys_WakeUp_Init();
// Data_Vehicle_Speed_KL30_Init();
// Data_Engine_Speed_KL30_Init();
Data_Vehicle_Speed_KL30_Wakeup_Init();
Data_Engine_Speed_KL30_Wakeup_Init();
// LINE_IN_Init();
Key_Wakeup_Init_EXample();
Line_In_KL15_ON_Init();
//Light_Sensor_Init_Example();//注意顺序1
Fuel_KL30_Init();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
......@@ -114,21 +113,16 @@ static void Power_OVP_Init(void)
static void Power_IG_OFF_Init(void)
{
Line_In_KL15_OFF_Init();
// Checkself_Init();
}
static void Power_IG_ON_Init(void)
{
// ClearODO_Flag = 0;
BackLight_Init();
// Checkself_Init();
Line_In_KL15_ON_Init();
// Telltales_KL15_Init();
Telltales_KL15_Init();
Fuel_KL15_Init();
// Telltales_Auto_Start_Stop();
// Data_Vehicle_Speed_KL15_Init();
// Data_Engine_Speed_KL15_Init();
}
static void Power_Sleep_Init(void)
......
......@@ -28,7 +28,8 @@ void Sys_10ms_Tasks(void)
void Sys_20ms_Tasks(void)
{
Data_Vehicle_Speed_Processing_Service();
Data_Engine_Speed_Processing_Service();
}
void Sys_50ms_Tasks(void)
......
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