You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.5 KiB
78 lines
2.5 KiB
/********************************* Copyright ************************************
|
|
* (C) Copyright 2024,Zhang Kai,China,Genfo.
|
|
* All Rights Reserved
|
|
*
|
|
* By(Zhang Kai)
|
|
*
|
|
* 文件名称 : cruise.h
|
|
* 版 本 : V1.0
|
|
* 日 期 : 2024-09-29
|
|
* 文件说明 : (空)
|
|
* 修改记录 : (空)
|
|
********************************************************************************/
|
|
|
|
#ifndef __CRUISE_H_
|
|
#define __CRUISE_H_
|
|
|
|
|
|
/**********************************参数及宏定义*********************************/
|
|
#define SPEED_HOLD_TIME_CNT 3000 //速度保持时间计数值(根据调用周期设置)
|
|
#define CRS_MAX_ALLOWABLE_SPEED 55 //巡航最大允许的速度,单位km/h
|
|
|
|
|
|
typedef enum
|
|
{
|
|
Invalid = 0, //无效
|
|
valid , //有效
|
|
}CrsBtnSts_e;
|
|
|
|
typedef enum
|
|
{
|
|
AutoHold = 0,
|
|
Alarmed ,
|
|
Park,
|
|
Ready,
|
|
Run,
|
|
Cruise, //定速巡航
|
|
LowPowerFront, //推车助力
|
|
LowPowerRear, //倒车助力
|
|
}RunStatus_e;
|
|
|
|
typedef struct
|
|
{
|
|
unsigned char ButtonStatus; //定速巡航按钮状态 @ref CrsBtnSts_e 0x0:Invalid 无效 0x1:valid 有效
|
|
unsigned int SpeedHoldTimeCnt; //速度保持时间计数值
|
|
unsigned char RunStatus; /*运行状态
|
|
0x0:autohold
|
|
0x1:alarmed
|
|
0x2:Park
|
|
0x3:ready
|
|
0x4:run
|
|
0x5:cruise(定速巡航)
|
|
0x6:low-power-front(推车助力)
|
|
0x7:low-power-rear(倒车助力)
|
|
*/
|
|
unsigned char HbarRange; //当前手把开度0-100%
|
|
unsigned char CurrentSpeed; //当前车速 单位:千米/时
|
|
unsigned char KmhLimit; //巡航最高车速限速千米/时
|
|
unsigned char IncSpeed; //增加巡航速度
|
|
unsigned char ReduceSpeed; //减少巡航速度
|
|
unsigned char BrakeEn; //制动使能标志 1:制动使能 0:未制动
|
|
unsigned char PullBackHbar; //回拉转把
|
|
unsigned char McuFault; //MCU故障
|
|
unsigned char SideBraceFallsDown; //边撑落下
|
|
unsigned char MaxAllowableSpeed; //系统被允许的最高测速
|
|
|
|
unsigned char AutoStatus; //自动巡航状态 0:未进入 1:已进入
|
|
unsigned char AutoEnSet; //自动巡航使能开启 0:未开启 1:已开启
|
|
} Cruise_t;
|
|
|
|
|
|
/*******************************外部参数及函数声明******************************/
|
|
extern Cruise_t Cruise_M1;
|
|
void app_cruise (Cruise_t *p);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|