Files
QD4C-firmware/app/jj_param.h
井明江 06004e9e0b feat:
增加发车和停车菜单
增加停车相关条件开关功能
pref:
弯道速度控制一次函数->二次函数
删除图像下发无意义的0状态
fix:
修复下位机多次复位才能触发上位机复位
2024-08-12 18:08:46 +08:00

121 lines
2.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _JJ_PARAM_H_
#define _JJ_PARAM_H_
#include "stdio.h"
#include "ch32v30x.h"
#include "zf_driver_soft_iic.h"
/**
* @brief 注册需调参数
*
*/
#define PARAM_REG(_data_tag_, _p_data_, _type_, _cmd_, _text_) \
Param_Data[_data_tag_].p_data = (void *)_p_data_; \
Param_Data[_data_tag_].type = _type_; \
Param_Data[_data_tag_].cmd = _cmd_; \
Param_Data[_data_tag_].text = _text_;
typedef enum {
Page1_head = 0,
// 完道pid
angle_Kp0 = Page1_head,
angle_Ki0,
angle_Kd0,
gyro_Kp0,
gyro_Ki0,
gyro_Kd0,
can_Kp1,
can_Ki1,
can_Kd1,
fly_pwm,
param_set_speed0,
// 直道pid
Page2_head,
angle_Kp1 = Page2_head,
angle_Ki1,
angle_Kd1,
gyro_Kp1,
gyro_Ki1,
gyro_Kd1,
pos_Kp1,
pos_Ki1,
pos_Kd1,
param_set_speed1,
// 圆环皮带
Page3_head,
yuan_Kp0 = Page3_head,
yuan_Ki0,
yuan_Kd0,
yugyro_Kp0,
yugyro_Ki0,
yugyro_Kd0,
speed_Kp,
speed_Ki,
speed_Kd,
param_set_speed2,
param_set_speed3,
Page4_head,
zhgy_Kp = Page4_head,
zhgy_Ki,
zhgy_Kd,
zhan_Kp,
zhan_Ki,
zhan_Kd,
zhpo_Kp,
zhpo_Ki,
zhpo_Kd,
param_set_speed4,
Page5_head,
bug_stop = Page5_head,
shock_stop,
out_stop,
DATA_IN_FLASH_NUM,
delta_x,
delta_y,
DATA_NUM,
} data_tag_t;
typedef enum {
EUINT32,
EINT32,
EFLOAT,
} ENUM_TYPE;
typedef union {
uint32_t u32;
int32_t s32;
float f32;
uint8_t u8[4];
} TYPE_UNION;
typedef struct {
void *p_data;
ENUM_TYPE type;
uint8_t cmd; // 01:仅存储 00仅显示 02传输并显示
char *text;
} PARAM_INFO;
extern soft_iic_info_struct eeprom_param;
extern PARAM_INFO Param_Data[DATA_NUM];
extern TYPE_UNION iic_buffer[DATA_IN_FLASH_NUM];
extern TYPE_UNION temp_frame_param[20];
void jj_param_eeprom_init(void);
void jj_param_write(void);
void jj_param_read(void);
extern float data7;
#endif