Settings types and structures

Structures definitions for usage in settings, values, messages and commands. Defined in settings_types.h file.

settings_types.h file contains all structures and enums used in settings module, that are used in subsequent files and do not need to be auto-generated at build time.

Enum

conversion_t

enum conversion_t defines all possible data types used in settings:

  • UINT8_T = 1,

  • UINT16_T = 2,

  • UINT32_T = 3,

  • INT8_T = 4,

  • INT16_T = 5,

  • INT32_T = 6,

  • FLOAT = 7,

  • BYTE_ARRAY = 8,

  • BOOL = 9

hw_type

hw_type defines all possible HW versions that are supported.

  • wisentedge_nrf52840 = 1

fw_type

fw_type defines all possible FW versions that are supported in FW.

  • lion_tracker = 1

Settings

Structures containing settings governing settings, values, messages and commands communication and fields. Mainly containing port number for specific type.

  • fw_version

    • major

    • minor

  • hw_version

    • hw_type (enum)

    • major

    • minor

  • settings_defines - settings for basic settings values

    • port

    • fw_type

  • advanced_settings - settings for advanced settings values

    • port

  • commands_settings

    • port

  • values_settings

    • port

Values

Definitions of structs holding values and settings of certain types:

  • value_uint8

  • value_uint16

  • value_uint32

  • value_int8

  • value_int16

  • value_int32

  • value_float

  • value_byte_array

  • value_bool

Each structure is of the same format containing:

  • uint8_t id - id of setting or value

  • bool enabled - is setting or value enabled

  • def_val - default value of certain type

  • min - min value of certain type

  • max - max value of certain type

  • uint8_t len - length of type in bytes

  • conversion_t conversion - data type

Note that float values are stored as int16_t array[2] with encoding:

array[0] = (int16_t) float_val

and

array[1] = (int16_t) (float_val - array[0]) * 10000

Last updated