#include <param.h>
Definition at line 230 of file param.h.
rosflight_firmware::Params::Params |
( |
ROSflight & |
_rf | ) |
|
void rosflight_firmware::Params::add_callback |
( |
std::function< void(int)> |
callback, |
|
|
uint16_t |
param_id |
|
) |
| |
void rosflight_firmware::Params::change_callback |
( |
uint16_t |
id | ) |
|
Callback for executing actions that need to be taken when a parameter value changes.
- Parameters
-
id | The ID of the parameter that was changed |
Definition at line 344 of file param.cpp.
uint8_t rosflight_firmware::Params::compute_checksum |
( |
void |
| ) |
|
|
private |
float rosflight_firmware::Params::get_param_float |
( |
uint16_t |
id | ) |
const |
|
inline |
Get the value of a floating point parameter by id.
- Parameters
-
id | The ID of the parameter |
- Returns
- The value of the parameter
Definition at line 326 of file param.h.
int rosflight_firmware::Params::get_param_int |
( |
uint16_t |
id | ) |
const |
|
inline |
Get the value of an integer parameter by id.
- Parameters
-
id | The ID of the parameter |
- Returns
- The value of the parameter
Definition at line 316 of file param.h.
const char* rosflight_firmware::Params::get_param_name |
( |
uint16_t |
id | ) |
const |
|
inline |
Get the name of a parameter.
- Parameters
-
id | The ID of the parameter |
- Returns
- The name of the parameter
Definition at line 336 of file param.h.
param_type_t rosflight_firmware::Params::get_param_type |
( |
uint16_t |
id | ) |
const |
|
inline |
Get the type of a parameter.
- Parameters
-
id | The ID of the parameter |
- Returns
- The type of the parameter This returns one of three possible types PARAM_TYPE_INT32, PARAM_TYPE_FLOAT, or PARAM_TYPE_INVALID See line 165
Definition at line 349 of file param.h.
void rosflight_firmware::Params::init |
( |
| ) |
|
Initialize parameter values.
Definition at line 90 of file param.cpp.
void rosflight_firmware::Params::init_param_float |
( |
uint16_t |
id, |
|
|
const char |
name[PARAMS_NAME_LENGTH], |
|
|
float |
value |
|
) |
| |
|
private |
void rosflight_firmware::Params::init_param_int |
( |
uint16_t |
id, |
|
|
const char |
name[PARAMS_NAME_LENGTH], |
|
|
int32_t |
value |
|
) |
| |
|
private |
uint16_t rosflight_firmware::Params::lookup_param_id |
( |
const char |
name[PARAMS_NAME_LENGTH] | ) |
|
Gets the id of a parameter from its name.
- Parameters
-
name | The name of the parameter |
- Returns
- The ID of the parameter if the name is valid, PARAMS_COUNT otherwise (invalid ID)
Definition at line 351 of file param.cpp.
bool rosflight_firmware::Params::read |
( |
void |
| ) |
|
Read parameter values from non-volatile memory.
- Returns
- True if successful, false otherwise
Definition at line 314 of file param.cpp.
void rosflight_firmware::Params::set_defaults |
( |
void |
| ) |
|
Set all parameters to default values.
Definition at line 100 of file param.cpp.
bool rosflight_firmware::Params::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.
- Parameters
-
name | The name of the parameter |
value | The new value |
- Returns
- True if a parameter value was changed, false otherwise
Definition at line 407 of file param.cpp.
bool rosflight_firmware::Params::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.
- Parameters
-
name | The name of the parameter |
value | The new value |
- Returns
- True if a parameter value was changed, false otherwise
Definition at line 401 of file param.cpp.
bool rosflight_firmware::Params::set_param_float |
( |
uint16_t |
id, |
|
|
float |
value |
|
) |
| |
Sets the value of a floating point parameter by ID and calls the parameter callback.
- Parameters
-
id | The ID of the parameter |
value | The new value |
- Returns
- True if a parameter was changed, false otherwise
Definition at line 389 of file param.cpp.
bool rosflight_firmware::Params::set_param_int |
( |
uint16_t |
id, |
|
|
int32_t |
value |
|
) |
| |
Sets the value of a parameter by ID and calls the parameter change callback.
- Parameters
-
id | The ID of the parameter |
value | The new value |
- Returns
- True if a parameter value was changed, false otherwise
Definition at line 377 of file param.cpp.
bool rosflight_firmware::Params::write |
( |
void |
| ) |
|
Write current parameter values to non-volatile memory.
- Returns
- True if successful, false otherwise
Definition at line 331 of file param.cpp.
std::function<void(int)> rosflight_firmware::Params::callbacks[PARAMS_COUNT] |
|
private |
params_t rosflight_firmware::Params::params |
|
private |
constexpr uint8_t rosflight_firmware::Params::PARAMS_NAME_LENGTH = 16 |
|
static |
The documentation for this class was generated from the following files: