2024-05-11 00:04:28 +08:00
|
|
|
|
#ifndef _SYS_CONFIG_H_
|
|
|
|
|
#define _SYS_CONFIG_H_
|
|
|
|
|
#include "app_control_out.h"
|
|
|
|
|
#include "app_uart.h"
|
|
|
|
|
#include "stdio.h"
|
|
|
|
|
#include "app_radar.h"
|
|
|
|
|
#include "app_ws2812.h"
|
2024-08-19 01:14:21 +08:00
|
|
|
|
#include "app_Time_Event.h"
|
2024-05-11 00:04:28 +08:00
|
|
|
|
#include "app_bat.h"
|
2024-08-19 01:14:21 +08:00
|
|
|
|
#include "app_PAD.h"
|
2024-08-19 12:09:05 +08:00
|
|
|
|
#include "app_ota.h"
|
2024-05-11 00:04:28 +08:00
|
|
|
|
|
2024-08-19 01:14:21 +08:00
|
|
|
|
// 存储在第1扇区第0页
|
|
|
|
|
#define CONF_OFFSET_BASE (0x18001000) // 配置信息存储地址(以页为单位:0x100)
|
|
|
|
|
#define CONF_OFFSET_ADDR (CONF_OFFSET_BASE - FLASH_BASE)
|
|
|
|
|
|
|
|
|
|
// 必须4字节对齐
|
|
|
|
|
typedef struct SYS_CONF{
|
|
|
|
|
uint16_t VERSION; // 软件版本号
|
|
|
|
|
uint8_t Manager_sLim; // 管理员模式油门极限(Unit:%)
|
|
|
|
|
uint8_t Tourist_sLim; // 游客模式油门极限
|
|
|
|
|
uint8_t Speed_Cut_sLim; // 减速油门极限(Unit:%)(自动减速时油门极限)
|
|
|
|
|
uint8_t Reserve; // 保留凑足4字节对齐
|
|
|
|
|
uint16_t Brake_DLimit; // 刹车距离极限(前进)(Unit:mm)
|
|
|
|
|
uint16_t Speed_Cut_DLimit; // 减速距离极限
|
|
|
|
|
uint16_t Brake_DLimit_B; // 刹车距离极限(后退)
|
|
|
|
|
uint16_t Speed_Cut_DLimit_B;// 减速距离极限
|
|
|
|
|
uint16_t CRC16; // 配置信息CRC16校验码
|
2024-05-11 00:04:28 +08:00
|
|
|
|
}SYS_CONF_t;
|
|
|
|
|
|
2024-08-19 01:14:21 +08:00
|
|
|
|
extern SYS_CONF_t sys_conf;
|
2024-05-11 00:04:28 +08:00
|
|
|
|
extern BAT_Message_t BAT_Message;
|
|
|
|
|
|
|
|
|
|
// 写配置
|
|
|
|
|
void write_cfg(SYS_CONF_t *sys_config_info_t);
|
2024-08-19 01:14:21 +08:00
|
|
|
|
// 读配置
|
|
|
|
|
uint8_t read_cfg(SYS_CONF_t *sys_config_info_t);
|
|
|
|
|
|
2024-05-11 00:04:28 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 油门ADC
|
|
|
|
|
#define ACC_UP_Res 5.1 //上分压电阻(unit:KΩ)
|
|
|
|
|
#define ACC_DOWN_Res 5.1 //下分压电阻
|
|
|
|
|
|
|
|
|
|
// 电池ADC
|
2024-08-19 01:14:21 +08:00
|
|
|
|
#define BAT_UP_Res 197.0 //上分压电阻(unit:KΩ)
|
|
|
|
|
#define BAT_DOWN_Res 4.7 //下分压电阻
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************系统版本**************************/
|
|
|
|
|
// 软件本号
|
|
|
|
|
#define SOFTWARE_ID 0x0101
|
|
|
|
|
/************************油门(Unit:%)************************/
|
|
|
|
|
// 管理员模式默认油门极限(0-100%)
|
|
|
|
|
#define D_Manager_sLim 100
|
|
|
|
|
// 游客模式默认油门极限(0-100%)
|
|
|
|
|
#define D_Tourist_sLim 50
|
|
|
|
|
// 减速油门极限(0-100%)(自动减速时油门极限)
|
|
|
|
|
#define D_Speed_Cut_sLim 50
|
|
|
|
|
/*****************刹车减速距离(前进)(Unit:mm)*****************/
|
|
|
|
|
// 默认自动刹车距离35~4500mm(毫米)
|
|
|
|
|
#define D_Brake_DLimit 1000
|
|
|
|
|
// 默认自动减速距离35~4500mm
|
|
|
|
|
#define D_Speed_Cut_DLimit 1600
|
|
|
|
|
/*****************刹车减速距离(后退)(Unit:mm)*****************/
|
|
|
|
|
// 默认自动刹车距离35~4500mm(毫米)
|
|
|
|
|
#define D_Brake_DLimit_B 1000
|
|
|
|
|
// 默认自动减速距离35~4500mm
|
|
|
|
|
#define D_Speed_Cut_DLimit_B 1600
|
2024-05-11 00:04:28 +08:00
|
|
|
|
|
|
|
|
|
|
2024-06-29 17:07:18 +08:00
|
|
|
|
/*****************************BLE************************/
|
|
|
|
|
#define BLE_ENABLE 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************雷达************************/
|
|
|
|
|
#define RADAR_MODE 0 // 0:电应普 1:FD07-3
|
|
|
|
|
|
|
|
|
|
|
2024-05-11 00:04:28 +08:00
|
|
|
|
#endif
|
|
|
|
|
|