|
|
|
@ -1,13 +1,110 @@
|
|
|
|
|
/*********************************************************
|
|
|
|
|
*** 赛鸽 6个CAN协议:general_cmd,MC,BMS,VCU,HIMI,ABS,灯控盒,雷达, **********
|
|
|
|
|
*** V1.10 **********
|
|
|
|
|
**********************************************************/
|
|
|
|
|
/****************************************************************************************
|
|
|
|
|
*** 赛鸽 12个CAN协议:general_cmd,MC,BMS,VCU,HIMI,ABS,灯控盒BCM,雷达,BMS扩展,充电器扩展
|
|
|
|
|
*** 前照灯0x0B,尾灯0x0C
|
|
|
|
|
|
|
|
|
|
*****************************************************************************************/
|
|
|
|
|
#ifndef __JW_CAN_H__
|
|
|
|
|
#define __JW_CAN_H__
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
|
//充电状态
|
|
|
|
|
typedef enum {
|
|
|
|
|
No_req = 0x0,
|
|
|
|
|
Charging = 0x1,
|
|
|
|
|
Chg_full = 0x2,
|
|
|
|
|
Off_light = 0x3
|
|
|
|
|
}charg_state;
|
|
|
|
|
|
|
|
|
|
/* 灯光颜色枚举(与协议对应) */
|
|
|
|
|
typedef enum {
|
|
|
|
|
COLOR_NO_REQUEST = 0x0,
|
|
|
|
|
COLOR_WHITE = 0x1,
|
|
|
|
|
COLOR_1 = 0x2,
|
|
|
|
|
COLOR_2 = 0x3,
|
|
|
|
|
COLOR_3 = 0x4,
|
|
|
|
|
COLOR_4 = 0x5,
|
|
|
|
|
COLOR_5 = 0x6,
|
|
|
|
|
COLOR_6 = 0x7,
|
|
|
|
|
COLOR_7 = 0x8,
|
|
|
|
|
COLOR_RANDOM = 0x9,
|
|
|
|
|
COLOR_RESERVED = 0xA // 0xA~0xF均为保留值
|
|
|
|
|
} color_set;
|
|
|
|
|
|
|
|
|
|
/* 功能开关状态 */
|
|
|
|
|
typedef enum {
|
|
|
|
|
FUNC_OFF = 0x00, //关闭功能
|
|
|
|
|
FUNC_ON = 0x01, //开启功能
|
|
|
|
|
FUNC_INVALID = 0x03 //无效设置
|
|
|
|
|
}fun_sta; //功能状态
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
No_Req = 0x00,
|
|
|
|
|
Req_on = 0x01,
|
|
|
|
|
Req_off = 0x02,
|
|
|
|
|
Rsv = 0X03
|
|
|
|
|
}Rq_sta; //请求状态
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
no_req = 0x0,
|
|
|
|
|
white_until = 0x1, //白光常亮
|
|
|
|
|
yellow_until = 0x2, //黄光常亮
|
|
|
|
|
white_flash = 0x3, //白光闪烁
|
|
|
|
|
yellow_flash = 0x4, //黄光闪烁
|
|
|
|
|
req_off = 0x5 //请求关闭
|
|
|
|
|
}upper_set; //前照灯远光
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
sanyuan = 0x00, //三元
|
|
|
|
|
LiFePO = 0x01, //磷酸铁锂
|
|
|
|
|
LMO, //锰酸锂
|
|
|
|
|
LFMP, //磷酸锰铁锂
|
|
|
|
|
sealed, //铅酸
|
|
|
|
|
NiH, //镍氢
|
|
|
|
|
LiCoO, //钴酸锂
|
|
|
|
|
LiTiO, //钛酸锂
|
|
|
|
|
Na, //钠离子
|
|
|
|
|
solid, //固态
|
|
|
|
|
Multic_dop //多元掺杂
|
|
|
|
|
}battery_type;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
mos_off = 0x00,
|
|
|
|
|
mos_on = 0x01,
|
|
|
|
|
rsv = 0x02,
|
|
|
|
|
Void = 0x03
|
|
|
|
|
}mos_sta;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
INvalid = 0x00,
|
|
|
|
|
valid = 0x01
|
|
|
|
|
}effecf; //有效、无效
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
Not = 0x00, //无该包
|
|
|
|
|
Free, //空闲
|
|
|
|
|
Discharge, //放电
|
|
|
|
|
Charge, //充电
|
|
|
|
|
Feedback, //回馈
|
|
|
|
|
Off_line, //离线
|
|
|
|
|
Unincorporated, //未并入
|
|
|
|
|
Heat //加热
|
|
|
|
|
}work_state;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
Nott = 0x00, //无该包
|
|
|
|
|
One_chg, //单包充电
|
|
|
|
|
One_dischg, //单包放电
|
|
|
|
|
Two_chg, //双包充电
|
|
|
|
|
Two_dischg, //双包放电
|
|
|
|
|
three_chg, //三包充电
|
|
|
|
|
three_dischg, //三包放电
|
|
|
|
|
four_chg, //四包充电
|
|
|
|
|
four_dischg, //四包放电
|
|
|
|
|
}parallel_sta;//并机状态
|
|
|
|
|
|
|
|
|
|
/******************* 通用命令 general_cmd *******************/
|
|
|
|
|
typedef struct{
|
|
|
|
|
struct{
|
|
|
|
@ -49,44 +146,6 @@ typedef struct{
|
|
|
|
|
}OTA_cmd_0x10;
|
|
|
|
|
|
|
|
|
|
/******************* MC *******************/
|
|
|
|
|
//功能开关选项
|
|
|
|
|
typedef enum {
|
|
|
|
|
Off = 0x00, // 关闭功能
|
|
|
|
|
On = 0x01, // 开启功能
|
|
|
|
|
Invalid = 0x03 // 无效设置
|
|
|
|
|
}Fun_State;
|
|
|
|
|
|
|
|
|
|
/* 灯光颜色枚举(与协议对应) */
|
|
|
|
|
typedef enum {
|
|
|
|
|
COLOR_NO_REQUEST = 0x0,
|
|
|
|
|
COLOR_WHITE = 0x1,
|
|
|
|
|
COLOR_1 = 0x2,
|
|
|
|
|
COLOR_2 = 0x3,
|
|
|
|
|
COLOR_3 = 0x4,
|
|
|
|
|
COLOR_4 = 0x5,
|
|
|
|
|
COLOR_5 = 0x6,
|
|
|
|
|
COLOR_6 = 0x7,
|
|
|
|
|
COLOR_7 = 0x8,
|
|
|
|
|
COLOR_RANDOM = 0x9,
|
|
|
|
|
COLOR_RESERVED = 0xA // 0xA~0xF均为保留值
|
|
|
|
|
} color_set;
|
|
|
|
|
|
|
|
|
|
/* 功能开关状态 */
|
|
|
|
|
typedef enum {
|
|
|
|
|
FUNC_OFF = 0x00,
|
|
|
|
|
FUNC_ON = 0x01,
|
|
|
|
|
FUNC_INVALID= 0x03
|
|
|
|
|
}Rq_sta; //请求状态
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
no_req = 0x0,
|
|
|
|
|
white_until = 0x1,
|
|
|
|
|
yellow_until = 0x2,
|
|
|
|
|
white_flash = 0x3,
|
|
|
|
|
yellow_flash = 0x4,
|
|
|
|
|
req_off = 0x5
|
|
|
|
|
}upper_set; //前照灯远光
|
|
|
|
|
|
|
|
|
|
// 功能开关设置(0x20_0x01)
|
|
|
|
|
typedef struct {
|
|
|
|
|
struct {
|
|
|
|
@ -294,7 +353,7 @@ typedef struct{
|
|
|
|
|
uint8_t chg_time_remain; //充电剩余时间
|
|
|
|
|
}BMS_RealTime_status3_0x2303; //实时状态3 1000ms
|
|
|
|
|
|
|
|
|
|
//BMS扩展帧
|
|
|
|
|
/***********************BMS扩展帧*****************************/
|
|
|
|
|
typedef struct {
|
|
|
|
|
uint8_t main_hw_ver; // byte0: 主硬件版本 (0-99)
|
|
|
|
|
uint8_t sub_hw_ver; // byte1: 次硬件版本 (0-99)
|
|
|
|
@ -330,51 +389,14 @@ typedef struct{
|
|
|
|
|
uint8_t sn[4];
|
|
|
|
|
}BMS_sn_num; //BMS序列号 2000ms
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
sanyuan = 0x00, //三元
|
|
|
|
|
LiFePO = 0x01, //磷酸铁锂
|
|
|
|
|
LMO, //锰酸锂
|
|
|
|
|
LFMP, //磷酸锰铁锂
|
|
|
|
|
sealed, //铅酸
|
|
|
|
|
NiH, //镍氢
|
|
|
|
|
LiCoO, //钴酸锂
|
|
|
|
|
LiTiO, //钛酸锂
|
|
|
|
|
Na, //钠离子
|
|
|
|
|
solid, //固态
|
|
|
|
|
Multic_dop //多元掺杂
|
|
|
|
|
}battery_type;
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
uint16_t vol; //额定电压
|
|
|
|
|
uint8_t cap; //额定容量
|
|
|
|
|
uint8_t series_num; //串联数量
|
|
|
|
|
uint8_t parallel_num; //并联数量
|
|
|
|
|
battery_type bat_type; //电池类型
|
|
|
|
|
battery_type bat_type; //电池类型
|
|
|
|
|
}BMS_Nominal_para; //额定参数 2000ms
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
Not = 0x00, //无该包
|
|
|
|
|
Free, //空闲
|
|
|
|
|
Discharge, //放电
|
|
|
|
|
Charge, //充电
|
|
|
|
|
Feedback, //回馈
|
|
|
|
|
Off_line, //离线
|
|
|
|
|
Unincorporated, //未并入
|
|
|
|
|
Heat //加热
|
|
|
|
|
}work_state;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
Nott = 0x00, //无该包
|
|
|
|
|
One_chg, //单包充电
|
|
|
|
|
One_dischg, //单包放电
|
|
|
|
|
Two_chg, //双包充电
|
|
|
|
|
Two_dischg, //双包放电
|
|
|
|
|
three_chg, //三包充电
|
|
|
|
|
three_dischg, //三包放电
|
|
|
|
|
four_chg, //四包充电
|
|
|
|
|
four_dischg, //四包放电
|
|
|
|
|
}parallel_sta;//并机状态
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
work_state sta0;
|
|
|
|
|
work_state sta1;
|
|
|
|
@ -403,18 +425,6 @@ typedef struct{
|
|
|
|
|
//总电池允许最大允许回馈电流
|
|
|
|
|
}BMS_SOP; //SOP汇总 100ms
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
mos_off = 0x00,
|
|
|
|
|
mos_on = 0x01,
|
|
|
|
|
rsv = 0x02,
|
|
|
|
|
Void = 0x03
|
|
|
|
|
}mos_sta;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
INvalid = 0x00,
|
|
|
|
|
valid = 0x01
|
|
|
|
|
}effecf; //有效、无效
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
uint16_t vol;
|
|
|
|
|
int16_t cur;
|
|
|
|
@ -474,7 +484,6 @@ typedef struct{
|
|
|
|
|
}BMS_temp_vaule; //温度值 500ms
|
|
|
|
|
|
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
struct {
|
|
|
|
|
// Byte 0
|
|
|
|
@ -520,7 +529,6 @@ typedef struct {
|
|
|
|
|
uint8_t pre_OC:1; // B4.7,预充过流
|
|
|
|
|
}b4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Byte 5 (单比特标志位)
|
|
|
|
|
struct {
|
|
|
|
|
uint8_t AFE_OV :1; // B5.0
|
|
|
|
@ -533,7 +541,6 @@ typedef struct {
|
|
|
|
|
uint8_t AFE_DOT:1; // B5.7
|
|
|
|
|
}b5;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Byte 6 (单比特标志位)
|
|
|
|
|
struct {
|
|
|
|
|
uint8_t AFE_DLT:1; // B6.0
|
|
|
|
@ -659,11 +666,11 @@ typedef struct{
|
|
|
|
|
|
|
|
|
|
/******************* ABS *******************/
|
|
|
|
|
typedef struct{
|
|
|
|
|
Fun_State fun_switch1;
|
|
|
|
|
Rq_sta fun_switch1;
|
|
|
|
|
}ABS_fun_swit_set_0x2001; //功能开关设置
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
Fun_State fun_switch2;
|
|
|
|
|
Rq_sta fun_switch2;
|
|
|
|
|
}ABS_sys_info_0x2201; //系统信息 1000ms
|
|
|
|
|
|
|
|
|
|
// 实时状态标志位结构体(内存对齐优化)
|
|
|
|
@ -675,57 +682,71 @@ typedef struct {
|
|
|
|
|
}ABS_RealTime_Status1_0x2301; //实时状态1 200ms
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
|
|
/******************* 灯控盒 *******************/
|
|
|
|
|
/******************* 灯控盒BCM *******************/
|
|
|
|
|
typedef struct{
|
|
|
|
|
struct {
|
|
|
|
|
uint8_t system_enable : 2; // bit0-1
|
|
|
|
|
uint8_t reserved : 6;
|
|
|
|
|
} switch_status; // 灯控系统开关
|
|
|
|
|
fun_sta led_ctrl_sys:2; //灯控系统开关
|
|
|
|
|
uint8_t rsv1:6;
|
|
|
|
|
}switch_t;
|
|
|
|
|
color_set front_corridor:4; // 前照灯示廓灯 (bit0-3)
|
|
|
|
|
color_set front_LOGO:4; // 前照灯LOGO灯 (bit4-7)
|
|
|
|
|
color_set front_thick_wall:4; // 前照灯厚壁灯 (bit0-3)
|
|
|
|
|
color_set back_corridor:4; // 尾灯示廓灯 (bit4-7)
|
|
|
|
|
color_set back_LOGO:4; // 尾灯LOGO灯 (bit0-3)
|
|
|
|
|
}LED_fun_swit_set_0x2001;
|
|
|
|
|
uint8_t rsv2:4;
|
|
|
|
|
uint8_t storage_ontime; //储物灯亮灯时间 默认60
|
|
|
|
|
uint8_t flash_frequency; //闪灯频率
|
|
|
|
|
}BCM_fun_set_0x2001;
|
|
|
|
|
|
|
|
|
|
/* 灯光配置结构体 */
|
|
|
|
|
typedef struct{
|
|
|
|
|
Rq_sta low_beam:4;
|
|
|
|
|
upper_set high_beam:4;
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta low_beam:4; //近光灯(bit0-3)
|
|
|
|
|
upper_set upper_beam:4; //远光(bit4-7)
|
|
|
|
|
}front_t1; //byte0 前照灯
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta left_beam:2; //前照灯左转向灯(bit0-1)
|
|
|
|
|
Rq_sta left_side:2; //前照灯左侧指示灯(bit2-3)
|
|
|
|
|
Rq_sta left_fill:2; //前照灯左侧补光灯(bit4-5)
|
|
|
|
|
Rq_sta right_beam:2; //前照灯右转向灯(bit6-7)
|
|
|
|
|
Rq_sta left_beam:2; //前照灯左转向灯(bit0-1)
|
|
|
|
|
Rq_sta left_indicator:2; //前照灯左侧指示灯(bit2-3)
|
|
|
|
|
Rq_sta left_side_fill:2; //前照灯左侧补光灯(bit4-5)
|
|
|
|
|
Rq_sta right_beam:2; //前照灯右转向灯(bit6-7)
|
|
|
|
|
}front_t2; //byte1
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta right_side:2; //前照灯右侧指示灯(bit0-1)
|
|
|
|
|
Rq_sta right_fill:2; //前照灯右侧补光灯(bit2-3)
|
|
|
|
|
Rq_sta both_side:2; //前照灯两侧示廓灯(bit4-5)
|
|
|
|
|
Rq_sta LOGO_beam:2; //前照灯LOGO灯(bit6-7)
|
|
|
|
|
Rq_sta right_indicator:2; //前照灯右侧指示灯(bit0-1)
|
|
|
|
|
Rq_sta right_fill:2; //前照灯右侧补光灯(bit2-3)
|
|
|
|
|
Rq_sta both_side:2; //前照灯两侧示廓灯(bit4-5)
|
|
|
|
|
Rq_sta LOGO_beam:2; //前照灯LOGO灯(bit6-7)
|
|
|
|
|
}front_t3; //byte2
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta thick_wall:2; //前照灯厚壁灯(bit0-1)
|
|
|
|
|
Rq_sta drive_lamp:2; //尾灯行车灯(bit2-3)
|
|
|
|
|
Rq_sta stop_lamp:2; //尾灯制动灯(bit4-5)
|
|
|
|
|
Rq_sta left_t:2; //尾灯左转(bit6-7)
|
|
|
|
|
Rq_sta thick_wall:2; //前照灯厚壁灯(bit0-1)
|
|
|
|
|
Rq_sta tail_drive:2; //尾灯行车灯(bit2-3)
|
|
|
|
|
Rq_sta tail_brake:2; //尾灯制动灯(bit4-5)
|
|
|
|
|
Rq_sta left_t:2; //尾灯左转(bit6-7)
|
|
|
|
|
}back_t1;
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta right_t:2; //尾灯右转(bit0-1)
|
|
|
|
|
Rq_sta corridor_t:2; //尾灯示廓灯(bit2-3)
|
|
|
|
|
Rq_sta logo_t:2; //尾灯LOGO灯(bit4-5)
|
|
|
|
|
Rq_sta right_t:2; //尾灯右转(bit0-1)
|
|
|
|
|
Rq_sta tail_outline:2; //尾灯示廓灯(bit2-3)
|
|
|
|
|
Rq_sta tail_logo:2; //尾灯LOGO灯(bit4-5)
|
|
|
|
|
Rq_sta left_t:2; //左转灯(bit6-7)
|
|
|
|
|
}back_t2;
|
|
|
|
|
}LED_fun_cotrol_0x2101;
|
|
|
|
|
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta right_t:2; //右转灯(bit0-1)
|
|
|
|
|
Rq_sta front_projection:2; //前投影灯(bit2-3)
|
|
|
|
|
Rq_sta rear_projection:2; //后投影灯(bit4-5)
|
|
|
|
|
Rq_sta ambient_light:2; //氛围灯(bit6-7)
|
|
|
|
|
}led_t;
|
|
|
|
|
charg_state charg_indicator:2; //充电指示灯
|
|
|
|
|
Rq_sta drive_lamp:2; //行车灯
|
|
|
|
|
}BCM_fun_ctrl_0x2101; //功能控制 50ms
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
Fun_State light_ctrl_box;//灯控盒
|
|
|
|
|
}LED_sys_info_t; //系统信息 1000ms
|
|
|
|
|
struct {
|
|
|
|
|
fun_sta led_ctrl_sys:2; //灯控系统开关
|
|
|
|
|
uint8_t rsv1:6;
|
|
|
|
|
}switch_t;
|
|
|
|
|
uint8_t storage_ontime; //储物灯亮灯时间 默认60
|
|
|
|
|
uint8_t flash_frequency; //闪灯频率
|
|
|
|
|
}BCM_sys_info_0x2201; //系统信息 1000ms
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
struct{
|
|
|
|
|
uint16_t light_t:1; //灯光总开关/尾灯开关
|
|
|
|
|
struct{
|
|
|
|
|
uint16_t main_tail:1; //灯光总开关/尾灯开关
|
|
|
|
|
uint16_t high_beam:1; //远光灯开关
|
|
|
|
|
uint16_t left_turn:1; //左转开关
|
|
|
|
|
uint16_t right_turn:1; //右转开关
|
|
|
|
@ -734,41 +755,138 @@ typedef struct{
|
|
|
|
|
uint16_t rsv:10;
|
|
|
|
|
}switch_input;
|
|
|
|
|
struct{
|
|
|
|
|
uint16_t tail_on:1; //尾灯开启
|
|
|
|
|
uint16_t high_beam_on:1; //远光灯开启
|
|
|
|
|
uint16_t left_turn_on:1; //左转开启
|
|
|
|
|
uint16_t right_turn_on:1; //右转开启
|
|
|
|
|
uint16_t low_beam_on:1; //近光灯开启
|
|
|
|
|
uint16_t rsv:11;
|
|
|
|
|
uint16_t tail_on:1; //尾灯开启
|
|
|
|
|
uint16_t high_beam_on:1; //远光灯开启
|
|
|
|
|
uint16_t left_turn_on:1; //左转开启
|
|
|
|
|
uint16_t right_turn_on:1; //右转开启
|
|
|
|
|
uint16_t low_beam_on:1; //近光灯开启
|
|
|
|
|
uint16_t front_projector:2; //前投影灯(bit2-3)
|
|
|
|
|
uint16_t rear_projector:2; //后投影灯(bit4-5)
|
|
|
|
|
uint16_t ambient_light:2; //氛围灯(bit6-7)
|
|
|
|
|
uint16_t rsv:8;
|
|
|
|
|
}output_state;
|
|
|
|
|
struct{
|
|
|
|
|
uint32_t signal_left:1; //前转向灯左转故障
|
|
|
|
|
uint32_t signal_right:1; //前转向灯右转故障
|
|
|
|
|
uint32_t tail_left:1; //尾灯转向灯左转故障
|
|
|
|
|
uint32_t tail_right:1; //尾灯向灯右转故障
|
|
|
|
|
uint32_t dip_beam:1; //近光灯故障
|
|
|
|
|
uint32_t high_white_light:1; //远光灯白灯故障
|
|
|
|
|
uint32_t high_yellow_light:1; //远光灯黄灯故障
|
|
|
|
|
uint32_t headlight_OC:1; //行车灯过流故障
|
|
|
|
|
|
|
|
|
|
uint32_t LV_supply:1; //供电电压低故障
|
|
|
|
|
uint32_t OV_supply:1; //供电电压高故障
|
|
|
|
|
uint32_t left_OC:1; //左后视镜灯过流故障
|
|
|
|
|
uint32_t right_OC:1; //右后视镜灯过流故障
|
|
|
|
|
uint32_t storage_light_OC:1; //储物灯过流故障
|
|
|
|
|
uint32_t projector_OC_1:1; //投影灯1过流故障
|
|
|
|
|
uint32_t projector_OC_2:1; //投影灯2过流故障
|
|
|
|
|
uint32_t left_side_OC:1; //左侧补光灯过流故障
|
|
|
|
|
|
|
|
|
|
uint32_t right_side_OC:1; //右侧补光灯过流故障
|
|
|
|
|
uint32_t brake_OC:1; //制动灯过流故障
|
|
|
|
|
uint32_t horn_OC:1; //喇叭过流故障
|
|
|
|
|
uint32_t fan_OC:1; //风扇过流故障
|
|
|
|
|
uint32_t high_OC:1; //高刹过流故障
|
|
|
|
|
uint32_t ctrl_message_loss:1; //中控报文丢失故障
|
|
|
|
|
uint32_t radar_message_lost:1; //雷达报文丢失故障
|
|
|
|
|
uint32_t stuck_horn_switch:1; //喇叭开关卡滞故障
|
|
|
|
|
uint32_t seat_cushion_OH:1; //坐垫加热过流故障
|
|
|
|
|
uint32_t wrench_OH_OC:1; //转把加热过流故障
|
|
|
|
|
uint32_t rsv:6;
|
|
|
|
|
}fault_t;
|
|
|
|
|
|
|
|
|
|
}LED_realtime_status1_0x2301; //50ms
|
|
|
|
|
/******************* 前照灯0x0B *******************/
|
|
|
|
|
typedef struct{
|
|
|
|
|
struct {
|
|
|
|
|
fun_sta system_enable : 2; // bit0-1
|
|
|
|
|
uint8_t reserved : 6;
|
|
|
|
|
} switch_status; // 灯控系统开关
|
|
|
|
|
color_set front_corridor:4; // 前照灯示廓灯 (bit0-3)
|
|
|
|
|
color_set front_LOGO:4; // 前照灯LOGO灯 (bit4-7)
|
|
|
|
|
color_set front_thick_wall:4; // 前照灯厚壁灯 (bit0-3)
|
|
|
|
|
color_set back_corridor:4; // 尾灯示廓灯 (bit4-7)
|
|
|
|
|
color_set back_LOGO:4; // 尾灯LOGO灯 (bit0-3)
|
|
|
|
|
}HEAD_fun_swit_set_0x2001; //功能开关设置
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta low_beam:2; //前照灯近光灯(bit0-1)
|
|
|
|
|
uint8_t rsv1:2;
|
|
|
|
|
upper_set upper_beam:3; //前照灯近光灯(bit4-7)
|
|
|
|
|
uint8_t rsv2:1;
|
|
|
|
|
}front_t1; //byte0 前照灯
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta left_beam:2; //前照灯左转向灯(bit0-1)
|
|
|
|
|
Rq_sta left_indicator:2; //前照灯左侧指示灯(bit2-3)
|
|
|
|
|
Rq_sta left_side_fill:2; //前照灯左侧补光灯(bit4-5)
|
|
|
|
|
Rq_sta right_beam:2; //前照灯右转向灯(bit6-7)
|
|
|
|
|
}front_t2; //byte1
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta right_indicator:2; //前照灯右侧指示灯(bit0-1)
|
|
|
|
|
Rq_sta right_fill:2; //前照灯右侧补光灯(bit2-3)
|
|
|
|
|
Rq_sta both_side:2; //前照灯两侧示廓灯(bit4-5)
|
|
|
|
|
Rq_sta LOGO_beam:2; //前照灯LOGO灯(bit6-7)
|
|
|
|
|
}front_t3; //byte2
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta thick_wall:2; //前照灯厚壁灯(bit0-1)
|
|
|
|
|
Rq_sta tail_drive:2; //尾灯行车灯(bit2-3)
|
|
|
|
|
Rq_sta tail_brake:2; //尾灯制动灯(bit4-5)
|
|
|
|
|
Rq_sta left_t:2; //尾灯左转(bit6-7)
|
|
|
|
|
}back_t1;
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta right_t:2; //尾灯右转(bit0-1)
|
|
|
|
|
Rq_sta tail_outline:2; //尾灯示廓灯(bit2-3)
|
|
|
|
|
Rq_sta tail_logo:2; //尾灯LOGO灯(bit4-5)
|
|
|
|
|
Rq_sta left_t:2; //左转灯(bit6-7)
|
|
|
|
|
}back_t2;
|
|
|
|
|
struct{
|
|
|
|
|
Rq_sta right_t:2; //右转灯(bit0-1)
|
|
|
|
|
Rq_sta front_projector:2; //前投影灯(bit2-3)
|
|
|
|
|
Rq_sta rear_projector:2; //后投影灯(bit4-5)
|
|
|
|
|
Rq_sta ambient_light:2; //氛围灯(bit6-7)
|
|
|
|
|
}led_t;
|
|
|
|
|
charg_state charg_indicator:2; //充电指示灯
|
|
|
|
|
}HEAD_fun_cotrol1_0x2101; //功能控制
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
uint8_t turn_signal:4; //转向灯
|
|
|
|
|
uint8_t high_low_lamp:4; //远近光
|
|
|
|
|
}HEAD_headlamp_fault_0x2401; //前照灯故障反馈
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
uint8_t turn_signal:2; //转向灯
|
|
|
|
|
uint8_t rsv:6;
|
|
|
|
|
}HEAD_taillight_fault_0x2402; //尾灯故障反馈
|
|
|
|
|
|
|
|
|
|
/******************* 雷达rado *******************/
|
|
|
|
|
typedef struct{
|
|
|
|
|
struct{
|
|
|
|
|
Fun_State radar_sys:2; //雷达系统开关
|
|
|
|
|
Fun_State warn_light:2; //预警灯开关
|
|
|
|
|
Fun_State buzzer:2; //蜂鸣器开关
|
|
|
|
|
Fun_State video:2; //录像开关
|
|
|
|
|
Rq_sta radar_sys:2; //雷达系统开关
|
|
|
|
|
Rq_sta warn_light:2; //预警灯开关
|
|
|
|
|
Rq_sta buzzer:2; //蜂鸣器开关
|
|
|
|
|
Rq_sta video:2; //录像开关
|
|
|
|
|
}switch1;
|
|
|
|
|
struct{
|
|
|
|
|
Fun_State behind_vehicle:2; //后方来车预警开关
|
|
|
|
|
Fun_State left_vehicle:2; //左侧方来车预警开关
|
|
|
|
|
Fun_State right_vehicle:2; //右侧方来车预警开关
|
|
|
|
|
Rq_sta behind_vehicle:2; //后方来车预警开关
|
|
|
|
|
Rq_sta left_vehicle:2; //左侧方来车预警开关
|
|
|
|
|
Rq_sta right_vehicle:2; //右侧方来车预警开关
|
|
|
|
|
}switch2;
|
|
|
|
|
}RADO_fun_switch_set_0x2001; //功能开关设置
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
struct{
|
|
|
|
|
Fun_State radar_sys:2; //雷达系统开关
|
|
|
|
|
Fun_State warn_light:2; //预警灯开关
|
|
|
|
|
Fun_State buzzer:2; //蜂鸣器开关
|
|
|
|
|
Fun_State video:2; //录像开关
|
|
|
|
|
Rq_sta radar_sys:2; //雷达系统开关
|
|
|
|
|
Rq_sta warn_light:2; //预警灯开关
|
|
|
|
|
Rq_sta buzzer:2; //蜂鸣器开关
|
|
|
|
|
Rq_sta video:2; //录像开关
|
|
|
|
|
}switch1;
|
|
|
|
|
struct{
|
|
|
|
|
Fun_State behind_vehicle:2; //后方来车预警开关
|
|
|
|
|
Fun_State left_vehicle:2; //左侧方来车预警开关
|
|
|
|
|
Fun_State right_vehicle:2; //右侧方来车预警开关
|
|
|
|
|
Rq_sta behind_vehicle:2; //后方来车预警开关
|
|
|
|
|
Rq_sta left_vehicle:2; //左侧方来车预警开关
|
|
|
|
|
Rq_sta right_vehicle:2; //右侧方来车预警开关
|
|
|
|
|
}switch2;
|
|
|
|
|
}RADO_sys_info_0x2201; //系统信息 1000ms
|
|
|
|
|
|
|
|
|
@ -818,6 +936,12 @@ typedef struct{
|
|
|
|
|
chg_sta comm_fail; //通讯故障
|
|
|
|
|
chg_sta chg_overtime; //充电超时
|
|
|
|
|
}charger_state;
|
|
|
|
|
/******************* 前照灯 *******************/
|
|
|
|
|
//typedef struct{
|
|
|
|
|
// Rq_sta led_ctrl;
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
/***************************************************************/
|
|
|
|
|
#define CAN_SIZE_MAX 100U //根据CAN的id数设置大小41
|
|
|
|
|
#define QUEUE_BUFF_SIZE 36U
|
|
|
|
|