feat():initial version
This commit is contained in:
470
insDavi2.0/include/BaseTypes.h
Normal file
470
insDavi2.0/include/BaseTypes.h
Normal file
@@ -0,0 +1,470 @@
|
||||
#ifndef BASETYPES_H_INCLUDED
|
||||
#define BASETYPES_H_INCLUDED
|
||||
|
||||
typedef unsigned char UInt08;
|
||||
typedef unsigned char U08;
|
||||
typedef signed char Int08;
|
||||
typedef unsigned short UInt16;
|
||||
typedef unsigned short U16;
|
||||
typedef signed short Int16;
|
||||
typedef unsigned int UInt32;
|
||||
typedef unsigned int U32;
|
||||
typedef int Int32;
|
||||
typedef float Flt32;
|
||||
|
||||
/* 8位共同体 */
|
||||
typedef union
|
||||
{
|
||||
U08 value;
|
||||
|
||||
/* 单位访问结构 (single) */
|
||||
struct
|
||||
{
|
||||
U08 b0 :1;
|
||||
U08 b1 :1;
|
||||
U08 b2 :1;
|
||||
U08 b3 :1;
|
||||
U08 b4 :1;
|
||||
U08 b5 :1;
|
||||
U08 b6 :1;
|
||||
U08 b7 :1;
|
||||
}sbit;
|
||||
|
||||
/* 双位访问结构1 (double) */
|
||||
struct
|
||||
{
|
||||
U08 b01 :2;
|
||||
U08 b23 :2;
|
||||
U08 b45 :2;
|
||||
U08 b67 :2;
|
||||
}sbit02;
|
||||
|
||||
/* 双位访问结构2 (double) */
|
||||
struct
|
||||
{
|
||||
U08 b0 :1;
|
||||
U08 b12 :2;
|
||||
U08 b34 :2;
|
||||
U08 b56 :2;
|
||||
U08 b7 :1;
|
||||
}sbit12;
|
||||
|
||||
/* 三位访问结构1 (ternate) */
|
||||
struct
|
||||
{
|
||||
U08 b02 :3;
|
||||
U08 b35 :3;
|
||||
U08 b67 :2;
|
||||
}sbit03;
|
||||
|
||||
/* 三位访问结构2 (ternate) */
|
||||
struct
|
||||
{
|
||||
U08 b0 :1;
|
||||
U08 b13 :3;
|
||||
U08 b46 :3;
|
||||
U08 b7 :1;
|
||||
}sbit13;
|
||||
|
||||
/* 三位访问结构3 (ternate) */
|
||||
struct
|
||||
{
|
||||
U08 b01 :2;
|
||||
U08 b24 :3;
|
||||
U08 b57 :3;
|
||||
}sbit23;
|
||||
|
||||
/* 四位访问结构1 (hex) */
|
||||
struct
|
||||
{
|
||||
U08 b03 :4;
|
||||
U08 b47 :4;
|
||||
}sbit04;
|
||||
|
||||
/* 四位访问结构2 (hex) */
|
||||
struct
|
||||
{
|
||||
U08 b0 :1;
|
||||
U08 b14 :4;
|
||||
U08 b57 :3;
|
||||
}sbit14;
|
||||
|
||||
/* 四位访问结构3 (hex) */
|
||||
struct
|
||||
{
|
||||
U08 b01 :2;
|
||||
U08 b25 :4;
|
||||
U08 b67 :2;
|
||||
}sbit24;
|
||||
|
||||
/* 四位访问结构4 (hex) */
|
||||
struct
|
||||
{
|
||||
U08 b02 :3;
|
||||
U08 b36 :4;
|
||||
U08 b7 :1;
|
||||
}sbit34;
|
||||
|
||||
/* 五位访问结构1 (quinary) */
|
||||
struct
|
||||
{
|
||||
U08 b04 :5;
|
||||
U08 b57 :3;
|
||||
}sbit05;
|
||||
|
||||
/* 五位访问结构2 (quinary) */
|
||||
struct
|
||||
{
|
||||
U08 b0 :1;
|
||||
U08 b15 :5;
|
||||
U08 b67 :2;
|
||||
}sbit15;
|
||||
|
||||
/* 五位访问结构3 (quinary) */
|
||||
struct
|
||||
{
|
||||
U08 b01 :2;
|
||||
U08 b26 :5;
|
||||
U08 b7 :1;
|
||||
}sbit25;
|
||||
|
||||
/* 五位访问结构4 (quinary) */
|
||||
struct
|
||||
{
|
||||
U08 b02 :3;
|
||||
U08 b37 :5;
|
||||
}sbit35;
|
||||
|
||||
/* 六位访问结构1 (sextuplet) */
|
||||
struct
|
||||
{
|
||||
U08 b05 :6;
|
||||
U08 b67 :2;
|
||||
}sbit06;
|
||||
|
||||
/* 六位访问结构2 (sextuplet) */
|
||||
struct
|
||||
{
|
||||
U08 b0 :1;
|
||||
U08 b16 :6;
|
||||
U08 b7 :1;
|
||||
}sbit16;
|
||||
|
||||
/* 六位访问结构3 (sextuplet) */
|
||||
struct
|
||||
{
|
||||
U08 b01 :2;
|
||||
U08 b27 :6;
|
||||
}sbit26;
|
||||
|
||||
/* 七们访问结构1 (heptad) */
|
||||
struct
|
||||
{
|
||||
U08 b06 :7;
|
||||
U08 b7 :1;
|
||||
}sbit07;
|
||||
|
||||
/* 七们访问结构2 (heptad) */
|
||||
struct
|
||||
{
|
||||
U08 b0 :1;
|
||||
U08 b17 :7;
|
||||
}sbit17;
|
||||
|
||||
}Un08;
|
||||
|
||||
/* 16位共同体 */
|
||||
typedef union
|
||||
{
|
||||
U16 value;
|
||||
|
||||
/* 单字节访问结构 */
|
||||
struct
|
||||
{
|
||||
U08 bh;
|
||||
U08 bl;
|
||||
}sbyte;
|
||||
|
||||
/* 位访问结构 */
|
||||
struct
|
||||
{
|
||||
Un08 bh;
|
||||
Un08 bl;
|
||||
}sbit;
|
||||
} Un16;
|
||||
|
||||
/* 32位共同体 */
|
||||
typedef union
|
||||
{
|
||||
U32 value;
|
||||
|
||||
/* 单字节访问结构 */
|
||||
struct
|
||||
{
|
||||
U08 bhh;
|
||||
U08 bhl;
|
||||
U08 blh;
|
||||
U08 bll;
|
||||
}sbyte;
|
||||
|
||||
/* 位访问结构 */
|
||||
struct
|
||||
{
|
||||
Un08 bhh;
|
||||
Un08 bhl;
|
||||
Un08 blh;
|
||||
Un08 bll;
|
||||
}sbit;
|
||||
}Un32;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Flt32 x, y, z, w;
|
||||
} Vec4f;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Int32 x, y, z, w;
|
||||
} Vec4i;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Flt32 x, y, z;
|
||||
} Vec3f;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Int32 x, y, z;
|
||||
} Vec3i;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Flt32 x, y;
|
||||
} Vec2f;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Int32 x, y;
|
||||
} Vec2i;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Int32 x;
|
||||
Int32 y;
|
||||
Int32 w;
|
||||
Int32 h;
|
||||
} Recti;
|
||||
|
||||
#define SetVec4(vec4, xx, yy, zz, ww) do{ \
|
||||
(vec4).x = (xx); \
|
||||
(vec4).y = (yy); \
|
||||
(vec4).z = (zz); \
|
||||
(vec4).w = (ww);}while(0)
|
||||
|
||||
#define SetVec4f(vec4f, xx, yy, zz, ww) SetVec4(vec4f, xx, yy, zz, ww)
|
||||
#define SetVec4i(vec4i, xx, yy, zz, ww) SetVec4(vec4i, xx, yy, zz, ww)
|
||||
|
||||
#define SetVec3(vec3, xx, yy, zz) do{ \
|
||||
(vec3).x = (xx); \
|
||||
(vec3).y = (yy); \
|
||||
(vec3).z = (zz);}while(0)
|
||||
|
||||
#define SetVec3f(vec3f, xx, yy, zz) SetVec3(vec3f, xx, yy, zz)
|
||||
#define SetVec3i(vec3i, xx, yy, zz) SetVec3(vec3i, xx, yy, zz)
|
||||
|
||||
#define SetVec2(vec2, xx, yy) do{ \
|
||||
(vec2).x = (xx); \
|
||||
(vec2).y = (yy);}while(0)
|
||||
|
||||
#define SetVec2f(vec2f, xx, yy) SetVec2(vec2f, xx, yy)
|
||||
#define SetVec2i(vec2i, xx, yy) SetVec2(vec2i, xx, yy)
|
||||
|
||||
#define SetRecti(recti, xx, yy, ww, hh) do{ \
|
||||
(recti).x = (xx); \
|
||||
(recti).y = (yy); \
|
||||
(recti).w = (ww); \
|
||||
(recti).h = (hh);}while(0)
|
||||
|
||||
#define MAX_MATRIX_STACK_DEPTH 10
|
||||
//typedef struct
|
||||
//{
|
||||
// UInt08 idx;
|
||||
// Flt32 mat4x4[MAX_MATRIX_STACK_DEPTH][4*4];
|
||||
//} Mat4x4Stack;
|
||||
|
||||
typedef void* (*CommonFun) (void* argv);
|
||||
|
||||
#ifndef Bool
|
||||
#define Bool Int08
|
||||
#endif
|
||||
|
||||
#define INS_FALSE 0x0
|
||||
#define INS_TRUE 0x1
|
||||
|
||||
#define WITHOUT_NORMALS_AND_TEXTCOORDS 0x0
|
||||
#define WITH_NORMALS 0x1
|
||||
#define WITH_TEXTCOORDS 0x2
|
||||
|
||||
enum
|
||||
{
|
||||
FILE_READ_ERR = 0x10,
|
||||
FILE_WRITE_ERR,
|
||||
FILE_UNKNOW_FORMAT,
|
||||
SYSTEM_ERROR
|
||||
};
|
||||
|
||||
#define INS_INVALID_RES_ID 0xffFFffFF
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Int32 ltx;
|
||||
Int32 lty;
|
||||
Int32 w;
|
||||
Int32 h;
|
||||
UInt08 *dat;
|
||||
UInt32 tex;
|
||||
Int32 fmt;
|
||||
} Image;
|
||||
|
||||
#define GetImageRect(rect, image) do{\
|
||||
(rect).x = (image).ltx;\
|
||||
(rect).y = (image).lty;\
|
||||
(rect).w = (image).w;\
|
||||
(rect).h = (image).h;\
|
||||
}while(0)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt08 hdr;
|
||||
UInt32 face_num;
|
||||
Flt32 *vtxs;
|
||||
Flt32 *txcs;
|
||||
Flt32 *nors;
|
||||
} Model3DVao, *HModel3DVao;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt08 hdr;
|
||||
UInt08 idx_type;
|
||||
UInt32 idx_num;
|
||||
UInt32 face_num;
|
||||
UInt32 buf[4];
|
||||
Flt32 x_min, x_max;
|
||||
Flt32 y_min, y_max;
|
||||
Flt32 z_min, z_max;
|
||||
Flt32 *vtxs;
|
||||
Flt32 *txcs;
|
||||
Flt32 *nors;
|
||||
void *idx;
|
||||
} Model3DVbo, *HModel3DVbo;
|
||||
|
||||
enum
|
||||
{
|
||||
FRM_COMPRESS_NONE = 0,
|
||||
FRM_COMPRESS_1 = 1,
|
||||
|
||||
FRM_ENCRYPT_NONE = 0,
|
||||
FRM_ENCRYPT_1 = 1,
|
||||
|
||||
FRM_TYPE_CTRL = 0,
|
||||
FRM_TYPE_SINGLE = 1,
|
||||
FRM_TYPE_FIRST = 2,
|
||||
FRM_TYPE_NEXT = 3,
|
||||
|
||||
FRM_INF_HEART_BEAT = 0,
|
||||
FRM_INF_HEART_BEAT_ACK = 1,
|
||||
FRM_INF_START = 2,
|
||||
FRM_INF_START_ACK = 3,
|
||||
FRM_INF_START_NACK = 4,
|
||||
FRM_INF_END = 5,
|
||||
FRM_INF_END_ACK = 6,
|
||||
FRM_INF_END_NACK = 7,
|
||||
FRM_INF_DATA = 8,
|
||||
FRM_INF_DATA_ACK = 9,
|
||||
|
||||
FRM_SRV_ICM_BLUETOOTH = 0x00,
|
||||
FRM_SRV_ICM_ACCOUNT = 0x01,
|
||||
FRM_SRV_ICM_CTRL = 0x02,
|
||||
|
||||
FRM_SRV_CDU_NAVIGATION = 0x40,
|
||||
FRM_SRV_CDU_MUSIC = 0x41,
|
||||
FRM_SRV_CDU_RADIO = 0x42,
|
||||
FRM_SRV_CDU_BLUETOOTH = 0x43,
|
||||
FRM_SRV_CDU_WEATHER = 0x44,
|
||||
FRM_SRV_CDU_ACCOUNT = 0x45,
|
||||
FRM_SRV_CDU_AID = 0x46,
|
||||
FRM_SRV_CDU_NOTIFICATION = 0x47,
|
||||
FRM_SRV_CDU_NETRADIO = 0x48,
|
||||
|
||||
FRM_SRV_CDU_UPGRADE = 0xF0,
|
||||
|
||||
RPC_TYPE_REQ = 0,
|
||||
RPC_TYPE_RSP = 1,
|
||||
RPC_TYPE_NTF = 2,
|
||||
|
||||
RPC_CDU_NAVIGATION = 0x00000001,
|
||||
RPC_CDU_MUSIC = 0x00000002,
|
||||
RPC_CDU_RADIO = 0x00000003,
|
||||
RPC_CDU_BLUETOOTH = 0x00000004,
|
||||
RPC_CDU_WEATHER = 0x00000005,
|
||||
RPC_CDU_ACCOUNT = 0x00000006,
|
||||
RPC_CDU_UPGRADE = 0x00000007,
|
||||
RPC_CDU_NOTIFICATION = 0x00000008,
|
||||
RPC_CDU_NETRADIO = 0x00000009,
|
||||
|
||||
RPC_CDU_SERVICE = 0xff000001,
|
||||
RPC_CDU_HEART_BEAT = 0xff000002,
|
||||
|
||||
RPC_ICM_BLUETOOTH = 0x0000f001,
|
||||
RPC_ICM_ACCOUNT = 0x0000f002,
|
||||
RPC_ICM_CTRL = 0x0000f003,
|
||||
|
||||
FRM_SEQ_END = 0,
|
||||
FRM_SEQ_SINGLE = 1,
|
||||
FRM_SEQ_CTRL = 1,
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt08 version; /*协议版本*/
|
||||
UInt08 compress:4; /*压缩类型*/
|
||||
UInt08 encrypt:4; /*加密类型*/
|
||||
UInt08 frm_type; /*帧类型*/
|
||||
UInt08 srv_type; /*服务类型*/
|
||||
UInt08 frm_info; /*帧信息*/
|
||||
UInt08 session_id; /*会话ID*/
|
||||
UInt08 frm_id; /*帧号*/
|
||||
UInt08 reserve8; /*预留*/
|
||||
UInt32 data_size; /*数据长度*/
|
||||
UInt08 reserve13; /*预留*/
|
||||
UInt08 reserve14; /*预留*/
|
||||
UInt08 reserve15; /*预留*/
|
||||
UInt08 reserve16; /*预留*/
|
||||
} FrameHeader;
|
||||
|
||||
typedef union
|
||||
{
|
||||
Int08 buff[16];
|
||||
Un08 unbuf[16];
|
||||
FrameHeader header;
|
||||
} UnFrameHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt08 rpc_type; /*RPC类型*/
|
||||
UInt08 reserve1; /*预留*/
|
||||
UInt08 reserve2; /*预留*/
|
||||
UInt08 reserve3; /*预留*/
|
||||
UInt32 rpc_name; /*RPC名*/
|
||||
UInt32 rpc_msg_no; /*RPC消息编号*/
|
||||
UInt32 json_size; /*json数据长度*/
|
||||
} BpBinHeader;
|
||||
|
||||
typedef union
|
||||
{
|
||||
Int08 buff[16];
|
||||
Un08 unbuf[16];
|
||||
BpBinHeader header;
|
||||
} UnBpBinHeader;
|
||||
|
||||
#endif // BASETYPES_H_INCLUDED
|
||||
120
insDavi2.0/include/InsCfg.h
Normal file
120
insDavi2.0/include/InsCfg.h
Normal file
@@ -0,0 +1,120 @@
|
||||
#ifndef INSCFG_H_INCLUDED
|
||||
#define INSCFG_H_INCLUDED
|
||||
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_FIX 7
|
||||
#define VERSION_REV 1
|
||||
#define VERSION_HW 3
|
||||
|
||||
enum
|
||||
{
|
||||
ID_FRAME_R_0x00 = 0
|
||||
,ID_FRAME_R_0x01
|
||||
,ID_FRAME_R_0x02
|
||||
,ID_FRAME_R_0x03
|
||||
,ID_FRAME_R_0x04
|
||||
,ID_FRAME_R_0x05
|
||||
,ID_FRAME_R_0x06
|
||||
,ID_FRAME_R_0x07
|
||||
,ID_FRAME_R_0x08
|
||||
,ID_FRAME_R_0x09
|
||||
,ID_FRAME_R_0x0A
|
||||
,ID_FRAME_R_0x0B
|
||||
,ID_FRAME_R_0x0C
|
||||
,ID_FRAME_R_0x0D
|
||||
,ID_FRAME_R_0x0E
|
||||
,ID_FRAME_R_NUM
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ID_FRAME_W_0x00 = 0
|
||||
,ID_FRAME_W_0x01
|
||||
,ID_FRAME_W_0x02
|
||||
,ID_FRAME_W_NUM
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_RADAR_DISTANCE_F0 = 140+1,
|
||||
MAX_RADAR_DISTANCE_F1 = 140+1,
|
||||
MAX_RADAR_DISTANCE_F2 = 140+1,
|
||||
MAX_RADAR_DISTANCE_F3 = 140+1,
|
||||
MAX_RADAR_DISTANCE_F4 = 140+1,
|
||||
MAX_RADAR_DISTANCE_F5 = 140+1,
|
||||
MAX_RADAR_DISTANCE_Fm = 140,
|
||||
MAX_RADAR_DISTANCE_FM = 140+28,
|
||||
|
||||
MAX_RADAR_DISTANCE_B0 = 140+1,
|
||||
MAX_RADAR_DISTANCE_B1 = 140+1,
|
||||
MAX_RADAR_DISTANCE_B2 = 140+1,
|
||||
MAX_RADAR_DISTANCE_B3 = 140+1,
|
||||
MAX_RADAR_DISTANCE_B4 = 140+1,
|
||||
MAX_RADAR_DISTANCE_B5 = 140+1,
|
||||
MAX_RADAR_DISTANCE_Bm = 140,
|
||||
MAX_RADAR_DISTANCE_BM = 140+28,
|
||||
|
||||
RED_RADAR_DISTANCE_F0 = 40,
|
||||
RED_RADAR_DISTANCE_F1 = 40,
|
||||
RED_RADAR_DISTANCE_F2 = 40,
|
||||
RED_RADAR_DISTANCE_F3 = 40,
|
||||
RED_RADAR_DISTANCE_F4 = 40,
|
||||
RED_RADAR_DISTANCE_F5 = 40,
|
||||
|
||||
RED_RADAR_DISTANCE_B0 = 40,
|
||||
RED_RADAR_DISTANCE_B1 = 40,
|
||||
RED_RADAR_DISTANCE_B2 = 40,
|
||||
RED_RADAR_DISTANCE_B3 = 40,
|
||||
RED_RADAR_DISTANCE_B4 = 40,
|
||||
RED_RADAR_DISTANCE_B5 = 40,
|
||||
|
||||
YELLOW_RADAR_DISTANCE_F0 = 80,
|
||||
YELLOW_RADAR_DISTANCE_F1 = 80,
|
||||
YELLOW_RADAR_DISTANCE_F2 = 80,
|
||||
YELLOW_RADAR_DISTANCE_F3 = 80,
|
||||
YELLOW_RADAR_DISTANCE_F4 = 80,
|
||||
YELLOW_RADAR_DISTANCE_F5 = 80,
|
||||
|
||||
YELLOW_RADAR_DISTANCE_B0 = 80,
|
||||
YELLOW_RADAR_DISTANCE_B1 = 80,
|
||||
YELLOW_RADAR_DISTANCE_B2 = 80,
|
||||
YELLOW_RADAR_DISTANCE_B3 = 80,
|
||||
YELLOW_RADAR_DISTANCE_B4 = 80,
|
||||
YELLOW_RADAR_DISTANCE_B5 = 80,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
DBG_INFO = 0,
|
||||
DBG_WARN,
|
||||
DBG_ERROR,
|
||||
};
|
||||
|
||||
#define I2C_DEVICE "/dev/i2c-1"
|
||||
#define I2C_SLAVE_ADDRESS 0x77
|
||||
#define I2C_FRAMELEN 9
|
||||
|
||||
#define OTA_DATA_ROOT_DIR "/data/"
|
||||
#define OTA_DATA_EXTR_DIR "/data/ota_download/extract/"
|
||||
#define OTA_DATA_FILE_PATH "/data/ota_download/OTA_PACKAGE.DAT"
|
||||
#define OTA_SIGN_FILE_PATH "/data/ota_download/OTA_PACKAGE.SIG"
|
||||
#define OTA_PUBKEY_FILE_PATH "/root/app/OTA_PUBKEY.PEM"
|
||||
|
||||
/*PushMatrix, PopMatrix Stack depth*/
|
||||
#define MAX_MATRIX4x4STACK_DEPTH 10
|
||||
|
||||
#define MAX_FT_FACE_NUM 10
|
||||
|
||||
#define MAX_LOAD_THREAD_NUM 5 /* 资源加载任务最大子线程数量 */
|
||||
#define MAX_LOAD_TASK_NUM 100 /* 资源加载任务瞬时最大任务数量 */
|
||||
#define MAX_LOAD_TASK_WAIT_NUM (MAX_LOAD_THREAD_NUM*10)
|
||||
#define MAX_FILE_NAME_LEN 100 /* 资源文件名字符串的最大长度 */
|
||||
|
||||
#define RENDER_DISPLAY_WIDTH 1920
|
||||
#define RENDER_DISPLAY_HEIGHT 720
|
||||
|
||||
#define MBC_CTRL_WND_WIDTH 500
|
||||
#define MBC_CTRL_WND_HEIGHT 340
|
||||
|
||||
#endif // INSCFG_H_INCLUDED
|
||||
23
insDavi2.0/include/InsDbg.h
Normal file
23
insDavi2.0/include/InsDbg.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef INSDBG_H_INCLUDED
|
||||
#define INSDBG_H_INCLUDED
|
||||
|
||||
#ifdef NODEBUG
|
||||
|
||||
#define DBG_Log(level, fmt, v...)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef DBG_LEVEL
|
||||
#define DBG_LEVEL DBG_INFO
|
||||
#endif // DBG_LEVEL
|
||||
|
||||
#ifndef DBG_TAG
|
||||
#define DBG_TAG " "
|
||||
#endif // DBG_TAG
|
||||
|
||||
#define DBG_Log(level, fmt, v...)
|
||||
//#define DBG_Log(level, fmt, v...) if(level >= DBG_LEVEL)printf("[ %15s ] "fmt, DBG_TAG, ##v)
|
||||
|
||||
#endif // NODEBUG
|
||||
|
||||
#endif // INSDBG_H_INCLUDED
|
||||
10
insDavi2.0/include/InsRender.h
Normal file
10
insDavi2.0/include/InsRender.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef INSRENDER_H_INCLUDED
|
||||
#define INSRENDER_H_INCLUDED
|
||||
|
||||
extern void* Render(void *argv);
|
||||
extern void* CleanUpRender(void *argv);
|
||||
|
||||
extern void* Render_FB1(void *argv);
|
||||
extern void* CleanUpRender_FB1(void *argv);
|
||||
|
||||
#endif // INSRENDER_H_INCLUDED
|
||||
6
insDavi2.0/include/InsRes.h
Normal file
6
insDavi2.0/include/InsRes.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef INSRES_H_INCLUDED
|
||||
#define INSRES_H_INCLUDED
|
||||
|
||||
|
||||
|
||||
#endif // INSRES_H_INCLUDED
|
||||
36
insDavi2.0/include/InsTask.h
Normal file
36
insDavi2.0/include/InsTask.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef INSTASK_H_INCLUDED
|
||||
#define INSTASK_H_INCLUDED
|
||||
|
||||
#include <BaseTypes.h>
|
||||
|
||||
typedef struct Struct_InsTask
|
||||
{
|
||||
Bool (*Init)();
|
||||
Bool (*DeInit)();
|
||||
Int08 (*GetState)();
|
||||
void (*Excute)();
|
||||
Bool (*PostRequest)(void*);
|
||||
void (*Stop)();
|
||||
void (*TryStop)();
|
||||
void (*BeatDog)();
|
||||
Bool (*IsDogAlive)();
|
||||
} InsTask;
|
||||
|
||||
typedef enum Enum_InsTaskState
|
||||
{
|
||||
InsTask_Uninit = 0
|
||||
,InsTask_Initing
|
||||
,InsTask_Inited
|
||||
,InsTask_Running
|
||||
,InsTask_Pause
|
||||
,InsTask_Stop
|
||||
|
||||
,InsTask_Setup
|
||||
,InsTask_Request
|
||||
,InsTask_PostFail
|
||||
,InsTask_Abort
|
||||
,InsTask_Waiting
|
||||
,InsTask_Finish
|
||||
} InsTaskState;
|
||||
|
||||
#endif // INSTASK_H_INCLUDED
|
||||
19
insDavi2.0/include/InsTask/CduCommunication.h
Normal file
19
insDavi2.0/include/InsTask/CduCommunication.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef CDUCOMMUNICATION_H_INCLUDED
|
||||
#define CDUCOMMUNICATION_H_INCLUDED
|
||||
|
||||
#include <InsTask.h>
|
||||
|
||||
extern Bool globAppQuit;
|
||||
extern Bool globIpv6_NetworkInstalled;
|
||||
extern volatile UInt32 CduComSrvPnt;
|
||||
|
||||
#ifdef COMPILE_IN_WINDOWS
|
||||
#include <windows.h>
|
||||
|
||||
extern HINSTANCE globHInstance;
|
||||
|
||||
#endif // COMPILE_IN_WINDOWS
|
||||
|
||||
extern const InsTask gCduCommunication;
|
||||
|
||||
#endif // CDUCOMMUNICATION_H_INCLUDED
|
||||
19
insDavi2.0/include/InsTask/DisplayRender.h
Normal file
19
insDavi2.0/include/InsTask/DisplayRender.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef DISPLAYRENDER_H_INCLUDED
|
||||
#define DISPLAYRENDER_H_INCLUDED
|
||||
|
||||
#include <InsTask.h>
|
||||
|
||||
extern Bool globAppQuit;
|
||||
|
||||
#ifdef COMPILE_IN_WINDOWS
|
||||
#include <windows.h>
|
||||
|
||||
extern HINSTANCE globHInstance;
|
||||
|
||||
#endif // COMPILE_IN_WINDOWS
|
||||
|
||||
extern void RegisterRenderFuncs(CommonFun RenderFunc, void* argR, CommonFun QuitFunc, void* argQ);
|
||||
extern void RegisterRender2Funcs(CommonFun RenderFunc, void* argR, CommonFun QuitFunc, void* argQ);
|
||||
extern const InsTask gDisplayRender;
|
||||
|
||||
#endif // DISPLAYRENDER_H_INCLUDED
|
||||
18
insDavi2.0/include/InsTask/MainBoardCommunication.h
Normal file
18
insDavi2.0/include/InsTask/MainBoardCommunication.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef MAINBOARDCOMMUNICATION_H_INCLUDED
|
||||
#define MAINBOARDCOMMUNICATION_H_INCLUDED
|
||||
|
||||
#include <InsTask.h>
|
||||
|
||||
extern Bool globAppQuit;
|
||||
extern Bool globI2c_PeepBuffer;
|
||||
|
||||
#ifdef COMPILE_IN_WINDOWS
|
||||
#include <windows.h>
|
||||
|
||||
extern HINSTANCE globHInstance;
|
||||
|
||||
#endif // COMPILE_IN_WINDOWS
|
||||
|
||||
extern const InsTask gMainBoardCommunication;
|
||||
|
||||
#endif // MAINBOARDCOMMUNICATION_H_INCLUDED
|
||||
19
insDavi2.0/include/InsTask/ResourceLoader.h
Normal file
19
insDavi2.0/include/InsTask/ResourceLoader.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef RESOURCELOADER_H_INCLUDED
|
||||
#define RESOURCELOADER_H_INCLUDED
|
||||
|
||||
#include <InsTask.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt16 cntabort; /* 任务因繁忙而被放弃执行的次数 */
|
||||
UInt16 uniformid; /* 任务因繁忙而被放弃执行的次数 */
|
||||
InsTaskState state; /* 任务状态 */
|
||||
CommonFun load; /* 任务的读取方法 */
|
||||
void *argvload; /* 任务的读取方法中所需的参数 */
|
||||
CommonFun response; /* 任务的状态响应方法 */
|
||||
void *argvresponse; /* 任务的状态响应方法中所需的参数 */
|
||||
}RslTaskItem;
|
||||
|
||||
extern const InsTask gResourceLoader;
|
||||
|
||||
#endif // RESOURCELOADER_H_INCLUDED
|
||||
35
insDavi2.0/include/Protocol/Cdu_TCP.h
Normal file
35
insDavi2.0/include/Protocol/Cdu_TCP.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef CDU_TCP_H_INCLUDED
|
||||
#define CDU_TCP_H_INCLUDED
|
||||
|
||||
#include <InsCfg.h>
|
||||
#include <BaseTypes.h>
|
||||
|
||||
#ifndef CduTcpApi
|
||||
#ifndef CDU_TCP_IMPLEMENT
|
||||
#define CduTcpApi extern
|
||||
#else
|
||||
#define CduTcpApi
|
||||
#endif // CDU_TCP_IMPLEMENT
|
||||
#endif // CduTcpApi
|
||||
|
||||
#ifdef COMPILE_IN_WINDOWS
|
||||
|
||||
#include <winsock2.h> //SOCKET
|
||||
|
||||
CduTcpApi void CDU_TCP_Serve(SOCKET sockfd, const Bool *quitFlg);
|
||||
|
||||
#else
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
CduTcpApi void CDU_TCP_Serve(Int32 sockfd, const Bool *quitFlg);
|
||||
|
||||
#endif // COMPILE_IN_WINDOWS
|
||||
|
||||
CduTcpApi void CDU_TCP_SetInitialValue();
|
||||
CduTcpApi void CDU_TCP_EndServe();
|
||||
//CduTcpApi void CDU_TCP_ProcessData(UInt08 srvType);
|
||||
//CduTcpApi Int32 CDU_TCP_VerifyAndStore(UInt08 id, UInt08 *data);
|
||||
|
||||
#endif // CDU_TCP_H_INCLUDED
|
||||
570
insDavi2.0/include/Protocol/Cdu_TCP_App.h
Normal file
570
insDavi2.0/include/Protocol/Cdu_TCP_App.h
Normal file
@@ -0,0 +1,570 @@
|
||||
#ifndef CDU_TCP_APP_H_INCLUDED
|
||||
#define CDU_TCP_APP_H_INCLUDED
|
||||
|
||||
#include <Protocol/Cdu_TCP.h>
|
||||
|
||||
#define MAX_NAV_REMAIN_DIST1_LENGTH 32
|
||||
#define MAX_NAV_REMAIN_TIME1_LENGTH 40
|
||||
#define MAX_NAV_CURR_ROAD_NAME_LENGTH 32
|
||||
#define MAX_NAV_NEXT_ROAD_NAME_LENGTH 32
|
||||
typedef struct Struct_JsonNav
|
||||
{
|
||||
Int08 RemainDis1[MAX_NAV_REMAIN_DIST1_LENGTH];
|
||||
Int08 RemainTime1[MAX_NAV_REMAIN_TIME1_LENGTH];
|
||||
Int08 CurrRoadName[MAX_NAV_CURR_ROAD_NAME_LENGTH];
|
||||
Int08 NextRoadName[MAX_NAV_NEXT_ROAD_NAME_LENGTH];
|
||||
UInt08 UpdRemainInfo1;
|
||||
UInt08 UpdCurrRoadName;
|
||||
UInt08 UpdNextRoadName;
|
||||
UInt08 NavIcon;
|
||||
UInt08 Enable;
|
||||
UInt08 CameraType;
|
||||
UInt08 CameraSpeed;
|
||||
UInt08 LimitedSpeed;
|
||||
Int32 RoadRemainDis;
|
||||
} JsonNav;
|
||||
#ifndef INIT_JsonNav
|
||||
#define INIT_JsonNav(nav) do{\
|
||||
(nav).RemainDis1[0] = 0;\
|
||||
(nav).RemainTime1[0] = 0;\
|
||||
(nav).CurrRoadName[0] = 0;\
|
||||
(nav).NextRoadName[0] = 0;\
|
||||
(nav).UpdRemainInfo1 = 0;\
|
||||
(nav).UpdCurrRoadName = 0;\
|
||||
(nav).UpdNextRoadName = 0;\
|
||||
(nav).NavIcon = 0;\
|
||||
(nav).Enable = 0;\
|
||||
(nav).CameraType = 0;\
|
||||
(nav).CameraSpeed = 0;\
|
||||
(nav).LimitedSpeed = 0;\
|
||||
(nav).RoadRemainDis = 0;\
|
||||
}while(0)
|
||||
#endif // INIT_JsonNav
|
||||
#ifndef DEINIT_JsonNav
|
||||
#define DEINIT_JsonNav(nav) do{\
|
||||
(nav).RemainDis1[0] = 0;\
|
||||
(nav).RemainTime1[0] = 0;\
|
||||
(nav).CurrRoadName[0] = 0;\
|
||||
(nav).NextRoadName[0] = 0;\
|
||||
(nav).UpdRemainInfo1++;\
|
||||
(nav).UpdCurrRoadName++;\
|
||||
(nav).UpdNextRoadName++;\
|
||||
(nav).NavIcon = 0;\
|
||||
(nav).Enable = 0;\
|
||||
(nav).CameraType = 0;\
|
||||
(nav).CameraSpeed = 0;\
|
||||
(nav).LimitedSpeed = 0;\
|
||||
(nav).RoadRemainDis = 0;\
|
||||
}while(0)
|
||||
#endif // DEINIT_JsonNav
|
||||
|
||||
#define MAX_COVER_WIDTH 500
|
||||
#define MAX_COVER_HEIGHT 500
|
||||
|
||||
#define MAX_SONG_NAME_LENGTH 100
|
||||
#define MAX_ARTIST_NAME_LENGTH 100
|
||||
#define MAX_COVER_BMP_SIZE (MAX_COVER_WIDTH*MAX_COVER_HEIGHT*4)
|
||||
typedef struct Struct_JsonMusic
|
||||
{
|
||||
Int08 SongName[MAX_SONG_NAME_LENGTH];
|
||||
Int08 ArtistName[MAX_ARTIST_NAME_LENGTH];
|
||||
UInt08 PicBmp[MAX_COVER_BMP_SIZE];
|
||||
Int32 PicWidth;
|
||||
Int32 PicHeight;
|
||||
Int32 picFmt;
|
||||
UInt32 Duration;
|
||||
UInt32 Progress;
|
||||
UInt16 PicHashCode;
|
||||
UInt08 Status;
|
||||
UInt08 Type;
|
||||
UInt08 HasCover;
|
||||
UInt08 Enable;
|
||||
UInt08 UpdMusic;
|
||||
} JsonMusic;
|
||||
#ifndef INIT_JsonMusic
|
||||
#define INIT_JsonMusic(msc) do{\
|
||||
(msc).SongName[0] = 0;\
|
||||
(msc).ArtistName[0] = 0;\
|
||||
(msc).PicWidth = 0;\
|
||||
(msc).PicHeight = 0;\
|
||||
(msc).picFmt = 0;\
|
||||
(msc).Duration = 100;\
|
||||
(msc).Progress = 0;\
|
||||
(msc).PicHashCode = 0;\
|
||||
(msc).Type = 0;\
|
||||
(msc).Status = PlayStatus_Stop;\
|
||||
(msc).HasCover = INS_FALSE;\
|
||||
(msc).Enable = INS_FALSE;\
|
||||
(msc).UpdMusic = 0;\
|
||||
}while(0)
|
||||
#endif // INIT_JsonMusic
|
||||
#ifndef DEINIT_JsonMusic
|
||||
#define DEINIT_JsonMusic(msc) do{\
|
||||
(msc).SongName[0] = 0;\
|
||||
(msc).ArtistName[0] = 0;\
|
||||
(msc).PicWidth = 0;\
|
||||
(msc).PicHeight = 0;\
|
||||
(msc).picFmt = 0;\
|
||||
(msc).Duration = 100;\
|
||||
(msc).Progress = 0;\
|
||||
(msc).PicHashCode = 0;\
|
||||
(msc).Type = 0;\
|
||||
(msc).Status = PlayStatus_Stop;\
|
||||
(msc).HasCover = INS_FALSE;\
|
||||
(msc).Enable = INS_FALSE;\
|
||||
(msc).UpdMusic++;\
|
||||
}while(0)
|
||||
#endif // DEINIT_JsonMusic
|
||||
|
||||
#define MAX_RADIO_SYS_NAME_LENGTH 4
|
||||
#define MAX_RADIO_FREQ_NAME_LENGTH 12
|
||||
#define MAX_RADIO_NAME_LENGTH 60
|
||||
typedef struct Struct_JsonRadio
|
||||
{
|
||||
Int08 System[MAX_RADIO_SYS_NAME_LENGTH];
|
||||
Int08 Frequency[MAX_RADIO_FREQ_NAME_LENGTH];
|
||||
Int08 Name[MAX_RADIO_NAME_LENGTH];
|
||||
UInt08 PicBmp[MAX_COVER_BMP_SIZE];
|
||||
Int32 PicWidth;
|
||||
Int32 PicHeight;
|
||||
UInt32 picFmt;
|
||||
UInt16 PicHashCode;
|
||||
UInt08 Status;
|
||||
UInt08 HasCover;
|
||||
UInt08 Enable;
|
||||
UInt08 UpdRadio;
|
||||
} JsonRadio;
|
||||
#ifndef INIT_JsonRadio
|
||||
#define INIT_JsonRadio(rd) do{\
|
||||
(rd).System[0] = 0;\
|
||||
(rd).Frequency[0] = 0;\
|
||||
(rd).Name[0] = 0;\
|
||||
(rd).PicWidth = 0;\
|
||||
(rd).PicHeight = 0;\
|
||||
(rd).picFmt = 0;\
|
||||
(rd).PicHashCode = 0;\
|
||||
(rd).Status = PlayStatus_Stop;\
|
||||
(rd).HasCover = INS_FALSE;\
|
||||
(rd).Enable = INS_FALSE;\
|
||||
(rd).UpdRadio = 0;\
|
||||
}while(0)
|
||||
#endif // INIT_JsonRadio
|
||||
#ifndef DEINIT_JsonRadio
|
||||
#define DEINIT_JsonRadio(rd) do{\
|
||||
(rd).System[0] = 0;\
|
||||
(rd).Frequency[0] = 0;\
|
||||
(rd).Name[0] = 0;\
|
||||
(rd).PicWidth = 0;\
|
||||
(rd).PicHeight = 0;\
|
||||
(rd).picFmt = 0;\
|
||||
(rd).PicHashCode = 0;\
|
||||
(rd).Status = PlayStatus_Stop;\
|
||||
(rd).HasCover = INS_FALSE;\
|
||||
(rd).Enable = INS_FALSE;\
|
||||
(rd).UpdRadio++;\
|
||||
}while(0)
|
||||
#endif // DEINIT_JsonRadio
|
||||
|
||||
#define MAX_WETH_CITY_NAME_LENGTH 60
|
||||
#define MAX_WETH_DATE_NAME_LENGTH 24
|
||||
#define MAX_WETH_STATUS_NAME_LENGTH 60
|
||||
#define MAX_WETH_ENV_NAME_LENGTH 12
|
||||
typedef struct Struct_JsonWeather
|
||||
{
|
||||
Int08 City[MAX_WETH_CITY_NAME_LENGTH];
|
||||
Int08 Date[MAX_WETH_DATE_NAME_LENGTH];
|
||||
Int08 Status[MAX_WETH_STATUS_NAME_LENGTH];
|
||||
Int08 Enviroment[MAX_WETH_ENV_NAME_LENGTH];
|
||||
Int08 StatusId;
|
||||
UInt08 Enable;
|
||||
Int08 Tmp;
|
||||
Int08 DayTmp;
|
||||
Int08 NightTmp;
|
||||
UInt08 UpdWth;
|
||||
} JsonWeather;
|
||||
#ifndef INIT_JsonWeather
|
||||
#define INIT_JsonWeather(wt) do{\
|
||||
(wt).City[0] = 0;\
|
||||
(wt).Date[0] = 0;\
|
||||
(wt).Status[0] = 0;\
|
||||
(wt).Enviroment[0] = 0;\
|
||||
(wt).StatusId = 0;\
|
||||
(wt).Enable = 0;\
|
||||
(wt).Tmp = 0;\
|
||||
(wt).DayTmp = 0;\
|
||||
(wt).NightTmp = 0;\
|
||||
(wt).UpdWth = 0;\
|
||||
}while(0)
|
||||
#endif // INIT_JsonWeather
|
||||
#ifndef DEINIT_JsonWeather
|
||||
#define DEINIT_JsonWeather(wt) do{\
|
||||
(wt).City[0] = 0;\
|
||||
(wt).Date[0] = 0;\
|
||||
(wt).Status[0] = 0;\
|
||||
(wt).Enviroment[0] = 0;\
|
||||
(wt).StatusId = 0;\
|
||||
(wt).Tmp = 0;\
|
||||
(wt).Enable = 0;\
|
||||
(wt).DayTmp = 0;\
|
||||
(wt).NightTmp = 0;\
|
||||
(wt).UpdWth++;\
|
||||
}while(0)
|
||||
#endif // DEINIT_JsonWeather
|
||||
|
||||
#define MAX_ACCOUNT_NAME_LENGTH 60
|
||||
typedef struct Struct_JsonAccount
|
||||
{
|
||||
Int08 CurrUsrName[MAX_ACCOUNT_NAME_LENGTH];
|
||||
UInt32 UpdAccount;
|
||||
UInt08 Enable;
|
||||
} JsonAccount;
|
||||
#ifndef INIT_JsonAccount
|
||||
#define INIT_JsonAccount(ac) do{\
|
||||
(ac).CurrUsrName[0] = 0;\
|
||||
(ac).UpdAccount = 0;\
|
||||
(ac).Enable = 0;\
|
||||
}while(0)
|
||||
#endif // INIT_JsonAccount
|
||||
#ifndef DEINIT_JsonAccount
|
||||
#define DEINIT_JsonAccount(ac) do{\
|
||||
(ac).CurrUsrName[0] = 0;\
|
||||
(ac).UpdAccount++;\
|
||||
(ac).Enable = 0;\
|
||||
}while(0)
|
||||
#endif // DEINIT_JsonAccount
|
||||
|
||||
#define MAX_NETRADIO_FREQ_NAME_LENGTH 60
|
||||
#define MAX_NETRADIO_NAME_LENGTH 60
|
||||
typedef struct Struct_JsonNetRadio
|
||||
{
|
||||
Int08 Frequency[MAX_NETRADIO_FREQ_NAME_LENGTH];
|
||||
Int08 Name[MAX_NETRADIO_NAME_LENGTH];
|
||||
UInt08 PicBmp[MAX_COVER_BMP_SIZE];
|
||||
Int32 PicWidth;
|
||||
Int32 PicHeight;
|
||||
UInt32 picFmt;
|
||||
UInt32 Duration;
|
||||
UInt32 Progress;
|
||||
UInt16 PicHashCode;
|
||||
UInt08 UpdNetRadio;
|
||||
UInt08 Enable;
|
||||
UInt08 HasCover;
|
||||
UInt08 Type;
|
||||
} JsonNetRadio;
|
||||
#ifndef INIT_JsonNetRadio
|
||||
#define INIT_JsonNetRadio(nr) do{\
|
||||
(nr).Frequency[0] = 0;\
|
||||
(nr).Name[0] = 0;\
|
||||
(nr).PicWidth = 0;\
|
||||
(nr).PicHeight = 0;\
|
||||
(nr).picFmt = 0;\
|
||||
(nr).Duration = 0;\
|
||||
(nr).Progress = 0;\
|
||||
(nr).PicHashCode = 0;\
|
||||
(nr).UpdNetRadio = 0;\
|
||||
(nr).Enable = 0;\
|
||||
(nr).HasCover = INS_FALSE;\
|
||||
(nr).Type = NRADIO_TYPE_NET;\
|
||||
}while(0)
|
||||
#endif // INIT_JsonNetRadio
|
||||
#ifndef DEINIT_JsonNetRadio
|
||||
#define DEINIT_JsonNetRadio(nr) do{\
|
||||
(nr).Frequency[0] = 0;\
|
||||
(nr).Name[0] = 0;\
|
||||
(nr).PicWidth = 0;\
|
||||
(nr).PicHeight = 0;\
|
||||
(nr).picFmt = 0;\
|
||||
(nr).Duration = 100;\
|
||||
(nr).Progress = 60;\
|
||||
(nr).PicHashCode = 0;\
|
||||
(nr).UpdNetRadio++;\
|
||||
(nr).Enable = 0;\
|
||||
(nr).HasCover = INS_FALSE;\
|
||||
(nr).Type = NRADIO_TYPE_NET;\
|
||||
}while(0)
|
||||
#endif // DEINIT_JsonNetRadio//NRADIO_TYPE_NET;
|
||||
|
||||
typedef struct Struct_JsonUpgrade
|
||||
{
|
||||
Int08 *Sign;
|
||||
Int08 *Md5;
|
||||
UInt08 UpdUpgrade;
|
||||
Int16 SignSize;
|
||||
UInt32 FileSize;
|
||||
UInt32 RecvSize;
|
||||
} JsonUpgrade;
|
||||
#ifndef INIT_JsonUpgrade
|
||||
#define INIT_JsonUpgrade(ug) do{\
|
||||
(ug).Sign = NULL;\
|
||||
(ug).Md5 = NULL;\
|
||||
(ug).SignSize = 0;\
|
||||
(ug).UpdUpgrade = 0;\
|
||||
(ug).FileSize = 0;\
|
||||
(ug).RecvSize = 0;\
|
||||
}while(0)
|
||||
#endif // INIT_JsonUpgrade
|
||||
#ifndef DEINIT_JsonUpgrade
|
||||
#define DEINIT_JsonUpgrade(ug) do{\
|
||||
if(NULL != (ug).Sign)\
|
||||
{\
|
||||
free((ug).Sign);\
|
||||
(ug).Sign = NULL;\
|
||||
}\
|
||||
if(NULL != (ug).Md5)\
|
||||
{\
|
||||
free((ug).Md5);\
|
||||
(ug).Md5 = NULL;\
|
||||
}\
|
||||
(ug).SignSize = 0;\
|
||||
(ug).UpdUpgrade++;\
|
||||
(ug).FileSize = 0;\
|
||||
(ug).RecvSize = 0;\
|
||||
}while(0)
|
||||
#endif // DEINIT_JsonUpgrade
|
||||
|
||||
#define MAX_CONTACT_INFO_NAME_LENGTH 100
|
||||
#define MAX_CONTACT_INFO_NUMBER_LENGTH 20
|
||||
#define MAX_BLUETOOTH_CTI_LIST_SIZE 32
|
||||
typedef struct Struct_ContactInfo
|
||||
{
|
||||
Int08 Name[MAX_CONTACT_INFO_NAME_LENGTH];
|
||||
Int08 Number[MAX_CONTACT_INFO_NUMBER_LENGTH];
|
||||
} ContactInfo;
|
||||
|
||||
typedef struct Struct_JsonBlueTooth
|
||||
{
|
||||
UInt08 PhoneStatus;
|
||||
UInt08 MuteStatus;
|
||||
Int08 CtiListSize;
|
||||
UInt08 UpdCtiList;
|
||||
UInt08 UpdSpeaker;
|
||||
UInt32 ConnectDuration;
|
||||
Int08 Name[MAX_CONTACT_INFO_NAME_LENGTH];
|
||||
Int08 Number[MAX_CONTACT_INFO_NUMBER_LENGTH];
|
||||
ContactInfo CtiList[MAX_BLUETOOTH_CTI_LIST_SIZE];
|
||||
} JsonBlueTooth;
|
||||
#ifndef INIT_JsonBlueTooth
|
||||
#define INIT_JsonBlueTooth(blt) do{\
|
||||
(blt).Name[0] = 0;\
|
||||
(blt).Number[0] = 0;\
|
||||
(blt).PhoneStatus = PHONE_Unavailable;\
|
||||
(blt).MuteStatus = 0;\
|
||||
(blt).CtiListSize = -1;\
|
||||
Int32 i;\
|
||||
for(i = 0; i < MAX_BLUETOOTH_CTI_LIST_SIZE; i++)\
|
||||
{\
|
||||
(blt).CtiList[i].Name[0] = 0;\
|
||||
(blt).CtiList[i].Number[0] = 0;\
|
||||
}\
|
||||
(blt).UpdCtiList = 0;\
|
||||
(blt).UpdSpeaker = 0;\
|
||||
(blt).ConnectDuration = 0;\
|
||||
}while(0)
|
||||
#endif // INIT_JsonBlueTooth
|
||||
#ifndef DEINIT_JsonBlueTooth
|
||||
#define DEINIT_JsonBlueTooth(blt) do{\
|
||||
(blt).Name[0] = 0;\
|
||||
(blt).Number[0] = 0;\
|
||||
Int32 i;\
|
||||
for(i = 0; i < MAX_BLUETOOTH_CTI_LIST_SIZE; i++)\
|
||||
{\
|
||||
(blt).CtiList[i].Name[0] = 0;\
|
||||
(blt).CtiList[i].Number[0] = 0;\
|
||||
}\
|
||||
(blt).PhoneStatus = PHONE_Unavailable;\
|
||||
(blt).MuteStatus = 0;\
|
||||
(blt).CtiListSize = -1;\
|
||||
(blt).UpdCtiList++;\
|
||||
(blt).UpdSpeaker++;\
|
||||
(blt).ConnectDuration = 0;\
|
||||
}while(0)
|
||||
#endif // DEINIT_JsonBlueTooth ,PHONE_InCall,PHONE_OutCall,PHONE_Connect,PHONE_Cancel_InCall,PHONE_Cancel_OutCall,PHONE_List,
|
||||
|
||||
typedef struct Struct_ReqBlueTooth
|
||||
{
|
||||
Int08 Name[MAX_CONTACT_INFO_NAME_LENGTH];
|
||||
Int08 Number[MAX_CONTACT_INFO_NUMBER_LENGTH];
|
||||
Int08 Status;
|
||||
Int08 Action;
|
||||
} ReqBlueTooth;
|
||||
#ifndef INIT_ReqBlueTooth
|
||||
#define INIT_ReqBlueTooth(req) do{\
|
||||
(req).Name[0] = 0;\
|
||||
(req).Number[0] = 0;\
|
||||
(req).Status = 0;\
|
||||
(req).Action = 0;\
|
||||
}while(0)
|
||||
#endif // INIT_ReqBlueTooth
|
||||
#ifndef DEINIT_ReqBlueTooth
|
||||
#define DEINIT_ReqBlueTooth(req) do{\
|
||||
(req).Name[0] = 0;\
|
||||
(req).Number[0] = 0;\
|
||||
(req).Status = 0;\
|
||||
(req).Action = 0;\
|
||||
}while(0)
|
||||
#endif // DEINIT_ReqBlueTooth
|
||||
|
||||
enum
|
||||
{
|
||||
CduRecord_Listening = 1,
|
||||
CduRecord_Recognizing = 2,
|
||||
CduRecord_Speaking = 3,
|
||||
CduRecord_Exit = 4,
|
||||
CduRecord_WakeUp = 5,
|
||||
CduRecord_Waiting = 6,
|
||||
CduRecord_MAX = CduRecord_Waiting,
|
||||
CduRecord_Default = CduRecord_Exit,
|
||||
|
||||
CduUsb_Disconnected = 0,
|
||||
CduUsb_Connected = 1,
|
||||
CduUsb_MAX = CduUsb_Connected,
|
||||
CduUsb_Default = CduUsb_Disconnected,
|
||||
|
||||
BlutsMusic_Disconnected = 0,
|
||||
BlutsMusic_Connected = 1,
|
||||
BlutsMusic_MAX = BlutsMusic_Connected,
|
||||
BlutsMusic_Default = BlutsMusic_Disconnected,
|
||||
|
||||
PlayStatus_Playing = 0,
|
||||
PlayStatus_Pause = 1,
|
||||
PlayStatus_Stop = 2,
|
||||
PlayStatus_Search = 3,
|
||||
PlayStatus_Default = PlayStatus_Stop,
|
||||
|
||||
Media_Src_Music = 0,
|
||||
Media_Src_Radio = 1,
|
||||
Media_Src_NetRadio = 2,
|
||||
Media_Src_None = 3,
|
||||
Media_Src_Default = Media_Src_None,
|
||||
|
||||
CduWeather_Invalid = 0,
|
||||
CduWeather_Valid = 1,
|
||||
|
||||
CduNavigation_Invalid = 0,
|
||||
CduNavigation_Valid = 1,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
NAV_ICON_TURN_LEFT = 1,
|
||||
NAV_ICON_TURN_RIGHT = 2,
|
||||
NAV_ICON_LEFT_FRONT = 3,
|
||||
NAV_ICON_RIGHT_FRONT = 4,
|
||||
NAV_ICON_LEFT_BACK = 5,
|
||||
NAV_ICON_RIGHT_BACK = 6,
|
||||
NAV_ICON_TURN_ROUND = 7,
|
||||
NAV_ICON_GO_STRAIGHT = 8,
|
||||
NAV_ICON_ENTER_ROUNDABOUT = 9,
|
||||
NAV_ICON_EXIT_ROUNDABOUT = 10,
|
||||
NAV_ICON_ROLL_STATION = 11,
|
||||
NAV_ICON_DESTINATION = 12,
|
||||
NAV_ICON_ENTER_TUNNEL = 13,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
MUSIC_TYPE_LOCAL = 1,
|
||||
MUSIC_TYPE_BLUETOOTH = 2,
|
||||
MUSIC_TYPE_UPAN = 3,
|
||||
|
||||
NRADIO_TYPE_NET = 1,
|
||||
NRADIO_TYPE_BOOK = 2,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
OTA_Normal = 0,
|
||||
OTA_TRANSFERING,
|
||||
OTA_TRANSFER_INT,
|
||||
OTA_TRANSFER_SUCC,
|
||||
OTA_DECRYPTING,
|
||||
OTA_UNPACKING,
|
||||
OTA_DECRYPT_FAIL,
|
||||
OTA_UNPACK_FAIL,
|
||||
OTA_DECRYPT_SUCC,
|
||||
OTA_UNPACK_SUCC,
|
||||
OTA_HMI_UPGRADING,
|
||||
OTA_HMI_UPGRAD_FAIL,
|
||||
OTA_HMI_ROLLBACKING,
|
||||
OTA_HMI_ROLLBACK_SUCC,
|
||||
OTA_HMI_UPGRAD_SUCC,
|
||||
OTA_BACKUP_SUCC,
|
||||
OTA_BACKUP_FAIL,
|
||||
OTA_DATA_MD5_UNMATCH,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PHONE_Unavailable = 0,
|
||||
PHONE_InCall,
|
||||
PHONE_OutCall,
|
||||
PHONE_Connect,
|
||||
PHONE_Cancel_InCall,
|
||||
PHONE_Cancel_OutCall,
|
||||
PHONE_List,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PHONE_REQ_Ring = 0,
|
||||
PHONE_REQ_Conn,
|
||||
PHONE_REQ_Cancel,
|
||||
PHONE_REQ_Mute,
|
||||
PHONE_REQ_Unmute,
|
||||
};
|
||||
|
||||
CduTcpApi JsonNav NavInfo;
|
||||
CduTcpApi JsonMusic MusicInfo;
|
||||
CduTcpApi JsonRadio RadioInfo;
|
||||
CduTcpApi JsonWeather WeatherInfo;
|
||||
CduTcpApi JsonAccount AccountInfo;
|
||||
CduTcpApi JsonNetRadio NetRadioInfo;
|
||||
CduTcpApi JsonUpgrade UpgradeInfo;
|
||||
CduTcpApi JsonBlueTooth BlueToothInfo;
|
||||
|
||||
CduTcpApi ReqBlueTooth BlueToothReqRing;
|
||||
CduTcpApi ReqBlueTooth BlueToothReqConn;
|
||||
CduTcpApi ReqBlueTooth BlueToothReqCancel;
|
||||
CduTcpApi ReqBlueTooth BlueToothReqMute;
|
||||
CduTcpApi ReqBlueTooth BlueToothReqUnmute;
|
||||
|
||||
CduTcpApi UInt08 CduRecordState;
|
||||
CduTcpApi UInt08 CduUsbState;
|
||||
CduTcpApi UInt08 CduMediaSrc;
|
||||
CduTcpApi UInt08 CduWeatherState;
|
||||
|
||||
CduTcpApi UInt08 CduNavigationState;
|
||||
CduTcpApi UInt08 BlutsMusicState;
|
||||
CduTcpApi UInt08 OtaState;
|
||||
CduTcpApi Un08 BlueToothReqFlag;
|
||||
#define REQ_BlueToothReqRing BlueToothReqFlag.sbit.b0
|
||||
#define REQ_BlueToothReqConn BlueToothReqFlag.sbit.b1
|
||||
#define REQ_BlueToothReqCancel BlueToothReqFlag.sbit.b2
|
||||
#define REQ_BlueToothReqMute BlueToothReqFlag.sbit.b3
|
||||
#define REQ_BlueToothReqUnmute BlueToothReqFlag.sbit.b4
|
||||
|
||||
//#ifndef UPDATE_OTA_STATE
|
||||
//#define UPDATE_OTA_STATE(state) OtaState = (state)
|
||||
//#endif // UPDATE_OTA_STATE
|
||||
|
||||
#ifndef UPDATE_OTA_STATE
|
||||
#define UPDATE_OTA_STATE(state) do{\
|
||||
if(OtaState != (state))\
|
||||
{\
|
||||
printf(" OtaState Update[%u]->[%u]\n", OtaState, (state));\
|
||||
}\
|
||||
OtaState = (state);\
|
||||
}while(0)
|
||||
#endif // UPDATE_OTA_STATE
|
||||
|
||||
#define MAX_SPEECH_CONTENT_LENGTH 100
|
||||
#define MAX_NORMAL_ROAD_NAME_LENGTH 60
|
||||
CduTcpApi Int08 SpeechContent[MAX_SPEECH_CONTENT_LENGTH];
|
||||
CduTcpApi Int08 NormalRoadName[MAX_NORMAL_ROAD_NAME_LENGTH];
|
||||
|
||||
CduTcpApi UInt16 SpeechContentSize;
|
||||
CduTcpApi UInt16 NormalRoadNameSize;
|
||||
CduTcpApi UInt16 UpdSpeechContent;
|
||||
CduTcpApi UInt16 UpdNormalRoadName;
|
||||
|
||||
#endif // CDU_TCP_APP_H_INCLUDED
|
||||
20
insDavi2.0/include/Protocol/MainBoard_IIC.h
Normal file
20
insDavi2.0/include/Protocol/MainBoard_IIC.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef MAINBOARD_IIC_H_INCLUDED
|
||||
#define MAINBOARD_IIC_H_INCLUDED
|
||||
|
||||
#include <InsCfg.h>
|
||||
#include <BaseTypes.h>
|
||||
|
||||
#ifndef MbIicApi
|
||||
#ifndef MAINBOARD_IIC_IMPLEMENT
|
||||
#define MbIicApi extern
|
||||
#else
|
||||
#define MbIicApi
|
||||
#endif // MAINBOARD_IIC_IMPLEMENT
|
||||
#endif // MbIicApi
|
||||
|
||||
MbIicApi void MB_IIC_SetInitialValue();
|
||||
MbIicApi void MB_IIC_DecodeData(UInt08 frameId);
|
||||
MbIicApi void MB_IIC_EncodeData(UInt08 frameId);
|
||||
MbIicApi Int32 MB_IIC_VerifyAndStore(UInt08 id, UInt08 *data);
|
||||
|
||||
#endif // MAINBOARD_IIC_H_INCLUDED
|
||||
627
insDavi2.0/include/Protocol/MainBoard_IIC_App.h
Normal file
627
insDavi2.0/include/Protocol/MainBoard_IIC_App.h
Normal file
@@ -0,0 +1,627 @@
|
||||
#ifndef MAINBOARD_IIC_APP_H_INCLUDED
|
||||
#define MAINBOARD_IIC_APP_H_INCLUDED
|
||||
|
||||
#include <Protocol/MainBoard_IIC.h>
|
||||
|
||||
MbIicApi UInt08 Speed; /*车速 [0,240]km/h*/
|
||||
MbIicApi UInt08 Battery; /*电量 [0,100]%*/
|
||||
MbIicApi UInt08 Gear; /*档位 [0:不显示, 1:D, 2:N, 3:R, 4:P, >4:预留]*/
|
||||
MbIicApi UInt08 IND_FONT_COLLOSION; /*前向碰撞预防系统故障灯*/
|
||||
MbIicApi UInt08 IND_LANE_WARNING; /*车道偏离预警功能故障灯*/
|
||||
MbIicApi UInt08 IND_BLIND_AUXILIARY; /*盲区安全辅助系统故障灯*/
|
||||
MbIicApi UInt08 IND_REAR_AUXILIARY; /*车道居中辅助功能故障灯*/
|
||||
MbIicApi UInt08 IND_ACC_FAILURE; /*自适应巡航功能故障灯*/
|
||||
MbIicApi UInt08 IND_BAT_LACK; /* 续航里程指示灯 */
|
||||
MbIicApi UInt08 LeftModuleID; /*左模块ID*/
|
||||
|
||||
MbIicApi UInt08 RightModuleID; /*右模块ID*/
|
||||
MbIicApi UInt08 WorkMode; /*工作模式 [1:OFF, 2:ON]*/
|
||||
MbIicApi UInt08 ChargingState; /*充电状态 [0:未连接, 1~11:充电界面]*/
|
||||
MbIicApi UInt08 SpeedLimit; /*限速值 [0:无限速, 1-240:限速值(km)]*/
|
||||
|
||||
MbIicApi UInt08 DateDay; /*日份*/
|
||||
MbIicApi UInt08 DateMonth; /*月份*/
|
||||
MbIicApi UInt08 SysTimeFmt; /*系统时制 0:24h, 1:12h*/
|
||||
MbIicApi UInt08 IicComStatus; /*IIC 通信异常*/
|
||||
|
||||
MbIicApi UInt08 AvgElectricCost; /*平均电耗*/
|
||||
MbIicApi UInt08 AccAvgElectricCost; /*累计平均电耗*/
|
||||
MbIicApi UInt08 LeftListCursor; /*列表光标*/
|
||||
MbIicApi UInt08 RightListCursor; /*列表光标*/
|
||||
|
||||
MbIicApi UInt08 HintID; /*提示信息ID*/
|
||||
MbIicApi UInt08 AlarmID; /*报警信息ID*/
|
||||
MbIicApi UInt08 AlarmOption; /*报警信息ID*/
|
||||
MbIicApi UInt08 ChargingTips; /*充电提示ID*/
|
||||
|
||||
MbIicApi UInt08 RadarSpacingF0; /*倒车雷达探测距离 前0*/
|
||||
MbIicApi UInt08 RadarSpacingF1; /*倒车雷达探测距离 前1*/
|
||||
MbIicApi UInt08 RadarSpacingF2; /*倒车雷达探测距离 前2*/
|
||||
MbIicApi UInt08 RadarSpacingF3; /*倒车雷达探测距离 前3*/
|
||||
|
||||
MbIicApi UInt08 RadarSpacingF4; /*倒车雷达探测距离 前4*/
|
||||
MbIicApi UInt08 RadarSpacingF5; /*倒车雷达探测距离 前5*/
|
||||
MbIicApi UInt08 RadarSpacingB0; /*倒车雷达探测距离 后0*/
|
||||
MbIicApi UInt08 RadarSpacingB1; /*倒车雷达探测距离 后1*/
|
||||
|
||||
MbIicApi UInt08 RadarSpacingB2; /*倒车雷达探测距离 后2*/
|
||||
MbIicApi UInt08 RadarSpacingB3; /*倒车雷达探测距离 后3*/
|
||||
MbIicApi UInt08 RadarSpacingB4; /*倒车雷达探测距离 后4*/
|
||||
MbIicApi UInt08 RadarSpacingB5; /*倒车雷达探测距离 后5*/
|
||||
|
||||
MbIicApi UInt08 RadarColorF0; /*倒车雷达探测距离 前0*/
|
||||
MbIicApi UInt08 RadarColorF1; /*倒车雷达探测距离 前1*/
|
||||
MbIicApi UInt08 RadarColorF2; /*倒车雷达探测距离 前2*/
|
||||
MbIicApi UInt08 RadarColorF3; /*倒车雷达探测距离 前3*/
|
||||
MbIicApi UInt08 RadarColorF4; /*倒车雷达探测距离 前4*/
|
||||
MbIicApi UInt08 RadarColorF5; /*倒车雷达探测距离 前5*/
|
||||
|
||||
MbIicApi UInt08 RadarColorB0; /*倒车雷达探测距离 后0*/
|
||||
MbIicApi UInt08 RadarColorB1; /*倒车雷达探测距离 后1*/
|
||||
MbIicApi UInt08 RadarColorB2; /*倒车雷达探测距离 后2*/
|
||||
MbIicApi UInt08 RadarColorB3; /*倒车雷达探测距离 后3*/
|
||||
MbIicApi UInt08 RadarColorB4; /*倒车雷达探测距离 后4*/
|
||||
MbIicApi UInt08 RadarColorB5; /*倒车雷达探测距离 后5*/
|
||||
|
||||
MbIicApi UInt08 TirePressureLF; /*左前轮胎压力值*/
|
||||
MbIicApi UInt08 TirePressureRF; /*右前轮胎压力值*/
|
||||
MbIicApi UInt08 TirePressureLB; /*左后轮胎压力值*/
|
||||
MbIicApi UInt08 TirePressureRB; /*右后轮胎压力值*/
|
||||
|
||||
MbIicApi UInt08 TireTemperatureLF; /*左前轮胎温度值*/
|
||||
MbIicApi UInt08 TireTemperatureRF; /*右前轮胎温度值*/
|
||||
MbIicApi UInt08 TireTemperatureLB; /*左后轮胎温度值*/
|
||||
MbIicApi UInt08 TireTemperatureRB; /*右后轮胎温度值*/
|
||||
|
||||
MbIicApi UInt08 MenuWindyMode; /*菜单 空调吹风模式*/
|
||||
MbIicApi Un08 MenuMediaSrcFlg; /*菜单 可用媒体源标记*/
|
||||
MbIicApi UInt08 XccSpeed; /*(自适应/定速)巡航车速*/
|
||||
MbIicApi Un08 TireBits; /*轮胎数值标记位*/
|
||||
#define TIRE_LF_TEMP_VALID TireBits.sbit.b0
|
||||
#define TIRE_RF_TEMP_VALID TireBits.sbit.b1
|
||||
#define TIRE_LB_TEMP_VALID TireBits.sbit.b2
|
||||
#define TIRE_RB_TEMP_VALID TireBits.sbit.b3
|
||||
#define TIRE_LF_STATUS TireBits.sbit.b4
|
||||
#define TIRE_RF_STATUS TireBits.sbit.b5
|
||||
#define TIRE_LB_STATUS TireBits.sbit.b6
|
||||
#define TIRE_RB_STATUS TireBits.sbit.b7
|
||||
|
||||
MbIicApi Int08 IndMute; /*静音*/
|
||||
MbIicApi Int08 _TrafficLaneParam2; /*道路线参数 2 (2阶参数)*/
|
||||
MbIicApi Int08 _TrafficLaneParam3; /*道路线参数 3 (3阶参数)*/
|
||||
|
||||
MbIicApi Int08 TrafficLaneParam0_LL; /*道路线左左参数 0 (常数参数)*/
|
||||
MbIicApi Int08 TrafficLaneParam0_L; /*道路线左参数 0 (常数参数)*/
|
||||
MbIicApi Int08 TrafficLaneParam0_R; /*道路线右参数 0 (常数参数)*/
|
||||
MbIicApi Int08 TrafficLaneParam0_RR; /*道路线右右参数 0 (常数参数)*/
|
||||
|
||||
MbIicApi UInt08 TrafficLaneStatus_LL; /*道路线左左状态*/
|
||||
MbIicApi UInt08 TrafficLaneStatus_L; /*道路线左状态*/
|
||||
MbIicApi UInt08 TrafficLaneStatus_R; /*道路线右状态*/
|
||||
MbIicApi UInt08 TrafficLaneStatus_RR; /*道路线右右状态*/
|
||||
|
||||
enum
|
||||
{
|
||||
RADAR_PRIORITY_HEAD = 0,
|
||||
RADAR_PRIORITY_TAIL = 1,
|
||||
};
|
||||
MbIicApi UInt08 EnergyCostIdx; /*最近100m能耗记录id*/
|
||||
MbIicApi UInt08 RadarPriority; /*雷达优先选择 0:车头雷达, 1:车后雷达*/
|
||||
MbIicApi UInt08 RadarAlarm; /*雷达报警 0:最大探测距离内 无 障碍物, 1:最大探测距离内 有 障碍物*/
|
||||
MbIicApi UInt08 SpeedWarn; /*报警车速值 [0:车速报警功能关闭, 1-240:报警车速值(km)]*/
|
||||
|
||||
MbIicApi UInt08 MenuID; /*菜单ID*/
|
||||
MbIicApi UInt08 MenuLastID; /*最近次访问的菜单ID*/
|
||||
MbIicApi UInt08 MenuLstCursor; /*列表菜单光标值*/
|
||||
MbIicApi Un08 MenuLstFlg; /*可用列表菜单项标记*/
|
||||
#define MenuLstFlgTemp MenuLstFlg.sbit.b0 /*可用菜单项标记 空调温度*/
|
||||
#define MenuLstFlgWindPwr MenuLstFlg.sbit.b1 /*可用菜单项标记 空调风力*/
|
||||
#define MenuLstFlgBackLight MenuLstFlg.sbit.b2 /*可用菜单项标记 背光亮度*/
|
||||
#define MenuLstFlgMediaSrc MenuLstFlg.sbit.b3 /*可用菜单项标记 媒体源*/
|
||||
#define MenuLstFlgWindMode MenuLstFlg.sbit.b4 /*可用菜单项标记 空调吹风模式*/
|
||||
|
||||
MbIicApi UInt08 MenuTemperature; /*空调温度*/
|
||||
MbIicApi UInt08 MenuWindyPower; /*空调风力*/
|
||||
MbIicApi UInt08 MenuBrightness; /*背光亮度*/
|
||||
MbIicApi Un08 MenuMediaSrcState; /*媒体源菜单状态*/
|
||||
#define MenuMediaSrcCursor MenuMediaSrcState.sbit04.b03 /*媒体源菜单光标值*/
|
||||
#define MenuMediaSrcSelect MenuMediaSrcState.sbit04.b47 /*媒体源菜单选中值*/
|
||||
#define MenuMediaSrcFlgLocalMusic MenuMediaSrcFlg.sbit.b0 /*可用媒体源标记 本地音乐*/
|
||||
#define MenuMediaSrcFlgLocalRadio MenuMediaSrcFlg.sbit.b1 /*可用媒体源标记 本地电台*/
|
||||
#define MenuMediaSrcFlgNetRadio MenuMediaSrcFlg.sbit.b2 /*可用媒体源标记 网络电台*/
|
||||
#define MenuMediaSrcFlgBluTooth MenuMediaSrcFlg.sbit.b3 /*可用媒体源标记 蓝牙音乐*/
|
||||
#define MenuMediaSrcFlgAudioBook MenuMediaSrcFlg.sbit.b4 /*可用媒体源标记 有声读物*/
|
||||
|
||||
MbIicApi Un08 CarportValue0; /*泊车位数值 0*/
|
||||
MbIicApi Un08 CarportValue1; /*泊车位数值 1*/
|
||||
#define CarportAreaLeft CarportValue0.sbit.b0 /*显示可停区域左 0:不显示 1:显示*/
|
||||
#define CarportAreaRight CarportValue0.sbit.b1 /*显示可停区域右 0:不显示 1:显示*/
|
||||
#define CarportLeftSlot1 CarportValue0.sbit02.b23 /*可泊车位左一 0:不显示 1:虚线车位 2:实线车位 3: 标注车位*/
|
||||
#define CarportLeftSlot2 CarportValue0.sbit02.b45 /*可泊车位左二 0:不显示 1:虚线车位 2:实线车位 3: 标注车位*/
|
||||
#define CarportLeftSlot3 CarportValue0.sbit02.b67 /*可泊车位左三 0:不显示 1:虚线车位 2:实线车位 3: 标注车位*/
|
||||
#define CarportRightSlot1 CarportValue1.sbit02.b01 /*可泊车位右一 0:不显示 1:虚线车位 2:实线车位 3: 标注车位*/
|
||||
#define CarportRightSlot2 CarportValue1.sbit02.b23 /*可泊车位右二 0:不显示 1:虚线车位 2:实线车位 3: 标注车位*/
|
||||
#define CarportRightSlot3 CarportValue1.sbit02.b45 /*可泊车位右三 0:不显示 1:虚线车位 2:实线车位 3: 标注车位*/
|
||||
MbIicApi Un08 ForwardVehicleData0; /*前方车辆数值 0*/
|
||||
MbIicApi Un08 ForwardVehicleData1; /*前方车辆数值 1*/
|
||||
MbIicApi Un08 ForwardVehicleData2; /*前方车辆数值 2*/
|
||||
MbIicApi Un08 ForwardVehicleData3; /*前方车辆数值 3*/
|
||||
#define ForwardVehicle1Type ForwardVehicleData0.sbit02.b01 /*前方车辆_1 类型*/
|
||||
#define ForwardVehicle1Color ForwardVehicleData0.sbit23.b24 /*前方车辆_1 颜色*/
|
||||
#define ForwardVehicle2Color ForwardVehicleData0.sbit23.b57 /*前方车辆_2 颜色*/
|
||||
#define ForwardVehicle2Type ForwardVehicleData1.sbit02.b01 /*前方车辆_2 类型*/
|
||||
#define ForwardVehicle3Color ForwardVehicleData1.sbit23.b24 /*前方车辆_3 颜色*/
|
||||
#define ForwardVehicle4Color ForwardVehicleData1.sbit23.b57 /*前方车辆_4 颜色*/
|
||||
#define ForwardVehicle3Type ForwardVehicleData2.sbit02.b01 /*前方车辆_3 类型*/
|
||||
#define ForwardVehicle5Color ForwardVehicleData2.sbit23.b24 /*前方车辆_5 颜色*/
|
||||
#define ForwardVehicle6Color ForwardVehicleData2.sbit23.b57 /*前方车辆_7 颜色*/
|
||||
#define ForwardVehicle4Type ForwardVehicleData3.sbit02.b01 /*前方车辆_4 类型*/
|
||||
#define ForwardVehicle5Type ForwardVehicleData3.sbit02.b23 /*前方车辆_5 类型*/
|
||||
#define ForwardVehicle6Type ForwardVehicleData3.sbit02.b45 /*前方车辆_6 类型*/
|
||||
|
||||
|
||||
MbIicApi Int08 ForwardVehicle1X; /*前方车辆_1 坐标x*/
|
||||
MbIicApi Int08 ForwardVehicle1Y; /*前方车辆_1 坐标y*/
|
||||
MbIicApi Int08 ForwardVehicle2X; /*前方车辆_2 坐标x*/
|
||||
MbIicApi Int08 ForwardVehicle2Y; /*前方车辆_2 坐标y*/
|
||||
|
||||
MbIicApi Int08 ForwardVehicle3X; /*前方车辆_3 坐标x*/
|
||||
MbIicApi Int08 ForwardVehicle3Y; /*前方车辆_3 坐标y*/
|
||||
MbIicApi Int08 ForwardVehicle4X; /*前方车辆_4 坐标x*/
|
||||
MbIicApi Int08 ForwardVehicle4Y; /*前方车辆_4 坐标y*/
|
||||
|
||||
MbIicApi Int08 ForwardVehicle5X; /*前方车辆_5 坐标x*/
|
||||
MbIicApi Int08 ForwardVehicle5Y; /*前方车辆_5 坐标y*/
|
||||
MbIicApi Int08 ForwardVehicle6X; /*前方车辆_6 坐标x*/
|
||||
MbIicApi Int08 ForwardVehicle6Y; /*前方车辆_6 坐标y*/
|
||||
|
||||
enum
|
||||
{
|
||||
MENU_LEFT_NULL = 0,
|
||||
MENU_LEFT_VOICE_MEDIA,
|
||||
MENU_LEFT_VOICE_AI,
|
||||
MENU_LEFT_VOICE_PHONE,
|
||||
MENU_LEFT_ACC,
|
||||
MENU_LEFT_NUM,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
Cruise_State_Invisible = 0,
|
||||
Cruise_State_CC_White = 1,
|
||||
Cruise_State_CC_Green = 2,
|
||||
Cruise_State_CC_Yellow = 3,
|
||||
Cruise_State_ACC_Gray = 4,
|
||||
Cruise_State_ACC_Blue = 5,
|
||||
Cruise_State_MAX = Cruise_State_ACC_Blue,
|
||||
};
|
||||
|
||||
MbIicApi UInt08 MenuLeftId; /*左侧菜单ID*/
|
||||
MbIicApi UInt08 CruiseState; /*左侧菜单数值*/
|
||||
MbIicApi UInt08 RightSideState; /*右侧显示状态*/
|
||||
MbIicApi UInt08 McuBltOpState; /*蓝牙电话MCU操作状态*/
|
||||
|
||||
MbIicApi UInt08 McuBltOpListCursor; /*蓝牙电话MCU操作光标-通话列表*/
|
||||
MbIicApi UInt08 McuBltOpInCallCursor; /*蓝牙电话MCU操作光标-来电*/
|
||||
MbIicApi UInt08 McuBltOpSpeakCursor; /*蓝牙电话MCU操作光标-拨出中/通话中*/
|
||||
MbIicApi UInt08 McuBltOpListClick; /*蓝牙电话MCU操作选中光标-通话列表*/
|
||||
|
||||
MbIicApi UInt08 McuBltOpInCallClick; /*蓝牙电话MCU操作选中光标-来电*/
|
||||
MbIicApi UInt08 McuBltOpSpeakClick; /*蓝牙电话MCU操作选中光标-拨出中/通话中*/
|
||||
MbIicApi Int08 BlutPhoneCursorNum; /*外发 蓝牙电话模块光标项数*/
|
||||
MbIicApi UInt08 HmiDspState; /*外发 HMI显示状态*/
|
||||
enum
|
||||
{
|
||||
HMI_DSP_INIT = 0,
|
||||
HMI_DSP_LAUNCHING = 1,
|
||||
HMI_DSP_ON = 2,
|
||||
HMI_DSP_OFF = 3,
|
||||
};
|
||||
|
||||
MbIicApi UInt08 XmartState; /*外发 HMI显示状态*/
|
||||
enum
|
||||
{
|
||||
Xmart_ON = 1,
|
||||
Xmart_OFF = 0,
|
||||
};
|
||||
|
||||
MbIicApi UInt08 ScreenColorTest; /*全屏颜色测试(诊断?)*/
|
||||
MbIicApi UInt08 McuBltOpListClickCnt; /*蓝牙电话MCU操作选中光标-通话列表 动作计数*/
|
||||
MbIicApi UInt08 McuBltOpInCallClickCnt; /*蓝牙电话MCU操作选中光标-来电 动作计数*/
|
||||
MbIicApi UInt08 McuBltOpSpeakClickCnt; /*蓝牙电话MCU操作选中光标-拨出中/通话中 动作计数*/
|
||||
|
||||
MbIicApi UInt08 LaneLength_LL; /*左左车道长度*/
|
||||
MbIicApi UInt08 LaneLength_L; /*左车道长度*/
|
||||
MbIicApi UInt08 LaneLength_R; /*右车道长度*/
|
||||
MbIicApi UInt08 LaneLength_RR; /*右右车道长度*/
|
||||
|
||||
enum
|
||||
{
|
||||
FrontWheelRot_0 = 0,
|
||||
FrontWheelRot_L1,
|
||||
FrontWheelRot_L2,
|
||||
FrontWheelRot_L3,
|
||||
FrontWheelRot_R1,
|
||||
FrontWheelRot_R2,
|
||||
FrontWheelRot_R3,
|
||||
};
|
||||
enum
|
||||
{
|
||||
VehicleColor_Red = 0,
|
||||
VehicleColor_White,
|
||||
VehicleColor_Silver,
|
||||
VehicleColor_Blue,
|
||||
VehicleColor_SkyBlue,
|
||||
VehicleColor_MattGray,
|
||||
VehicleColor_DarkGray,
|
||||
VehicleColor_AllRed,
|
||||
VehicleColor_AllGray,
|
||||
VehicleColor_AllBlue,
|
||||
VehicleColor_Max = VehicleColor_AllBlue,
|
||||
};
|
||||
MbIicApi UInt08 FrontWheelRotState; /*前轮转向状态*/
|
||||
MbIicApi UInt08 VehicleColorCfg; /*前轮转向状态*/
|
||||
MbIicApi UInt08 EnergyCostIdx0; /*最近100m能耗记录id0*/
|
||||
|
||||
//MbIicApi UInt08 DemoPreviousCnt; /*[demo]下一张*/
|
||||
//MbIicApi UInt08 DemoNextCnt; /*[demo]下一张*/
|
||||
MbIicApi UInt16 RadarDistance; /*雷达距离*/
|
||||
|
||||
MbIicApi UInt08 FaceRecognitionstate; /*人脸识别状态位*/
|
||||
MbIicApi UInt08 ACCstate;
|
||||
enum
|
||||
{
|
||||
ACCstate_NULL ,/*不显示*/
|
||||
ACCstate_Left_Blue ,/*左蓝色*/
|
||||
ACCstate_Left_Red ,/*左红色*/
|
||||
ACCstate_Right_Blue ,/*右蓝色*/
|
||||
ACCstate_Right_Red ,/*右红色*/
|
||||
};
|
||||
|
||||
MbIicApi UInt08 MenuLeftValue[MENU_LEFT_NUM]; /*左侧菜单数值*/
|
||||
|
||||
MbIicApi UInt16 TripRange; /*续航里程 [0,999]*/
|
||||
MbIicApi UInt16 DateYear; /*年份 [2000,2255]*/
|
||||
MbIicApi UInt16 SysTimeOfDayInMin; /*当天的系统时间 [0,1439]分钟*/
|
||||
MbIicApi UInt16 TimeSinceIGON; /*行驶时间-上点后累计*/
|
||||
MbIicApi UInt16 TimeASinceCharging; /*行驶时间-充电后累计*/
|
||||
MbIicApi UInt16 TimeAVD; /*行驶时间A*/
|
||||
MbIicApi UInt16 TimeBVD; /*行驶时间B*/
|
||||
MbIicApi UInt16 ChargingTimeNeed; /*行驶时间B*/
|
||||
MbIicApi Int16 Temperature; /*车外温度*/
|
||||
MbIicApi Int16 TrafficLaneParam1; /*道路线参数 1 (1阶参数)*/
|
||||
MbIicApi Int16 TrafficLaneParam2; /*道路线参数 2 (2阶参数)*/
|
||||
MbIicApi Int16 TrafficLaneParam3; /*道路线参数 3 (3阶参数)*/
|
||||
MbIicApi Int16 Power; /*功率*/
|
||||
|
||||
MbIicApi UInt32 Odo; /*总里程 [0,999999]km*/
|
||||
MbIicApi UInt32 TripSinceIGON; /*行驶里程-上点后累计*/
|
||||
MbIicApi UInt32 TripASinceCharging; /*行驶里程-充电后累计*/
|
||||
MbIicApi UInt32 TripAVD; /*行驶里程A*/
|
||||
MbIicApi UInt32 TripBVD; /*行驶里程B*/
|
||||
|
||||
#define ENERGY_COST_CNT 100
|
||||
MbIicApi UInt08 EnergyCostP100m[ENERGY_COST_CNT]; /*最近100m能耗*/
|
||||
MbIicApi Un08 Indicator[8]; /*指示灯状态*/
|
||||
#define IND_BACK_TRUNK_ERR Indicator[0].sbit.b0 /*尾门故障指示灯*/
|
||||
#define IND_BATTERY_LACK Indicator[0].sbit.b1 /*电池电量低指示灯*/
|
||||
#define IND_AIR_BAG Indicator[0].sbit.b2 /*辅助保护系统(安全气囊)指示灯*/
|
||||
#define IND_BRAKE_ERR Indicator[0].sbit.b3 /*制动系统故障指示灯*/
|
||||
#define IND_ABS Indicator[0].sbit.b4 /*防抱死制动系统(ABS)指示灯*/
|
||||
#define IND_SCRUBBING_LACK Indicator[0].sbit.b5 /*洗涤液位低指示灯*/
|
||||
#define IND_LIMIT_SCALE Indicator[0].sbit.b6 /*限速图标放大标记*/
|
||||
#define IND_TOPCAMERA_CFG Indicator[0].sbit.b7 /*车顶摄像头配置*/
|
||||
|
||||
#define IND_ESP Indicator[1].sbit.b0 /*ESP指示灯*/
|
||||
#define IND_ESP_OFF Indicator[1].sbit.b1 /*ESP OFF指示灯*/
|
||||
#define IND_AVH Indicator[1].sbit02.b23 /*AVH指示灯*/
|
||||
#define IND_HDC Indicator[1].sbit02.b45 /*HDC指示灯*/
|
||||
#define IND_TPMS Indicator[1].sbit.b6 /*胎压监测系统(TPMS)指示灯*/
|
||||
#define IND_EPB_ERR Indicator[1].sbit.b7 /*电子刹车(EPB)故障指示灯*/
|
||||
|
||||
#define IND_EPB Indicator[2].sbit.b0 /*电子刹车(EPB)状态指示灯*/
|
||||
#define IND_EPS Indicator[2].sbit.b1 /*电动阻力转向(EPS)指示灯*/
|
||||
#define IND_12V_BAT Indicator[2].sbit.b2 /*12V蓄电池充电系统指示灯*/
|
||||
#define IND_MOTOR_ERR Indicator[2].sbit.b3 /*电动系统故障指示灯*/
|
||||
#define IND_MOTOR_OVERHEAT Indicator[2].sbit.b4 /*电机及控制器过热指示灯*/
|
||||
#define IND_BATTERY_OVERHEAT Indicator[2].sbit.b5 /*动力电池过热指示灯*/
|
||||
#define IND_BATTERY_ERR Indicator[2].sbit.b6 /*动力电池故障指示灯*/
|
||||
#define IND_BATTERY_OFF Indicator[2].sbit.b7 /*动力电池切断指示灯*/
|
||||
|
||||
#define IND_INTELLIGENTSYS_ERR Indicator[3].sbit.b0 /*智能系统故障指示灯*/
|
||||
#define IND_BRAKING Indicator[3].sbit.b1 /*刹车灯*/
|
||||
#define IND_SEATBELT_BL Indicator[3].sbit02.b23 /*左后安全带指示灯*/
|
||||
#define IND_SEATBELT_BM Indicator[3].sbit02.b45 /*中后安全带指示灯*/
|
||||
#define IND_SEATBELT_BR Indicator[3].sbit02.b67 /*右后安全带指示灯*/
|
||||
|
||||
#define IND_WHEEL_STATE Indicator[4].sbit03.b02 /*前轮转向状态*/
|
||||
#define IND_NIGHT_MODE Indicator[4].sbit.b3 /*夜间模式*/
|
||||
#define IND_POWER_LIMIT Indicator[4].sbit.b4 /*驱动功率限制*/
|
||||
#define IND_ACC_HOLD Indicator[4].sbit.b5 /*Acc Hold*/
|
||||
#define IND_POWER_MODE Indicator[4].sbit03.b67 /*经济模式指示灯*/
|
||||
|
||||
#define IND_DOOR_LF Indicator[5].sbit.b0 /*左前门指示灯*/
|
||||
#define IND_DOOR_LB Indicator[5].sbit.b1 /*左后门指示灯*/
|
||||
#define IND_DOOR_RF Indicator[5].sbit.b2 /*右前门指示灯*/
|
||||
#define IND_DOOR_RB Indicator[5].sbit.b3 /*右后门指示灯*/
|
||||
#define IND_ENGINE_TOP Indicator[5].sbit.b4 /*前舱盖指示灯*/
|
||||
#define IND_BACK_TRUNK Indicator[5].sbit.b5 /*后备箱指示灯*/
|
||||
#define IND_MAIN_ALARM Indicator[5].sbit.b6 /*主告警指示灯*/
|
||||
#define IND_SEATBELT_D Indicator[5].sbit.b7 /*驾驶员座椅安全带指示灯*/
|
||||
|
||||
#define IND_SEATBELT_P Indicator[6].sbit.b0 /*副驾驶座椅安全带指示灯*/
|
||||
#define IND_REAR_FOG Indicator[6].sbit.b1 /*后雾灯指示灯*/
|
||||
#define IND_POSITION_HINT Indicator[6].sbit.b2 /*位置灯指示灯*/
|
||||
#define IND_HIGH_BEAM Indicator[6].sbit.b3 /*远光灯指示灯*/
|
||||
#define IND_LOW_BEAM Indicator[6].sbit02.b45 /*近光灯指示灯*/
|
||||
#define IND_TURN_LEFT Indicator[6].sbit.b6 /*左转向灯指示灯*/
|
||||
#define IND_TURN_RIGHT Indicator[6].sbit.b7 /*右转向灯指示灯*/
|
||||
|
||||
#define IND_AUTO_PILOT Indicator[7].sbit02.b01 /*自动驾驶指示灯*/
|
||||
#define IND_READY Indicator[7].sbit.b2 /*READY指示灯*/
|
||||
#define IND_AC_HIGH_COST Indicator[7].sbit.b3 /*空调能耗高*/
|
||||
#define IND_BAT_COLD Indicator[7].sbit.b4 /*电池温度低*/
|
||||
#define IND_OTA_SILENT_MODE Indicator[7].sbit.b5 /*OTA静默模式*/
|
||||
#define IND_CHARGE_CONN Indicator[7].sbit.b6 /*充电枪已连接指示灯*/
|
||||
#define IND_TIRED_DRIVING Indicator[7].sbit.b7 /*分神提醒二级边框闪烁标志*/
|
||||
|
||||
/*档位*/
|
||||
enum
|
||||
{
|
||||
|
||||
GEAR_INVISIBLE = 0,
|
||||
GEAR_D = 1,
|
||||
GEAR_N = 2,
|
||||
GEAR_R = 3,
|
||||
GEAR_P = 4,
|
||||
GEAR_RESERVE = 5,
|
||||
};
|
||||
|
||||
/*模块ID*/
|
||||
enum
|
||||
{
|
||||
MODULE_L_NULL = 0,
|
||||
MODULE_L_LIST = 1,
|
||||
MODULE_L_CLOCK = 2,
|
||||
MODULE_L_WEATHER = 3,
|
||||
MODULE_L_TRIP = 4,
|
||||
MODULE_L_ENG_COST = 5,
|
||||
MODULE_L_NAVIGATION = 6,
|
||||
MODULE_L_VEHICLE_STATUS = 7,
|
||||
MODULE_L_MEDIA = 8,
|
||||
MODULE_L_RESERVE = 9,
|
||||
|
||||
MODULE_R_NULL = 0,
|
||||
MODULE_R_LIST = 1,
|
||||
MODULE_R_CLOCK = 2,
|
||||
MODULE_R_WEATHER = 3,
|
||||
MODULE_R_PHONE = 4,
|
||||
MODULE_R_TRIP = 5,
|
||||
MODULE_R_ENG_COST = 6,
|
||||
MODULE_R_NAVIGATION = 7,
|
||||
MODULE_R_VEHICLE_STATUS = 8,
|
||||
MODULE_R_MEDIA = 9,
|
||||
MODULE_R_RESERVE = 10,
|
||||
MODULE_R_CHARGING_INFO = 0xf,
|
||||
};
|
||||
|
||||
/*菜单ID*/
|
||||
enum
|
||||
{
|
||||
MENU_NULL = 0,
|
||||
MENU_LIST,
|
||||
MENU_AC_TEMP,
|
||||
MENU_AC_WIND_PWR,
|
||||
MENU_BLIGHT,
|
||||
MENU_MEDIA_SRC,
|
||||
MENU_AC_WIND_MODE,
|
||||
MENU_VERSION,
|
||||
MENU_MAX_AVAILABLE = MENU_VERSION,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
RightSide_MODULE = 0,
|
||||
RightSide_PHONE_UNAVAILABLE,
|
||||
RightSide_PHONE_LIST,
|
||||
RightSide_PHONE_INCALL,
|
||||
RightSide_PHONE_SPEAKING,
|
||||
RightSide_VOICE_AI,
|
||||
RightSide_MENU,
|
||||
};
|
||||
|
||||
/*工作模式*/
|
||||
enum
|
||||
{
|
||||
|
||||
WORK_MODE_OFF = 1,
|
||||
WORK_MODE_ON = 2,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
IIC_COM_NORMAL = 0x0, /*normal*/
|
||||
IIC_COM_EXCEPTION = 0x71, /*special value*/
|
||||
};
|
||||
|
||||
/*充电状态*/
|
||||
enum
|
||||
{
|
||||
CHARGE_DISCONNECTED = 0,
|
||||
CHARGE_PREPARING = 1,
|
||||
CHARGE_ORDER = 2,
|
||||
CHARGE_CHARGING = 3,
|
||||
CHARGE_STOP = 4,
|
||||
CHARGE_FINISH = 5,
|
||||
CHARGE_FAST = 6,
|
||||
CHARGE_PULL_HINT = 7,
|
||||
CHARGE_OP_ERR = 8,
|
||||
CHARGE_DEV_ERR = 9,
|
||||
CHARGE_RESERVE = 10,
|
||||
CHARGE_BAT_HEATING = 11,
|
||||
//CHARGE_BAT_COLD = 10,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ID_HINT_NONE , /* [无提示信息] */
|
||||
ID_HINT_POWER_READY , /* 动力就绪 */
|
||||
ID_HINT_BRAKE_WEAK , /* 驻车力不足,请在平地停车 */
|
||||
ID_HINT_DOOR_LF_OPEN , /* 左前车门未关 */
|
||||
ID_HINT_DOOR_RF_OPEN , /* 右前车门未关 */
|
||||
ID_HINT_DOOR_LB_OPEN , /* 左后车门未关 */
|
||||
ID_HINT_DOOR_RB_OPEN , /* 右后车门未关 */
|
||||
ID_HINT_BUCKLE_UP_D , /* 请系好驾驶员安全带 */
|
||||
ID_HINT_BUCKLE_UP_P , /* 请乘客系好安全带 */
|
||||
ID_HINT_START_UP , /* 启动车辆,请踩刹车 */
|
||||
ID_HINT_SHUTDOWN , /* 关闭车辆,请挂P档 */
|
||||
ID_HINT_CHARGING_GEAR_0 , /* 充电中,无法切换档位 */
|
||||
ID_HINT_CHARGING_GEAR_1 , /* 请先READY,再切换档位 */
|
||||
ID_HINT_CHARGING_GEAR_2 , /* 请先踩刹车,再切换档位 */
|
||||
ID_HINT_CHARGING_GEAR_3 , /* 请先减速,再切换档位 */
|
||||
ID_HINT_KEY_NOT_FOUND , /* 未检测到钥匙 */
|
||||
ID_HINT_KEY_INSIDE , /* 钥匙在车内 */
|
||||
ID_HINT_CHECK_SWITCH , /* 请检查启动开关 */
|
||||
ID_HINT_KEY_BAT_LACK , /* 请更换钥匙电池 */
|
||||
ID_HINT_AE , /* 车载系统认证失败 */
|
||||
ID_HINT_RELEASE_BRAKE , /* 请踩刹车释放电子驻车 */
|
||||
ID_HINT_AUTO_PARKING , /* 自动泊车进行中 */
|
||||
ID_HINT_AUTO_PARKING_PAUSE , /* 自动泊车暂停 */
|
||||
ID_HINT_AUTO_PARKING_CANCEL , /* 自动泊车取消 */
|
||||
ID_HINT_AUTO_PARKING_OK , /* 自动泊车完成 */
|
||||
ID_HINT_AUTO_LEAVING , /* 自动泊出中 */
|
||||
ID_HINT_AUTO_LEAVING_PAUSE , /* 自动泊出已暂停 */
|
||||
ID_HINT_AUTO_LEAVING_CANCEL , /* 自动泊出已取消 */
|
||||
ID_HINT_AUTO_LEAVING_OK , /* 自动泊出已完成 */
|
||||
ID_HINT_SUMMONING , /* 召唤中 */
|
||||
ID_HINT_SUMMONING_PAUSE , /* 召唤暂停 */
|
||||
ID_HINT_SUMMONING_OK , /* 召唤已结束 */
|
||||
ID_HINT_SEARCHING_PARKING_CELL , /* 正在识别车位,请降低车速 */
|
||||
ID_HINT_DETECTING_PARKING_CELL , /* 车位识别中 */
|
||||
ID_HINT_PARKING_GEAR_R , /* 请挂R档进行泊车 */
|
||||
ID_HINT_BRAKE_AID_ACTIVE , /*紧急指定辅助启用*/
|
||||
ID_HINT_LANE_AID_ACTIVE , /*车道辅助保持启用*/
|
||||
ID_HINT_LANE_DEVIATION , /*车道偏移请注意*/
|
||||
ID_HINT_LANE_AID_EXIT , /*车道辅助保持退出*/
|
||||
ID_HINT_HOLD_STEERING_WHEEL , /*请手握方向盘*/
|
||||
ID_HINT_ACC_EXIT , /*自适应续航已退出*/
|
||||
ID_HINT_ACC_ERROR , /*立即接管*/
|
||||
ID_HINT_LANE_AID_UNAVAILABLE , /*车道辅助保持不可用*/
|
||||
ID_HINT_ACC_RESET , /*恢复巡航,请踩下加速踏板*/
|
||||
ID_HINT_HDC_CANNOT_ACC , /*安全带解开,巡航速度降低*/
|
||||
ID_HINT_ACC_UNAVAILABLE , /*自适应巡航不可用*/
|
||||
ID_HINT_ACC_TIMEOUT , /*由于长时间未接管车辆,本次驾驶周期不可用*/
|
||||
ID_HINT_TAKE_REST , /*开车累了,请注意休息*/
|
||||
ID_HINT_TAKE_REST_1 , /*你已疲劳驾驶,请注意休息*/
|
||||
ID_HINT_SWITCH_GEARS_TOO_FAST , /*挡位切换过快*/
|
||||
ID_HINT_CRUISE_ABORT , /*巡航异常退出*/
|
||||
ID_HINT_AUTOHOLD_READY , /*AutoHold 功能已启用*/
|
||||
ID_HINT_FACE_WELCOME , /*欢迎回来*/
|
||||
ID_HINT_CLOSE_DOOR , /*请关上车门,系好安全带*/
|
||||
ID_HINT_PARKING_RELEASE , /*驻车接触,请踩刹车*/
|
||||
ID_HINT_FIRST_CLOSE_DOOR , /*请关上车门,系好安全带,在释放驻车*/
|
||||
ID_HINT_SWITCH_NOT_P , /*请切换到P档再释放驻车*/
|
||||
ID_HINT_DONOT_CHANGE_TRACK , /*当前不适合变道*/
|
||||
ID_HINT_TRACK_CANCEL , /*变道取消*/
|
||||
ID_HINT_TAKE_OVER_STEERING_0 , /*请立即接管方向盘*/
|
||||
ID_HINT_CANNOT_AVTIVE_ACC , /*车速不满足ACC激活条件*/
|
||||
ID_HINT_FORWARD_COLLISION_WARNING, /* 前向碰撞预警 */
|
||||
ID_HINT_HOLD_STEERING_WHEEL_1 , /* 请手握方向盘 */
|
||||
ID_HINT_TAKE_OVER_STEERING_1 , /* 请立即接管方向盘 */
|
||||
ID_HINT_WATCH_OUT , /* 请专心开车 */
|
||||
ID_HINT_WATCH_OUT_1 , /* 请保持关注路面 */
|
||||
ID_HINT_WATCH_OUT_2 , /* 请立即关注路面,否则居中辅助将会退出 */
|
||||
ID_HINT_SWITCHED_TO_N , /* 车辆行驶中,已切换为N档,请注意安全 */
|
||||
ID_HINT_TAKE_CARE_DOOR_OPEN ,/* 开门请注意 */
|
||||
ID_HINT_MANUAL_LANE_CHANGE ,/* 请手动变道 */
|
||||
ID_HINT_AUTOMATIC_LANE_CHANGE_UNAVAILABLE ,/* 自动变道辅助不可用 */
|
||||
ID_HINT_KEEP_SAFE_DISTANCE ,/* 请保持安全车距 */
|
||||
ID_HINT_TAKE_OVER_SPEED_CONTROL ,/* 您已接管车速控制 */
|
||||
ID_HINT_FORWARD_COLLISION_SYSTEM_CLOSE ,/* 前向碰撞预防系统关闭 */
|
||||
ID_HINT_OPEN_ESP ,/* 请开启电子稳定系统ESP */
|
||||
ID_HINT_ACC_WAITING_NOW ,/* 车道居中辅助在当前道路等待开放 */
|
||||
ID_HINT_TIRED_STATE_ACC_UNAVAILABLE ,/* 驾驶员疲劳状态,车道居中辅助不可用 */
|
||||
ID_HINT_DISTRACTED_STATE_ACC_UNAVAILABLE ,/* 驾驶员分神状态,车道居中辅助不可用 */
|
||||
ID_HINT_FRONT_RADAR_LOW_VISIBILITY ,/* 前雷达能见度降低 */
|
||||
ID_HINT_REAR_RADER_LOW_VISIBILITY ,/* 后雷达能见度降低 */
|
||||
ID_HINT_FRONT_CAMERA_BLOCKED ,/* 前摄像头被遮挡 */
|
||||
ID_HINT_DRIVING_ASSIST_LIMITED ,/* 驾驶辅助功能受限 */
|
||||
ID_HINT_SLOW_DRIVE_THROUGH_CARS ,/* 减速通过旁车 */
|
||||
ID_HINT_RESERVE,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ID_ALARM_NONE = 0, /* [无报警信息] */
|
||||
ID_ALARM_BAT_OVER_HEAT , /* 电池过温,远离车辆,请联系维修 (icon) (不可确认) */
|
||||
ID_ALARM_DYNAMIC_BRAKING , /* 动态制动中 (不可确认) (icon) */
|
||||
ID_ALARM_PERFORMANCE_LIMIT , /* 车辆性能受限,请谨慎驾驶 (不可确认) */
|
||||
ID_ALARM_CONTACT_SERVICE , /* 车辆跛行,请联系维修 (不可确认) (icon) */
|
||||
ID_ALARM_LOST_POWER , /* 车辆失去动力,安全停车,请联系维修 (不可确认) (icon) */
|
||||
ID_ALARM_CANNOT_CHARGE , /* 同时插枪,无法充电 (不可确认) [充电提示] */
|
||||
ID_ALARM_PULL_UP , /* 请拔充电枪后,启动车辆 (不可确认) [充电提示] */
|
||||
ID_ALARM_OPERATE_ERR , /* 充电操作错误,请检查操作 (不可确认) [充电提示] */
|
||||
ID_ALARM_DEVICE_ERR , /* 充电故障,联系维修 (不可确认) [充电提示] */
|
||||
ID_ALARM_GEAR_ERR , /* 档位故障,联系维修 (不可确认) [充电提示] */
|
||||
ID_ALARM_CHECK_AIRBAG , /* 请检查安全气囊 (不可确认) (icon) */
|
||||
ID_ALARM_CHECK_TURNL , /* 请检查左侧转向灯 (可确认) */
|
||||
ID_ALARM_CHECK_TURNR , /* 请检查右侧转向灯 (可确认) */
|
||||
ID_ALARM_CHECK_TURNLR , /* 请检查左右侧转向灯 (可确认) */
|
||||
ID_ALARM_CHECK_LOWBEAM , /* 请检查近光灯 (可确认) */
|
||||
ID_ALARM_PEPS_ERR , /* PEPS系统故障 (不可确认) */
|
||||
ID_ALARM_REPLENISH_RAKE_OIL , /* 请补充制动液 (不可确认) (icon) */
|
||||
ID_ALARM_VACUUM_PUMP , /* 电动真空泵故障 (不可确认) */
|
||||
ID_ALARM_VACUUM_BOOSTER , /* 真空助力短暂不足,请小心驾驶 (不可确认) */
|
||||
ID_ALARM_TIRE_PRESSURE_LOW , /* 轮胎压力过低 (不可确认) */
|
||||
ID_ALARM_TIRE_PRESSURE_HIGH , /* 轮胎压力过高 (不可确认) */
|
||||
ID_ALARM_TIRE_OVER_HEAT , /* 轮胎温度过高 (不可确认) */
|
||||
ID_ALARM_CHECK_EPS , /* 请检查EPS (不可确认) (icon) */
|
||||
ID_ALARM_CHECK_HIGHBEAM , /* 请检查远光灯 */
|
||||
ID_ALARM_HIGH_VOLTAGE_ERR , /* 因故障无法断开高压 */
|
||||
ID_ALARM_INITIATIVE_GRID_ERR , /* 主动栅格故障 */
|
||||
ID_ALARM_LOW_VOLT_BAT_ERR , /* 低压蓄电池故障 */
|
||||
ID_ALARM_LOW_VOLT_BAT_LACK , /* 低压蓄电池电压过低 */
|
||||
ID_ALARM_CHARGE_PORT_OVERHEAT , /* 充电口温度过高,导致充电停止 */
|
||||
ID_ALARM_BAT_LACK , /* 续航里程低,请及时充电 (可确认) (icon) */
|
||||
ID_ALARM_CHECK_FOGLAMP , /* 请检查后雾灯 (可确认) */
|
||||
ID_ALARM_TPMS , /* 胎压监测系统故障 (可确认) (icon) */
|
||||
ID_ALARM_CHECK_TP_SENSOR , /* 请检查胎压传感器 (可确认) (icon) */
|
||||
ID_ALARM_TPMS_CALIBRATION , /* TPMS系统校准中 (可确认) */
|
||||
ID_ALARM_BAT_COLD , /* 电池温度低,可能影响充电速度 (可确认) */
|
||||
ID_ALARM_BAT_HEATING , /* 电池加热中 (可确认) */
|
||||
ID_ALARM_CHARGING_SLOW , /* 充电速度慢 (可确认) */
|
||||
ID_ALARM_SYSTOM_FAULT , /* 系统启动故障 (可重试) */
|
||||
ID_ALARM_FACE_REPEAT , /* 人脸重复 (可换绑) */
|
||||
ID_ALARM_INPUT_TIMEOUT , /* 录入超时 (可重试) */
|
||||
ID_ALARM_INTERRUPT_RETRY , /* 中断重试 (可重试) */
|
||||
ID_ALARM_FACE_NOT_FOUND , /* 未检测到人脸 (可重试) */
|
||||
ID_ALARM_WILL_LOST_POWER , /* 车辆即将失去动力,紧急靠边停车(不可确认)*/
|
||||
ID_ALARM_BAT_TOO_COLD , /* 车辆过冷,车辆启动失败(不可确认)*/
|
||||
ID_ALARM_FONT_COLLISION_FAILURE , /* 前向碰撞预防系统故障 */
|
||||
ID_ALARM_LANE_WARNING_FAILURE , /* 车道偏离预警功能故障 */
|
||||
ID_ALARM_BLIND_AUXILIARY_FAILURE , /* 盲区安全辅助系统故障 */
|
||||
ID_ALARM_REAR_WARNING_FAILURE , /* 后方横向来车预警功能故障 */
|
||||
ID_ALARM_REAR_AUXILIARY_FAILURE , /* 车道居中辅助功能故障 */
|
||||
ID_ALARM_ACC_FAILURE , /* 自适应巡航功能故障 */
|
||||
ID_ALARM_LIMIT_SPEED_FAILURE , /* 智能限速辅助功能故障 */
|
||||
ID_ALARM_AUTO_TRACK_FAILURE , /* 自动变道辅助功能故障 */
|
||||
ID_ALARM_CUT_OFF_ALARM , /* 碰撞后已切断动力,请联系维修 */
|
||||
ID_ALARM_RESERVE,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
FACE_RCN_NULL = 0, /*空*/
|
||||
FACE_RCN_IDENTIFICATION_1 , /*开始认证——1(开始采集)*/
|
||||
FACE_RCN_FRONT , /*方向前*/
|
||||
FACE_RCN_LEFT , /*方向左*/
|
||||
FACE_RCN_RIGHT , /*方向右*/
|
||||
FACE_RCN_UP , /*方向上*/
|
||||
FACE_RCN_DOWN , /*方向下*/
|
||||
FACE_RCN_COVER , /*遮挡提示*/
|
||||
FACE_RCN_SUCCESS_1 , /*认证成功——1(认证成功)*/
|
||||
FACE_RCN_ERROR, /*出错*/
|
||||
FACE_RCN_IDENTIFICATION_2 , /*开始认证——2(开始人脸识别)*/
|
||||
FACE_RCN_SUCCESS_2 , /*认证成功——2(人脸识别成功)*/
|
||||
FACE_END, /*结束*/
|
||||
};
|
||||
226
insDavi2.0/include/Protocol/MainBoard_IIC_Sys.h
Normal file
226
insDavi2.0/include/Protocol/MainBoard_IIC_Sys.h
Normal file
@@ -0,0 +1,226 @@
|
||||
#ifndef MAINBOARD_IIC_SYS_H_INCLUDED
|
||||
#define MAINBOARD_IIC_SYS_H_INCLUDED
|
||||
|
||||
#include <Protocol/MainBoard_IIC.h>
|
||||
|
||||
/* 数据接口宏定义, 对I2C协议进行解析*/
|
||||
MbIicApi Un08 srcDataBuf[ID_FRAME_R_NUM][I2C_FRAMELEN-1];
|
||||
MbIicApi Un08 dstDataBuf[ID_FRAME_W_NUM][I2C_FRAMELEN-1];
|
||||
|
||||
#define DATA_SPEED srcDataBuf[ID_FRAME_R_0x00][0].value /*车速*/
|
||||
#define DATA_BATTERY srcDataBuf[ID_FRAME_R_0x00][1].sbit07.b06 /*电量*/
|
||||
#define DATA_IND_MUTE srcDataBuf[ID_FRAME_R_0x00][1].sbit07.b7 /*静音*/
|
||||
#define DATA_SPEED_WARN srcDataBuf[ID_FRAME_R_0x00][2].value /*报警车速*/
|
||||
#define DATA_POWER srcDataBuf[ID_FRAME_R_0x00][3].value /*功率*/
|
||||
#define DATA_GEAR srcDataBuf[ID_FRAME_R_0x00][4].sbit03.b02 /*档位*/
|
||||
#define DATA_FONT_COLLOSION srcDataBuf[ID_FRAME_R_0x00][4].sbit.b3 /*前向碰撞预防系统故障灯*/
|
||||
#define DATA_LANE_WARNING srcDataBuf[ID_FRAME_R_0x00][4].sbit.b4 /*车道偏离预警功能故障灯*/
|
||||
#define DATA_BLIND_AUXILIARY srcDataBuf[ID_FRAME_R_0x00][4].sbit.b5 /*盲区安全辅助系统故障灯*/
|
||||
#define DATA_REAR_AUXILIARY srcDataBuf[ID_FRAME_R_0x00][4].sbit.b6 /*车道居中辅助功能故障灯*/
|
||||
#define DATA_ACC_FAILURE srcDataBuf[ID_FRAME_R_0x00][4].sbit.b7 /*自适应巡航功能故障灯*/
|
||||
#define DATA_TRIP_RANGE (srcDataBuf[ID_FRAME_R_0x00][5].value\
|
||||
+(srcDataBuf[ID_FRAME_R_0x00][6].sbit02.b01<<8)) /*续航里程*/
|
||||
#define DATA_WORK_MODE srcDataBuf[ID_FRAME_R_0x00][6].sbit02.b23 /*工作模式*/
|
||||
#define DATA_CHARGING_STATE srcDataBuf[ID_FRAME_R_0x00][6].sbit04.b47 /*充电状态*/
|
||||
#define DATA_SPEED_LIMIT srcDataBuf[ID_FRAME_R_0x00][7].value /*限速*/
|
||||
|
||||
#define DATA_DATE_DAY srcDataBuf[ID_FRAME_R_0x02][0].sbit05.b04 /*日份*/
|
||||
#define DATA_TIME ((srcDataBuf[ID_FRAME_R_0x02][0].sbit05.b57<<8)\
|
||||
+srcDataBuf[ID_FRAME_R_0x02][1].value) /*时间*/
|
||||
#define DATA_DATE_MONTH srcDataBuf[ID_FRAME_R_0x02][2].sbit04.b03 /*月份*/
|
||||
#define DATA_TIME_FORMAT srcDataBuf[ID_FRAME_R_0x02][2].sbit.b4 /*时制*/
|
||||
#define DATA_ACC srcDataBuf[ID_FRAME_R_0x02][2].sbit14.b57 /*ACC指示灯*/
|
||||
#define DATA_DATE_YEAR srcDataBuf[ID_FRAME_R_0x02][3].value /*年份*/
|
||||
#define DATA_TEMPRATURE srcDataBuf[ID_FRAME_R_0x02][4].value /*车外温度*/
|
||||
#define DATA_HINT_ID srcDataBuf[ID_FRAME_R_0x02][5].value /*提示信息ID*/
|
||||
#define DATA_ALARM_OPTION srcDataBuf[ID_FRAME_R_0x02][6].sbit26.b01 /*报警信息确认选项*/
|
||||
#define DATA_ALARM_ID srcDataBuf[ID_FRAME_R_0x02][6].sbit26.b27 /*报警信息ID*/
|
||||
#define DATA_SPEED_XCC srcDataBuf[ID_FRAME_R_0x02][7].value /*(自适应/定速)巡航车速*/
|
||||
|
||||
#define DATA_ODO (srcDataBuf[ID_FRAME_R_0x03][0].value\
|
||||
+(srcDataBuf[ID_FRAME_R_0x03][1].value<<8)\
|
||||
+(srcDataBuf[ID_FRAME_R_0x03][2].sbit04.b03<<16)) /*总里程*/
|
||||
#define DATA_ENGCOST_FLAG srcDataBuf[ID_FRAME_R_0x03][2].sbit.b4 /*电耗数值复用标记*/
|
||||
#define DATA_DRV_VALUE_FLAG srcDataBuf[ID_FRAME_R_0x03][2].sbit12.b56 /*行驶数值复用标记*/
|
||||
#define DATA_TRIP_DISTANCE ((srcDataBuf[ID_FRAME_R_0x03][2].sbit.b7<<16)\
|
||||
+(srcDataBuf[ID_FRAME_R_0x03][3].value<<8)\
|
||||
+srcDataBuf[ID_FRAME_R_0x03][4].value) /*行驶里程*/
|
||||
#define DATA_TRIP_TIME ((srcDataBuf[ID_FRAME_R_0x03][6].sbit05.b04<<8)\
|
||||
+srcDataBuf[ID_FRAME_R_0x03][5].value) /*行驶时间*/
|
||||
#define DATA_SCREENCOLORTEST srcDataBuf[ID_FRAME_R_0x03][6].sbit14.b57 /*平均能耗*/
|
||||
#define DATA_AVG_ENGCOST srcDataBuf[ID_FRAME_R_0x03][7].value /*平均能耗*/
|
||||
|
||||
#define DATA_MODULE_L_ID srcDataBuf[ID_FRAME_R_0x04][0].sbit04.b03 /*左模块ID*/
|
||||
#define DATA_LIST_CURSOR_L srcDataBuf[ID_FRAME_R_0x04][1].value /*左列表光标值*/
|
||||
#define DATA_MODULE_R_ID srcDataBuf[ID_FRAME_R_0x04][4].sbit04.b03 /*右模块ID*/
|
||||
#define DATA_LIST_CURSOR_R srcDataBuf[ID_FRAME_R_0x04][5].value /*右列表光标值*/
|
||||
|
||||
#define DATA_RADAR_SPACING_F0 srcDataBuf[ID_FRAME_R_0x0C][0].value /*雷达探测间距 前0*/
|
||||
#define DATA_RADAR_SPACING_F1 srcDataBuf[ID_FRAME_R_0x05][0].value /*雷达探测间距 前1*/
|
||||
#define DATA_RADAR_SPACING_F2 srcDataBuf[ID_FRAME_R_0x05][1].value /*雷达探测间距 前2*/
|
||||
#define DATA_RADAR_SPACING_F3 srcDataBuf[ID_FRAME_R_0x05][2].value /*雷达探测间距 前3*/
|
||||
#define DATA_RADAR_SPACING_F4 srcDataBuf[ID_FRAME_R_0x05][3].value /*雷达探测间距 前4*/
|
||||
#define DATA_RADAR_SPACING_F5 srcDataBuf[ID_FRAME_R_0x0C][1].value /*雷达探测间距 前5*/
|
||||
|
||||
#define DATA_RADAR_SPACING_B0 srcDataBuf[ID_FRAME_R_0x0C][2].value /*雷达探测间距 后0*/
|
||||
#define DATA_RADAR_SPACING_B1 srcDataBuf[ID_FRAME_R_0x05][4].value /*雷达探测间距 后1*/
|
||||
#define DATA_RADAR_SPACING_B2 srcDataBuf[ID_FRAME_R_0x05][5].value /*雷达探测间距 后2*/
|
||||
#define DATA_RADAR_SPACING_B3 srcDataBuf[ID_FRAME_R_0x05][6].value /*雷达探测间距 后3*/
|
||||
#define DATA_RADAR_SPACING_B4 srcDataBuf[ID_FRAME_R_0x05][7].value /*雷达探测间距 后4*/
|
||||
#define DATA_RADAR_SPACING_B5 srcDataBuf[ID_FRAME_R_0x0C][3].value /*雷达探测间距 后5*/
|
||||
|
||||
#define DATA_RADAR_COLOR_F0 srcDataBuf[ID_FRAME_R_0x0B][2].sbit03.b02 /*雷达颜色 前0*/
|
||||
#define DATA_RADAR_COLOR_F5 srcDataBuf[ID_FRAME_R_0x0B][2].sbit03.b35 /*雷达颜色 前5*/
|
||||
#define DATA_RADAR_STATE srcDataBuf[ID_FRAME_R_0x0C][4].sbit02.b01 /*雷达功能状态*/
|
||||
#define DATA_RADAR_COLOR_B0 srcDataBuf[ID_FRAME_R_0x0C][4].sbit23.b24 /*雷达颜色 后0*/
|
||||
#define DATA_RADAR_COLOR_B5 srcDataBuf[ID_FRAME_R_0x0C][4].sbit23.b57 /*雷达颜色 后5*/
|
||||
#define DATA_RADAR_COLOR_F1 srcDataBuf[ID_FRAME_R_0x0C][5].sbit03.b02 /*雷达颜色 前1*/
|
||||
#define DATA_RADAR_COLOR_F2 srcDataBuf[ID_FRAME_R_0x0C][5].sbit03.b35 /*雷达颜色 前2*/
|
||||
|
||||
#define DATA_RADAR_COLOR_F3 ((srcDataBuf[ID_FRAME_R_0x0C][5].sbit02.b67<<1)\
|
||||
+srcDataBuf[ID_FRAME_R_0x0C][6].sbit.b0) /*雷达颜色 前3*/
|
||||
#define DATA_RADAR_COLOR_F4 srcDataBuf[ID_FRAME_R_0x0C][6].sbit13.b13 /*雷达颜色 前4*/
|
||||
#define DATA_RADAR_COLOR_B1 srcDataBuf[ID_FRAME_R_0x0C][6].sbit13.b46 /*雷达颜色 后1*/
|
||||
#define DATA_RADAR_COLOR_B2 ((srcDataBuf[ID_FRAME_R_0x0C][6].sbit13.b7<<2)\
|
||||
+srcDataBuf[ID_FRAME_R_0x0C][7].sbit02.b01) /*雷达颜色 后2*/
|
||||
#define DATA_RADAR_COLOR_B3 srcDataBuf[ID_FRAME_R_0x0C][7].sbit23.b24 /*雷达颜色 后3*/
|
||||
#define DATA_RADAR_COLOR_B4 srcDataBuf[ID_FRAME_R_0x0C][7].sbit23.b57 /*雷达颜色 后4*/
|
||||
|
||||
#define DATA_TIRE_PRESSURE_LF srcDataBuf[ID_FRAME_R_0x06][0].sbit06.b05 /*左前轮胎压力值*/
|
||||
#define DATA_TIRE_PRESSURE_RF srcDataBuf[ID_FRAME_R_0x06][1].sbit06.b05 /*右前轮胎压力值*/
|
||||
#define DATA_TIRE_PRESSURE_LB srcDataBuf[ID_FRAME_R_0x06][2].sbit06.b05 /*左后轮胎压力值*/
|
||||
#define DATA_TIRE_PRESSURE_RB srcDataBuf[ID_FRAME_R_0x06][3].sbit06.b05 /*右后轮胎压力值*/
|
||||
#define DATA_TIRE_TEMPERATURE_LF srcDataBuf[ID_FRAME_R_0x06][4].value /*左前轮胎温度值*/
|
||||
#define DATA_TIRE_TEMPERATURE_RF srcDataBuf[ID_FRAME_R_0x06][5].value /*右前轮胎温度值*/
|
||||
#define DATA_TIRE_TEMPERATURE_LB srcDataBuf[ID_FRAME_R_0x06][6].value /*左后轮胎温度值*/
|
||||
#define DATA_TIRE_TEMPERATURE_RB srcDataBuf[ID_FRAME_R_0x06][7].value /*右后轮胎温度值*/
|
||||
#define DATA_TIRE_TEMP_FLG_LF srcDataBuf[ID_FRAME_R_0x06][0].sbit.b6 /*左前轮胎状态*/
|
||||
#define DATA_TIRE_TEMP_FLG_RF srcDataBuf[ID_FRAME_R_0x06][1].sbit.b6 /*右前轮胎状态*/
|
||||
#define DATA_TIRE_TEMP_FLG_LB srcDataBuf[ID_FRAME_R_0x06][2].sbit.b6 /*左后轮胎状态*/
|
||||
#define DATA_TIRE_TEMP_FLG_RB srcDataBuf[ID_FRAME_R_0x06][3].sbit.b6 /*右后轮胎状态*/
|
||||
#define DATA_TIRE_STATUS_LF srcDataBuf[ID_FRAME_R_0x06][0].sbit.b7 /*左前轮胎状态*/
|
||||
#define DATA_TIRE_STATUS_RF srcDataBuf[ID_FRAME_R_0x06][1].sbit.b7 /*右前轮胎状态*/
|
||||
#define DATA_TIRE_STATUS_LB srcDataBuf[ID_FRAME_R_0x06][2].sbit.b7 /*左后轮胎状态*/
|
||||
#define DATA_TIRE_STATUS_RB srcDataBuf[ID_FRAME_R_0x06][3].sbit.b7 /*右后轮胎状态*/
|
||||
|
||||
#define DATA_MENU_ID srcDataBuf[ID_FRAME_R_0x07][0].sbit04.b03 /*菜单ID*/
|
||||
#define DATA_MENU_ID_LAST srcDataBuf[ID_FRAME_R_0x07][0].sbit04.b47 /*上次(访问的)菜单ID*/
|
||||
#define DATA_MENU_LIST_CURSOR srcDataBuf[ID_FRAME_R_0x07][0].sbit04.b47 /*列表菜单光标值*/
|
||||
#define DATA_MENU_LIST_FLG_TEMP srcDataBuf[ID_FRAME_R_0x07][1].sbit.b0 /*可用菜单项标记 空调温度*/
|
||||
#define DATA_MENU_LIST_FLG_WINDPWR srcDataBuf[ID_FRAME_R_0x07][1].sbit.b1 /*可用菜单项标记 空调风力*/
|
||||
#define DATA_MENU_LIST_FLG_BLIGHT srcDataBuf[ID_FRAME_R_0x07][1].sbit.b2 /*可用菜单项标记 背光亮度*/
|
||||
#define DATA_MENU_LIST_FLG_MEDIASRC srcDataBuf[ID_FRAME_R_0x07][1].sbit.b3 /*可用菜单项标记 媒体源*/
|
||||
#define DATA_MENU_LIST_FLG_WINDMODE srcDataBuf[ID_FRAME_R_0x07][1].sbit.b4 /*可用菜单项标记 空调吹风模式*/
|
||||
#define DATA_MENU_TEMP_TEMPERATURE srcDataBuf[ID_FRAME_R_0x07][1].value /*空调温度*/
|
||||
#define DATA_MENU_WINDPWR_POWER srcDataBuf[ID_FRAME_R_0x07][1].value /*空调风力*/
|
||||
#define DATA_MENU_BLIGHT_BRIGHTNESS srcDataBuf[ID_FRAME_R_0x07][1].value /*空调风力*/
|
||||
#define DATA_MENU_MEDIASRC_CURSOR srcDataBuf[ID_FRAME_R_0x07][0].sbit04.b47 /*媒体源菜单光标值*/
|
||||
//#define DATA_MENU_MEDIASRC_FLG_LOCAL srcDataBuf[ID_FRAME_R_0x07][1].sbit.b0 /*可用媒体源标记 本地音乐*/
|
||||
//#define DATA_MENU_MEDIASRC_FLG_LRADIO srcDataBuf[ID_FRAME_R_0x07][1].sbit.b1 /*可用媒体源标记 本地电台*/
|
||||
//#define DATA_MENU_MEDIASRC_FLG_NRADIO srcDataBuf[ID_FRAME_R_0x07][1].sbit.b2 /*可用媒体源标记 网络电台*/
|
||||
#define DATA_MENU_MEDIASRC_FLG_BLTUTH srcDataBuf[ID_FRAME_R_0x07][1].sbit.b4 /*可用媒体源标记 蓝牙音乐*/
|
||||
//#define DATA_MENU_MEDIASRC_FLG_BKAUDIO srcDataBuf[ID_FRAME_R_0x07][1].sbit.b4 /*可用媒体源标记 有声读物*/
|
||||
#define DATA_MENU_MEDIASRC_SELECT srcDataBuf[ID_FRAME_R_0x07][1].sbit04.b03 /*媒体源菜单选中值*/
|
||||
#define DATA_MENU_WINDMODE_MODE srcDataBuf[ID_FRAME_R_0x07][0].sbit04.b47 /*空调吹风模式*/
|
||||
|
||||
#define DATA_TRIP_DISTANCE_CHARGE ((srcDataBuf[ID_FRAME_R_0x07][6].sbit.b0<<16)\
|
||||
+(srcDataBuf[ID_FRAME_R_0x07][5].value<<8)\
|
||||
+srcDataBuf[ID_FRAME_R_0x07][4].value) /*自上次充电后的行驶里程*/
|
||||
|
||||
#define DATA_CARPORT_AREA srcDataBuf[ID_FRAME_R_0x07][6].sbit02.b23 /*可停区域*/
|
||||
#define DATA_CARPORT_LEFT_SLOT1 srcDataBuf[ID_FRAME_R_0x07][6].sbit02.b45 /*可泊车位 左一*/
|
||||
#define DATA_CARPORT_LEFT_SLOT2 srcDataBuf[ID_FRAME_R_0x07][6].sbit02.b67 /*可泊车位 左二*/
|
||||
#define DATA_CARPORT_LEFT_SLOT3 srcDataBuf[ID_FRAME_R_0x07][7].sbit02.b01 /*可泊车位 左三*/
|
||||
#define DATA_CARPORT_RIGHT_SLOT1 srcDataBuf[ID_FRAME_R_0x07][7].sbit02.b23 /*可泊车位 右一*/
|
||||
#define DATA_CARPORT_RIGHT_SLOT2 srcDataBuf[ID_FRAME_R_0x07][7].sbit02.b45 /*可泊车位 右二*/
|
||||
#define DATA_CARPORT_RIGHT_SLOT3 srcDataBuf[ID_FRAME_R_0x07][7].sbit02.b67 /*可泊车位 右三*/
|
||||
|
||||
//#define DATA_TRAFFIC_LANE_PARAM_2 ((srcDataBuf[ID_FRAME_R_0x08][0].sbit05.b57<<6)\
|
||||
// +srcDataBuf[ID_FRAME_R_0x08][1].sbit06.b05) /*2阶参数 L2*/
|
||||
//#define DATA_TRAFFIC_LANE_PARAM_1 (srcDataBuf[ID_FRAME_R_0x08][2].sbit17.b17\
|
||||
// +(srcDataBuf[ID_FRAME_R_0x08][3].sbit02.b67<<7)) /*1阶参数 L1*/
|
||||
//#define DATA_TRAFFIC_LANE_PARAM_3 srcDataBuf[ID_FRAME_R_0x08][4].value /*3阶参数 L3*/
|
||||
//#define DATA_TRAFFIC_LANE_PARAM_0_L srcDataBuf[ID_FRAME_R_0x08][5].value /*左车道 常数参数 L0*/
|
||||
//#define DATA_TRAFFIC_LANE_PARAM_0_R srcDataBuf[ID_FRAME_R_0x08][6].value /*右车道 常数参数 L0*/
|
||||
//#define DATA_TRAFFIC_LANE_PARAM_0_RR srcDataBuf[ID_FRAME_R_0x08][7].value /*右右车道 常数参数 L0*/
|
||||
//#define DATA_TRAFFIC_LANE_STATUS_LL srcDataBuf[ID_FRAME_R_0x08][0].sbit23.b24 /*左左车道 状态*/
|
||||
//#define DATA_TRAFFIC_LANE_STATUS_L srcDataBuf[ID_FRAME_R_0x08][3].sbit03.b02 /*左车道 状态*/
|
||||
//#define DATA_TRAFFIC_LANE_STATUS_R srcDataBuf[ID_FRAME_R_0x08][3].sbit03.b35 /*右车道 状态*/
|
||||
//#define DATA_TRAFFIC_LANE_STATUS_RR (srcDataBuf[ID_FRAME_R_0x08][1].sbit02.b67\
|
||||
// +(srcDataBuf[ID_FRAME_R_0x08][2].sbit.b0<<2)) /*右右车道 状态*/
|
||||
#define DATA_TRAFFIC_LANE_STATUS_LL srcDataBuf[ID_FRAME_R_0x08][0].sbit04.b03 /*左左车道 状态*/
|
||||
#define DATA_TRAFFIC_LANE_STATUS_L srcDataBuf[ID_FRAME_R_0x08][0].sbit04.b47 /*左车道 状态*/
|
||||
#define DATA_TRAFFIC_LANE_STATUS_RR srcDataBuf[ID_FRAME_R_0x08][1].sbit04.b03 /*右右车道 状态*/
|
||||
#define DATA_TRAFFIC_LANE_STATUS_R srcDataBuf[ID_FRAME_R_0x08][1].sbit04.b47 /*右车道 状态*/
|
||||
#define DATA_TRAFFIC_LANE_PARAM_3 srcDataBuf[ID_FRAME_R_0x08][2].value /*3阶参数 L3*/
|
||||
#define DATA_TRAFFIC_LANE_PARAM_2 (srcDataBuf[ID_FRAME_R_0x08][3].value\
|
||||
+(srcDataBuf[ID_FRAME_R_0x08][4].sbit.b0<<8)) /*2阶参数 L2*/
|
||||
#define DATA_TRAFFIC_LANE_PARAM_1 ((srcDataBuf[ID_FRAME_R_0x08][4].sbit12.b12<<8)\
|
||||
+srcDataBuf[ID_FRAME_R_0x08][5].value) /*1阶参数 L1*/
|
||||
|
||||
#define DATA_FORWARD_VEHICLE_1_TYPE srcDataBuf[ID_FRAME_R_0x09][0].sbit02.b01 /*前方车辆_1 类型*/
|
||||
#define DATA_FORWARD_VEHICLE_1_COLOR srcDataBuf[ID_FRAME_R_0x09][0].sbit23.b24 /*前方车辆_1 颜色*/
|
||||
#define DATA_FORWARD_VEHICLE_2_COLOR srcDataBuf[ID_FRAME_R_0x09][0].sbit23.b57 /*前方车辆_2 颜色*/
|
||||
#define DATA_FORWARD_VEHICLE_2_TYPE srcDataBuf[ID_FRAME_R_0x09][1].sbit02.b01 /*前方车辆_2 类型*/
|
||||
#define DATA_FORWARD_VEHICLE_3_COLOR srcDataBuf[ID_FRAME_R_0x09][1].sbit23.b24 /*前方车辆_3 颜色*/
|
||||
#define DATA_FORWARD_VEHICLE_4_COLOR srcDataBuf[ID_FRAME_R_0x09][1].sbit23.b57 /*前方车辆_4 颜色*/
|
||||
#define DATA_FORWARD_VEHICLE_3_TYPE srcDataBuf[ID_FRAME_R_0x09][2].sbit02.b01 /*前方车辆_3 类型*/
|
||||
#define DATA_FORWARD_VEHICLE_5_COLOR srcDataBuf[ID_FRAME_R_0x09][2].sbit23.b24 /*前方车辆_5 颜色*/
|
||||
#define DATA_FORWARD_VEHICLE_6_COLOR srcDataBuf[ID_FRAME_R_0x09][2].sbit23.b57 /*前方车辆_6 颜色*/
|
||||
#define DATA_FORWARD_VEHICLE_4_TYPE srcDataBuf[ID_FRAME_R_0x09][3].sbit02.b01 /*前方车辆_4 类型*/
|
||||
#define DATA_FORWARD_VEHICLE_5_TYPE srcDataBuf[ID_FRAME_R_0x09][3].sbit02.b23 /*前方车辆_5 类型*/
|
||||
#define DATA_FORWARD_VEHICLE_6_TYPE srcDataBuf[ID_FRAME_R_0x09][3].sbit02.b45 /*前方车辆_6 类型*/
|
||||
#define DATA_FORWARD_VEHICLE_1_X srcDataBuf[ID_FRAME_R_0x09][4].value /*前方车辆_1 位置坐标x*/
|
||||
#define DATA_FORWARD_VEHICLE_1_Y srcDataBuf[ID_FRAME_R_0x09][5].value /*前方车辆_1 位置坐标y*/
|
||||
#define DATA_FORWARD_VEHICLE_2_X srcDataBuf[ID_FRAME_R_0x09][6].value /*前方车辆_2 位置坐标x*/
|
||||
#define DATA_FORWARD_VEHICLE_2_Y srcDataBuf[ID_FRAME_R_0x09][7].value /*前方车辆_2 位置坐标y*/
|
||||
|
||||
#define DATA_FORWARD_VEHICLE_3_X srcDataBuf[ID_FRAME_R_0x0A][0].value /*前方车辆_3 位置坐标x*/
|
||||
#define DATA_FORWARD_VEHICLE_3_Y srcDataBuf[ID_FRAME_R_0x0A][1].value /*前方车辆_3 位置坐标y*/
|
||||
#define DATA_FORWARD_VEHICLE_4_X srcDataBuf[ID_FRAME_R_0x0A][2].value /*前方车辆_4 位置坐标x*/
|
||||
#define DATA_FORWARD_VEHICLE_4_Y srcDataBuf[ID_FRAME_R_0x0A][3].value /*前方车辆_4 位置坐标y*/
|
||||
#define DATA_FORWARD_VEHICLE_5_X srcDataBuf[ID_FRAME_R_0x0A][4].value /*前方车辆_5 位置坐标x*/
|
||||
#define DATA_FORWARD_VEHICLE_5_Y srcDataBuf[ID_FRAME_R_0x0A][5].value /*前方车辆_5 位置坐标y*/
|
||||
#define DATA_FORWARD_VEHICLE_6_X srcDataBuf[ID_FRAME_R_0x0A][6].value /*前方车辆_6 位置坐标x*/
|
||||
#define DATA_FORWARD_VEHICLE_6_Y srcDataBuf[ID_FRAME_R_0x0A][7].value /*前方车辆_6 位置坐标y*/
|
||||
|
||||
#define DATA_MENU_LEFT_ID srcDataBuf[ID_FRAME_R_0x0B][0].sbit35.b02 /*左侧菜单ID*/
|
||||
#define DATA_MENU_LEFT_VALUE srcDataBuf[ID_FRAME_R_0x0B][0].sbit35.b37 /*左侧菜单数值*/
|
||||
#define DATA_MCU_BLT_OP_STATE srcDataBuf[ID_FRAME_R_0x0B][1].sbit02.b01 /*蓝牙电话MCU处理状态*/
|
||||
#define DATA_MCU_BLT_OP_CURSOR srcDataBuf[ID_FRAME_R_0x0B][1].sbit35.b37 /*蓝牙电话MCU操作光标*/
|
||||
#define DATA_MCU_BLT_OP_CLICK srcDataBuf[ID_FRAME_R_0x0B][1].sbit.b2 /*蓝牙电话MCU点击状态*/
|
||||
//#define DATA_LANE_LL_LENGTH srcDataBuf[ID_FRAME_R_0x0B][3].sbit06.b05 /*左左车道线长度*/
|
||||
//#define DATA_LANE_L_LENGTH ((srcDataBuf[ID_FRAME_R_0x0B][3].sbit02.b67<<4)\
|
||||
// + srcDataBuf[ID_FRAME_R_0x0B][4].sbit04.b03) /*左车道线长度*/
|
||||
//#define DATA_LANE_R_LENGTH ((srcDataBuf[ID_FRAME_R_0x0B][4].sbit04.b47<<2)\
|
||||
// + srcDataBuf[ID_FRAME_R_0x0B][5].sbit02.b01) /*右车道线长度*/
|
||||
//#define DATA_LANE_RR_LENGTH srcDataBuf[ID_FRAME_R_0x0B][5].sbit26.b27 /*右右车道线长度*/
|
||||
#define DATA_BAT_LACK srcDataBuf[ID_FRAME_R_0x0B][2].sbit.b6 /* 续航里程灯 */
|
||||
#define DATA_RADAR_DISTANCE srcDataBuf[ID_FRAME_R_0x0B][5].value /*雷达距离*/
|
||||
#define DATA_VEHICLE_COLOR_CFG srcDataBuf[ID_FRAME_R_0x0B][6].value /*车身颜色配置*/
|
||||
#define DATA_ENGCOST_P100M srcDataBuf[ID_FRAME_R_0x0B][7].value /*最近100m能耗*/
|
||||
|
||||
#define DATA_TRAFFIC_LANE_PARAM_0_LL srcDataBuf[ID_FRAME_R_0x0D][0].value /*左左车道 常数参数 L0*/
|
||||
#define DATA_TRAFFIC_LANE_PARAM_0_L srcDataBuf[ID_FRAME_R_0x0D][1].value /*左车道 常数参数 L0*/
|
||||
#define DATA_TRAFFIC_LANE_PARAM_0_R srcDataBuf[ID_FRAME_R_0x0D][2].value /*右车道 常数参数 L0*/
|
||||
#define DATA_TRAFFIC_LANE_PARAM_0_RR srcDataBuf[ID_FRAME_R_0x0D][3].value /*右右车道 常数参数 L0*/
|
||||
|
||||
#define DATA_LANE_LL_LENGTH srcDataBuf[ID_FRAME_R_0x0D][4].sbit06.b05 /*左左车道线长度*/
|
||||
#define DATA_LANE_L_LENGTH ((srcDataBuf[ID_FRAME_R_0x0D][4].sbit02.b67<<4)\
|
||||
+srcDataBuf[ID_FRAME_R_0x0D][5].sbit04.b03) /*左车道线长度*/
|
||||
#define DATA_LANE_R_LENGTH ((srcDataBuf[ID_FRAME_R_0x0D][5].sbit04.b47<<2)\
|
||||
+srcDataBuf[ID_FRAME_R_0x0D][6].sbit02.b01) /*右车道线长度*/
|
||||
#define DATA_LANE_RR_LENGTH srcDataBuf[ID_FRAME_R_0x0D][6].sbit26.b27 /*右右车道线长度*/
|
||||
//#define DATA_DEMO_PREVIOUS_CNT srcDataBuf[ID_FRAME_R_0x0D][0].value /*[demo]上一张计数*/
|
||||
//#define DATA_DEMO_NEXT_CNT srcDataBuf[ID_FRAME_R_0x0D][1].value /*[demo]下一张计数*/
|
||||
#define DATA_ACC_STATE srcDataBuf[ID_FRAME_R_0x0D][7].sbit04.b03 /*自动变道状态*/
|
||||
#define DATA_FACE_RECOGNITION_STATE srcDataBuf[ID_FRAME_R_0x0D][7].sbit04.b47 /*人脸识别状态*/
|
||||
|
||||
#define SET_DATA_BLUETOOTH_STATE(v) dstDataBuf[ID_FRAME_W_0x00][0].sbit.b0 = (v)
|
||||
#define SET_DATA_OTA_STATE(v) dstDataBuf[ID_FRAME_W_0x00][0].sbit15.b15 = (v)
|
||||
#define SET_DATA_HMI_DSP_STATE(v) dstDataBuf[ID_FRAME_W_0x00][0].sbit02.b67 = (v)
|
||||
#define SET_DATA_RIGHT_DSP_STATE(v) dstDataBuf[ID_FRAME_W_0x00][1].sbit03.b02 = (v)
|
||||
#define SET_DATA_CALL_LIST_SZIE(v) dstDataBuf[ID_FRAME_W_0x00][1].sbit35.b37 = (v)
|
||||
#define SET_DATA_USB_INSERT_STATE(v) dstDataBuf[ID_FRAME_W_0x00][2].sbit.b0 = (v)
|
||||
|
||||
#endif // MAINBOARD_IIC_SYS_H_INCLUDED
|
||||
45
insDavi2.0/include/lib/InsFont.h
Normal file
45
insDavi2.0/include/lib/InsFont.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef INSFONT_H_INCLUDED
|
||||
#define INSFONT_H_INCLUDED
|
||||
|
||||
#include <BaseTypes.h>
|
||||
|
||||
Bool InitFtLibs
|
||||
(
|
||||
const char *ftFiles[],
|
||||
Int32 *libIDs,
|
||||
Int32 num
|
||||
);
|
||||
|
||||
void DeInitFtLibs
|
||||
(
|
||||
Int32 *libIDs,
|
||||
Int32 num
|
||||
);
|
||||
|
||||
Bool GenFontBmps
|
||||
(
|
||||
Int32 libID,
|
||||
Int32 charSize,
|
||||
Int32 texWidth,
|
||||
Int32 codeNum,
|
||||
const UInt32 *ucsCode,
|
||||
Int32 *texHigh,
|
||||
UInt08 **pixelBuff,
|
||||
Flt32 **widthRate,
|
||||
Flt32 **texcoord,
|
||||
Bool tight
|
||||
);
|
||||
|
||||
Bool DrawSingleLineTxtBmp
|
||||
(
|
||||
Int32 libID,
|
||||
Int32 charSize,
|
||||
Int32 *bmpWidth,
|
||||
Int32 *bmpHigh,
|
||||
const UInt32 *ucsCode,
|
||||
UInt08 *bmpPixel,
|
||||
Bool tight,
|
||||
Int32 *numDrawn
|
||||
);
|
||||
|
||||
#endif // INSFONT_H_INCLUDED
|
||||
25
insDavi2.0/include/lib/InsGL.h
Normal file
25
insDavi2.0/include/lib/InsGL.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef INSGL_H_INCLUDED
|
||||
#define INSGL_H_INCLUDED
|
||||
|
||||
#include <BaseTypes.h>
|
||||
|
||||
#ifdef COMPILE_IN_WINDOWS
|
||||
|
||||
#include <windows.h>
|
||||
extern HWND InsRenderHwnd;
|
||||
Bool InitGL();
|
||||
|
||||
#else
|
||||
|
||||
Bool InitGL(Int32 x, Int32 y, Int32 w, Int32 h, Int32 *rtw, Int32 *rth);
|
||||
|
||||
Bool InitGL_FB1(Int32 x, Int32 y, Int32 w, Int32 h, Int32 *rtw, Int32 *rth);
|
||||
Bool SwapGLBuffer_FB1();
|
||||
void DeInitGL_FB1();
|
||||
|
||||
#endif // COMPILE_IN_WINDOWS
|
||||
|
||||
Bool SwapGLBuffer();
|
||||
void DeInitGL();
|
||||
|
||||
#endif // INSGL_H_INCLUDED
|
||||
8
insDavi2.0/include/lib/InsJpeg.h
Normal file
8
insDavi2.0/include/lib/InsJpeg.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef INSJPEG_H_INCLUDED
|
||||
#define INSJPEG_H_INCLUDED
|
||||
|
||||
#include <BaseTypes.h>
|
||||
|
||||
Bool LoadJpegFromMem(void *mem, UInt32 memSz, Int32 *width, Int32 *height, UInt32 *format, void **bmp, UInt32 bmpSize);
|
||||
|
||||
#endif // INSJPEG_H_INCLUDED
|
||||
159
insDavi2.0/include/lib/InsMatrix.h
Normal file
159
insDavi2.0/include/lib/InsMatrix.h
Normal file
@@ -0,0 +1,159 @@
|
||||
#ifndef INSMATRIX_H_INCLUDED
|
||||
#define INSMATRIX_H_INCLUDED
|
||||
|
||||
#include <InsCfg.h>
|
||||
#include <BaseTypes.h>
|
||||
|
||||
#ifdef COMPILE_IN_WINDOWS
|
||||
|
||||
#include <windows.h>
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
|
||||
#else
|
||||
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
|
||||
#endif // COMPILE_IN_WINDOWS
|
||||
|
||||
#ifndef LoadIdentityMatrix
|
||||
|
||||
#define LoadIdentityMatrix(mat4x4) do{\
|
||||
mat4x4[ 0] = 1.0f; mat4x4[ 1] = 0.0f; mat4x4[ 2] = 0.0f; mat4x4[ 3] = 0.0f; \
|
||||
mat4x4[ 4] = 0.0f; mat4x4[ 5] = 1.0f; mat4x4[ 6] = 0.0f; mat4x4[ 7] = 0.0f; \
|
||||
mat4x4[ 8] = 0.0f; mat4x4[ 9] = 0.0f; mat4x4[10] = 1.0f; mat4x4[11] = 0.0f; \
|
||||
mat4x4[12] = 0.0f; mat4x4[13] = 0.0f; mat4x4[14] = 0.0f; mat4x4[15] = 1.0f;}while(0)
|
||||
|
||||
#endif // LoadIdentityMatrix
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GLfloat mat[MAX_MATRIX4x4STACK_DEPTH][4*4];
|
||||
GLint idx;
|
||||
} Matrix4x4Stack;
|
||||
|
||||
#define StackMat(stack) ((stack).mat[(stack).idx])
|
||||
|
||||
#define ReSetMatStack(stack) (stack).idx = (0)
|
||||
|
||||
#define PushMatrix4x4Stack(stack) do\
|
||||
{\
|
||||
if((stack).idx+1 < MAX_MATRIX4x4STACK_DEPTH)\
|
||||
{\
|
||||
CopyMatrix4x4((stack).mat[(stack).idx+1], (stack).mat[(stack).idx]);\
|
||||
(stack).idx += 1;\
|
||||
}\
|
||||
}while(0)
|
||||
|
||||
#define PopMatrix4x4Stack(stack) do{if((stack).idx > 0){(stack).idx -= (1);}}while(0)
|
||||
|
||||
GLfloat *MultMatrix4x4
|
||||
(
|
||||
GLfloat *matC,
|
||||
GLfloat *matA,
|
||||
GLfloat *matB
|
||||
);
|
||||
|
||||
GLfloat *MultMatrix4x4Vec4x1
|
||||
(
|
||||
GLfloat *vecB,
|
||||
GLfloat *matA,
|
||||
GLfloat *vecA
|
||||
);
|
||||
|
||||
GLfloat *CopyMatrix4x4
|
||||
(
|
||||
GLfloat *matDes,
|
||||
GLfloat *matSrc
|
||||
);
|
||||
|
||||
Bool InvertMatrix4x4
|
||||
(
|
||||
GLfloat *inverse,
|
||||
GLfloat *src
|
||||
);
|
||||
|
||||
GLfloat *SetRotateMat4x4
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
Vec3f *axis_nor,
|
||||
GLfloat angle
|
||||
);
|
||||
|
||||
GLfloat *RotateMat4x4
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
Vec3f *axis_nor,
|
||||
GLfloat angle
|
||||
);
|
||||
|
||||
GLfloat *SetRotateMatrix4x4_X_Axis
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat angle
|
||||
);
|
||||
|
||||
GLfloat *RotateMatrix4x4_X_Axis
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat angle
|
||||
);
|
||||
|
||||
GLfloat *SetRotateMatrix4x4_Y_Axis
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat angle
|
||||
);
|
||||
|
||||
GLfloat *RotateMatrix4x4_Y_Axis
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat angle
|
||||
);
|
||||
|
||||
GLfloat *SetRotateMatrix4x4_Z_Axis
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat angle
|
||||
);
|
||||
|
||||
GLfloat *RotateMatrix4x4_Z_Axis
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat angle
|
||||
);
|
||||
|
||||
GLfloat *SetTranslateMatrix4x4
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat trX,
|
||||
GLfloat trY,
|
||||
GLfloat trZ
|
||||
);
|
||||
|
||||
GLfloat *TranslateMatrix4x4
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat trX,
|
||||
GLfloat trY,
|
||||
GLfloat trZ
|
||||
);
|
||||
|
||||
GLfloat *SetScaleMatrix4x4
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat scaleX,
|
||||
GLfloat scaleY,
|
||||
GLfloat scaleZ
|
||||
);
|
||||
|
||||
GLfloat *ScaleMatrix4x4
|
||||
(
|
||||
GLfloat *mat4x4,
|
||||
GLfloat scaleX,
|
||||
GLfloat scaleY,
|
||||
GLfloat scaleZ
|
||||
);
|
||||
|
||||
#endif // INSMATRIX_H_INCLUDED
|
||||
8
insDavi2.0/include/lib/InsPng.h
Normal file
8
insDavi2.0/include/lib/InsPng.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef INSPNG_H_INCLUDED
|
||||
#define INSPNG_H_INCLUDED
|
||||
|
||||
#include <BaseTypes.h>
|
||||
|
||||
Bool LoadPngFromMem(void *mem, UInt32 memSz, Int32 *width, Int32 *height, UInt32 *format, void **bmp, UInt32 bmpSize);
|
||||
|
||||
#endif // INSPNG_H_INCLUDED
|
||||
29
insDavi2.0/include/lib/InsQueue.h
Normal file
29
insDavi2.0/include/lib/InsQueue.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef INSQUEUE_H_INCLUDED
|
||||
#define INSQUEUE_H_INCLUDED
|
||||
|
||||
#include <BaseTypes.h>
|
||||
|
||||
typedef struct Struct_InsNode InsNode;
|
||||
struct Struct_InsNode
|
||||
{
|
||||
void *data;
|
||||
InsNode *next;
|
||||
};
|
||||
|
||||
typedef struct Struct_InsQueue InsQueue;
|
||||
struct Struct_InsQueue
|
||||
{
|
||||
InsNode *head;
|
||||
InsNode *tail;
|
||||
UInt32 length;
|
||||
};
|
||||
|
||||
void pushQ(const InsNode *pItm, InsQueue *pQ);
|
||||
|
||||
void popQ(InsQueue *pQ);
|
||||
|
||||
InsNode *head(InsQueue *pQ);
|
||||
|
||||
InsNode *tail(InsQueue *pQ);
|
||||
|
||||
#endif // INSQUEUE_H_INCLUDED
|
||||
277
insDavi2.0/include/lib/cJSON.h
Normal file
277
insDavi2.0/include/lib/cJSON.h
Normal file
@@ -0,0 +1,277 @@
|
||||
/*
|
||||
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef cJSON__h
|
||||
#define cJSON__h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* project version */
|
||||
#define CJSON_VERSION_MAJOR 1
|
||||
#define CJSON_VERSION_MINOR 7
|
||||
#define CJSON_VERSION_PATCH 7
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/* cJSON Types: */
|
||||
#define cJSON_Invalid (0)
|
||||
#define cJSON_False (1 << 0)
|
||||
#define cJSON_True (1 << 1)
|
||||
#define cJSON_NULL (1 << 2)
|
||||
#define cJSON_Number (1 << 3)
|
||||
#define cJSON_String (1 << 4)
|
||||
#define cJSON_Array (1 << 5)
|
||||
#define cJSON_Object (1 << 6)
|
||||
#define cJSON_Raw (1 << 7) /* raw json */
|
||||
|
||||
#define cJSON_IsReference 256
|
||||
#define cJSON_StringIsConst 512
|
||||
|
||||
/* The cJSON structure: */
|
||||
typedef struct cJSON
|
||||
{
|
||||
/* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
|
||||
struct cJSON *next;
|
||||
struct cJSON *prev;
|
||||
/* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
|
||||
struct cJSON *child;
|
||||
|
||||
/* The type of the item, as above. */
|
||||
int type;
|
||||
|
||||
/* The item's string, if type==cJSON_String and type == cJSON_Raw */
|
||||
char *valuestring;
|
||||
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
|
||||
int valueint;
|
||||
/* The item's number, if type==cJSON_Number */
|
||||
double valuedouble;
|
||||
|
||||
/* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
|
||||
char *string;
|
||||
} cJSON;
|
||||
|
||||
typedef struct cJSON_Hooks
|
||||
{
|
||||
void *(*malloc_fn)(size_t sz);
|
||||
void (*free_fn)(void *ptr);
|
||||
} cJSON_Hooks;
|
||||
|
||||
typedef int cJSON_bool;
|
||||
|
||||
#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
|
||||
#define __WINDOWS__
|
||||
#endif
|
||||
#ifdef __WINDOWS__
|
||||
|
||||
/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 2 define options:
|
||||
|
||||
CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols
|
||||
CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default)
|
||||
CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol
|
||||
|
||||
For *nix builds that support visibility attribute, you can define similar behavior by
|
||||
|
||||
setting default visibility to hidden by adding
|
||||
-fvisibility=hidden (for gcc)
|
||||
or
|
||||
-xldscope=hidden (for sun cc)
|
||||
to CFLAGS
|
||||
|
||||
then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does
|
||||
|
||||
*/
|
||||
|
||||
/* export symbols by default, this is necessary for copy pasting the C and header file */
|
||||
#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS)
|
||||
#define CJSON_EXPORT_SYMBOLS
|
||||
#endif
|
||||
|
||||
#if defined(CJSON_HIDE_SYMBOLS)
|
||||
#define CJSON_PUBLIC(type) type __stdcall
|
||||
#elif defined(CJSON_EXPORT_SYMBOLS)
|
||||
#define CJSON_PUBLIC(type) __declspec(dllexport) type __stdcall
|
||||
#elif defined(CJSON_IMPORT_SYMBOLS)
|
||||
#define CJSON_PUBLIC(type) __declspec(dllimport) type __stdcall
|
||||
#endif
|
||||
#else /* !WIN32 */
|
||||
#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY)
|
||||
#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type
|
||||
#else
|
||||
#define CJSON_PUBLIC(type) type
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them.
|
||||
* This is to prevent stack overflows. */
|
||||
#ifndef CJSON_NESTING_LIMIT
|
||||
#define CJSON_NESTING_LIMIT 1000
|
||||
#endif
|
||||
|
||||
/* returns the version of cJSON as a string */
|
||||
CJSON_PUBLIC(const char*) cJSON_Version(void);
|
||||
|
||||
/* Supply malloc, realloc and free functions to cJSON */
|
||||
CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks);
|
||||
|
||||
/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */
|
||||
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value);
|
||||
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
|
||||
/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated);
|
||||
|
||||
/* Render a cJSON entity to text for transfer/storage. */
|
||||
CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item);
|
||||
/* Render a cJSON entity to text for transfer/storage without any formatting. */
|
||||
CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item);
|
||||
/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
|
||||
CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt);
|
||||
/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */
|
||||
/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format);
|
||||
/* Delete a cJSON entity and all subentities. */
|
||||
CJSON_PUBLIC(void) cJSON_Delete(cJSON *c);
|
||||
|
||||
/* Returns the number of items in an array (or object). */
|
||||
CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array);
|
||||
/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index);
|
||||
/* Get item "string" from object. Case insensitive. */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string);
|
||||
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
|
||||
CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
|
||||
|
||||
/* Check if the item is a string and return its valuestring */
|
||||
CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item);
|
||||
|
||||
/* These functions check the type of an item */
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item);
|
||||
|
||||
/* These calls create a cJSON item of the appropriate type. */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string);
|
||||
/* raw json */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void);
|
||||
|
||||
/* Create a string where valuestring references a string so
|
||||
* it will not be freed by cJSON_Delete */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string);
|
||||
/* Create an object/arrray that only references it's elements so
|
||||
* they will not be freed by cJSON_Delete */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child);
|
||||
|
||||
/* These utilities create an Array of count items. */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count);
|
||||
|
||||
/* Append item to the specified array/object. */
|
||||
CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item);
|
||||
CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item);
|
||||
/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object.
|
||||
* WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before
|
||||
* writing to `item->string` */
|
||||
CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item);
|
||||
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
|
||||
CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
|
||||
CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item);
|
||||
|
||||
/* Remove/Detatch items from Arrays/Objects. */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which);
|
||||
CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string);
|
||||
CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string);
|
||||
CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string);
|
||||
CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string);
|
||||
|
||||
/* Update array items. */
|
||||
CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement);
|
||||
CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem);
|
||||
CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
|
||||
CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem);
|
||||
|
||||
/* Duplicate a cJSON item */
|
||||
CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse);
|
||||
/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
|
||||
need to be released. With recurse!=0, it will duplicate any children connected to the item.
|
||||
The item->next and ->prev pointers are always zero on return from Duplicate. */
|
||||
/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal.
|
||||
* case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */
|
||||
CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive);
|
||||
|
||||
|
||||
CJSON_PUBLIC(void) cJSON_Minify(char *json);
|
||||
|
||||
/* Helper functions for creating and adding items to an object at the same time.
|
||||
* They return the added item or NULL on failure. */
|
||||
CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name);
|
||||
CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name);
|
||||
CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name);
|
||||
CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean);
|
||||
CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number);
|
||||
CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string);
|
||||
CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw);
|
||||
CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name);
|
||||
CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name);
|
||||
|
||||
/* When assigning an integer value, it needs to be propagated to valuedouble too. */
|
||||
#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number))
|
||||
/* helper for the cJSON_SetNumberValue macro */
|
||||
CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number);
|
||||
#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number))
|
||||
|
||||
/* Macro for iterating over an array or object */
|
||||
#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next)
|
||||
|
||||
/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */
|
||||
CJSON_PUBLIC(void *) cJSON_malloc(size_t size);
|
||||
CJSON_PUBLIC(void) cJSON_free(void *object);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user