2023-04-04 20:58:34 +02:00
|
|
|
#ifndef INC_PARAMS_H
|
|
|
|
#define INC_PARAMS_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-04-04 22:05:50 +02:00
|
|
|
#include <stddef.h>
|
2023-04-04 20:58:34 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2023-04-04 22:05:50 +02:00
|
|
|
#include "util.h"
|
|
|
|
|
2024-12-21 16:19:44 +01:00
|
|
|
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];
|
2023-04-04 20:58:34 +02:00
|
|
|
} Params;
|
|
|
|
|
|
|
|
extern Params params;
|
2024-12-21 16:19:44 +01:00
|
|
|
// TODO: Use ParamType_COUNT somehow?
|
|
|
|
extern float param_steps[17];
|
2023-04-04 20:58:34 +02:00
|
|
|
|
2023-04-04 22:05:50 +02:00
|
|
|
void params_init();
|
|
|
|
void params_inc(ParamType param);
|
|
|
|
void params_dec(ParamType param);
|
|
|
|
void params_broadcast(ParamType param);
|
|
|
|
|
2023-04-04 20:58:34 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // INC_PARAMS_H
|