steering-wheel/Core/Inc/params.h

57 lines
1.1 KiB
C

#ifndef INC_PARAMS_H
#define INC_PARAMS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
#include "util.h"
CountedEnum(ParamType, size_t, PF_BBAL, PF_PLIM, PF_TORQUE, PF_SLIM,
PF_APPS0_MIN, PF_APPS0_MAX, PF_APPS1_MIN, PF_APPS1_MAX, PF_TV,
PF_TC, PF_TC_SLIPREF, PF_TC_MUMAX, PF_TC_P, PF_TC_I, PF_DRS_CLOSED,
PF_DRS_OPEN, PF_MAP);
typedef union {
struct {
float bbal;
float plim;
float torque;
float slim;
float apps0_min;
float apps0_max;
float apps1_min;
float apps1_max;
int tv;
int tc;
float tc_slipref;
float tc_mumax;
float tc_p;
float tc_i;
float drs_closed;
float drs_open;
int map;
};
// TODO: Use ParamType_COUNT somehow?
float valuesFloat[17];
int valuesInt[17];
} Params;
extern Params params;
// TODO: Use ParamType_COUNT somehow?
extern float param_steps[17];
void params_init();
void params_inc(ParamType param);
void params_dec(ParamType param);
void params_broadcast(ParamType param);
#ifdef __cplusplus
}
#endif
#endif // INC_PARAMS_H