32 #ifndef ROSFLIGHT_FIRMWARE_PARAM_H 33 #define ROSFLIGHT_FIRMWARE_PARAM_H 381 #endif // ROSFLIGHT_FIRMWARE_PARAM_H
char names[PARAMS_COUNT][PARAMS_NAME_LENGTH]
uint16_t lookup_param_id(const char name[PARAMS_NAME_LENGTH])
Gets the id of a parameter from its name.
param_type_t types[PARAMS_COUNT]
void set_defaults(void)
Set all parameters to default values.
void change_callback(uint16_t id)
Callback for executing actions that need to be taken when a parameter value changes.
bool read(void)
Read parameter values from non-volatile memory.
void init_param_int(uint16_t id, const char name[PARAMS_NAME_LENGTH], int32_t value)
bool set_param_float(uint16_t id, float value)
Sets the value of a floating point parameter by ID and calls the parameter callback.
float get_param_float(uint16_t id) const
Get the value of a floating point parameter by id.
static constexpr uint8_t PARAMS_NAME_LENGTH
param_type_t get_param_type(uint16_t id) const
Get the type of a parameter.
void set_listeners(ParamListenerInterface *const listeners[], size_t num_listeners)
Specify listeners for parameter changes.
const char * get_param_name(uint16_t id) const
Get the name of a parameter.
int get_param_int(uint16_t id) const
Get the value of an integer parameter by id.
bool set_param_by_name_int(const char name[PARAMS_NAME_LENGTH], int32_t value)
Sets the value of a parameter by name and calls the parameter change callback.
ParamListenerInterface *const * listeners_
void init_param_float(uint16_t id, const char name[PARAMS_NAME_LENGTH], float value)
void init()
Initialize parameter values.
bool set_param_by_name_float(const char name[PARAMS_NAME_LENGTH], float value)
Sets the value of a floating point parameter by name and calls the parameter change callback...
uint8_t compute_checksum(void)
bool write(void)
Write current parameter values to non-volatile memory.
bool set_param_int(uint16_t id, int32_t value)
Sets the value of a parameter by ID and calls the parameter change callback.
param_value_t values[PARAMS_COUNT]