43 lines
832 B
C
43 lines
832 B
C
#ifndef INC_PARAMS_H
|
|
#define INC_PARAMS_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <tx_port.h>
|
|
|
|
#include "util.h"
|
|
|
|
CountedEnum(ParamType, size_t, PF_PLIM, PF_TLIM, PF_SLIM, PF_TVEC, PF_PG,
|
|
PF_REKU);
|
|
|
|
typedef struct {
|
|
unsigned plim; //< Power limit
|
|
unsigned tlim; //< Torque limit
|
|
unsigned slim; //< Speed limit
|
|
unsigned tvec; //< Torque vectoring
|
|
unsigned pg; //< Power ground
|
|
unsigned reku; //< Rekuperation
|
|
} Params;
|
|
|
|
extern Params params;
|
|
|
|
void params_init();
|
|
void params_inc(ParamType param);
|
|
void params_dec(ParamType param);
|
|
void params_broadcast(ParamType param);
|
|
|
|
/** FT24 only
|
|
* Broadcasts the current registered params to the CAN bus every second
|
|
*/
|
|
void params_thread_entry(ULONG _);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // INC_PARAMS_H
|