Files
QDAC-firmware/app/jj_param.h
2024-07-08 19:14:34 +08:00

69 lines
1.5 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,
aim_common = Page1_head,
aim_cross,
aim_cricle,
aim_barrier,
offset_barrier,
aim_straight,
aim_turn,
aim_mid,
Page2_head,
// 第二页参数
baoguang = Page2_head,
auto_exp_param,
Page3_head,
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 tiny_frame_param[20];
void jj_param_eeprom_init(void);
void jj_param_write(void);
void jj_param_read(void);
extern float data7;
extern float auto_exp;
#endif