Files
checker_slave/source/elec_det/interface/BaseChecker.h

107 lines
2.7 KiB
C
Raw Normal View History

#ifndef BASECHECKER_H_
#define BASECHECKER_H_
#include "stm32f10x.h"
#define CHECKER_NET_ID 10
#define CHECKER_DELAY_TIME 10
#define CHECKER_MAXRT_COUNT 64
#define CHECKER_MAXID_COUNT 100
typedef void (*CheckerTask)(void );
#pragma pack(1)
typedef struct {
uint8_t taskid; //任务ID
uint8_t runindex;//任务序列
uint8_t retry_time;//重试次数
uint8_t error_jumpto;//失败后跳转
uint8_t param_rtv_count;//参数个数和返回值个数
uint16_t params[10];
}CheckerTask_Info_st;
typedef struct{
CheckerTask_Info_st task_info;
uint16_t params[10];//运行参数1
uint16_t rtv_index;//返回值下标
uint8_t rtv_count;//当前任务返回值个数
uint8_t param_count;//参数个数
uint8_t excue_rtv; //任务执行结果
uint8_t power_prapare_exe;//电源准备任务执行
uint16_t Test_Rtv[100];//保存返回参数
uint8_t Task_Result[8];//保存运行状态
uint8_t Task_Excute[8];//保存执行序列号
uint16_t netid;//电子模块最新的网络ID
uint8_t user_otp[4];//用户区OTP数据
uint8_t writeuid[13];//注码uid
2023-10-31 18:12:21 +08:00
uint8_t writepwd[8];//注码密码
uint8_t uid_len;//密码长度 XT 7 JQ 8
uint8_t pwd_len;//密码长度 XT 4 JQ 4
uint8_t uid_pwd_bind_flag;
uint8_t code_bind_check_flag;//三码绑定检测一起执行
}Checker_RunCfg_st ;
#pragma pack()
extern Checker_RunCfg_st checker_runcfg;
#define CHECKER_WRITE_BUF 48 //(CHECKER_FAC_BUF_LEN-2)
#define CHECKER_FAC_BUF_LEN 50 //len+crc8+48bytes
extern uint8_t Checker_FacBuf[CHECKER_FAC_BUF_LEN];
extern volatile uint8_t ThreeBindResult_flag ;
extern volatile uint16_t Checker_First_Set_Voltage ;//方案设置内部第一个电压
/*
@brief
@param rtv 1 0
@param taskindex ID号
*/
void Checker_MaskResult(uint8_t rtv,uint8_t taskindex);
/*
@brief
@param taskindex
*/
void Checker_Excueindex(uint8_t taskindex);
/*
@brief
@param *pus_rtv
@param count
*/
void Checker_SetRtv(uint16_t* pus_rtv, uint8_t count);
/*
brief
@param 10
*/
void Checker_PowerPrapare(void);
/*
@brief
@pram1 0.1S
@param 使线
@rtv1 AD值
*/
void Checker_WaitDelay(void);
/*
@brief
@param0 0 4线 1 2线 1-42 2线 2-3
@rtv0
*/
void Checker_ResistorSample(void);
/*
@brief
@rtv 0 1
*/
uint8_t JQXT_Test_IsNeedBind(void);
/*
*/
uint8_t Checker_FunIsValid(CheckerTask* taskArray,uint16_t run_index);
/*
@brief
@rtv 1 0
*/
uint8_t Checker_FacBufCheck(void);
#endif