55 lines
866 B
C
55 lines
866 B
C
#ifndef INC_PARAMS_H
|
|
#define INC_PARAMS_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include "util.h"
|
|
|
|
typedef enum {
|
|
DC_0 = 0,
|
|
DC_1 = 1,
|
|
DC_2 = 2,
|
|
DC_3 = 3,
|
|
} Discipline;
|
|
|
|
typedef struct {
|
|
uint32_t value;
|
|
uint32_t min_value;
|
|
uint32_t max_value;
|
|
uint32_t step_value;
|
|
float display_factor;
|
|
} ParamConfig;
|
|
|
|
// clang-format off
|
|
CountedEnum(ParamType, size_t,
|
|
PF_SpeedLimit,
|
|
PF_TorqueLimit,
|
|
PF_PowerLimit,
|
|
PF_Discipline,
|
|
PF_TorqueVectoringOn,
|
|
PF_TractionControlOn,
|
|
PF_Rekuperation,
|
|
PF_TractionControlP,
|
|
PF_TractionControlI,
|
|
PF_TractionControlMuMax,
|
|
PF_TractionControlSlipRef,
|
|
);
|
|
// clang-format on
|
|
|
|
extern ParamConfig params[];
|
|
|
|
void params_inc(ParamType param);
|
|
void params_dec(ParamType param);
|
|
void params_broadcast(ParamType param);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // INC_PARAMS_H
|