LSM303AGR ********************** .. doxygennamespace:: hux::sensors::STMicroelectronics::LSM303AGR :desc-only: To create a STMicroelectronics LSM303AGR sensor use the :c:macro:`HUX_DECLARE_SENSOR` construct: .. code-block:: cpp HUX_DECLARE_SENSOR(sensor_name, hux::sensors::STMicroelectronics::LSM303AGR); Simulation data ================ To define simulation data for a STMicroelectronics LSM303AGR sensor use the :c:macro:`HUX_DECLARE_SIMULATION_DATA` construct, making sure that the simulation data match the following data type: .. doxygentypedef:: hux::sensors::STMicroelectronics::LSM303AGR::simulation_data_t This example shows how to load simulation data for a STMicroelectronics LSM303AGR sensor from a CSV file whose columns are separated by semicolon (";"): .. code-block:: cpp HUX_DECLARE_SIMULATION_DATA(sim_data, hux::simulation::load_csv("dataset.csv", ";")) ); HUX_DECLARE_SENSOR(sensor_name, hux::sensors::STMicroelectronics::LSM303AGR, sim_data); Sources ========= The STMicroelectronics LSM303AGR sensor offers the following sources: .. doxygenclass:: hux::sensors::STMicroelectronics::LSM303AGR::Sensor :members: :members-only: Configurations =============== Initial configuration --------------------- To define an initial configuration for a STMicroelectronics LSM303AGR sensor use the :c:macro:`HUX_DECLARE_SENSOR_CONFIGURATION` construct: .. code-block:: cpp HUX_DECLARE_SENSOR_CONFIGURATION(conf_name, hux::sensors::STMicroelectronics::LSM303AGR, .PARAM_1 = VALUE_1, .PARAM_2 = VALUE_2, ... ); HUX_DECLARE_SENSOR(sensor_name, hux::sensors::STMicroelectronics::LSM303AGR, {}, conf_name); where *PARAM_1*, *PARAM_2*, ... can be any of the following: .. doxygenstruct:: hux::sensors::STMicroelectronics::LSM303AGR::Configuration :members: :members-only: .. note:: If a parameter is not specified within the sensor configuration its default value is used. Valid configuration values -------------------------- Each **sensor** model has its own configuration values that are permitted by the manufacturer and supported by Huxon. The valid configuration values for the configuration parameters of the STMicroelectronics LSM303AGR are listed below: .. doxygenstruct:: hux::sensors::STMicroelectronics::LSM303AGR::configs :members: :undoc-members: Dynamic configuration --------------------- The Huxon language provides the capability to reconfigure sensor parameters dynamically while the application is running. This allow to change the behavior of a sensor in response to specific events. To dynamically reconfigure a STMicroelectronics LSM303AGR sensor, it is necessary to create a configurator through the :c:macro:`HUX_SENSOR_CONFIGURATOR_BUILDER` and register it to the sensor using :c:macro:`HUX_REGISTER_SENSOR_CONFIGURATOR`: .. code-block:: cpp HUX_DECLARE_SENSOR(sensor_name, hux::sensors::STMicroelectronics::LSM303AGR); ... auto configurator = HUX_SENSOR_CONFIGURATOR_BUILDER(hux::sensors::STMicroelectronics::LSM303AGR) .add_PARAM1_cfg_chan(param1_channel) .add_PARAM2_cfg_chan(param2_channel) ... .finalize(); HUX_REGISTER_SENSOR_CONFIGURATOR(sensor_name, configurator); where *param1_channel*, *param2_channel*, ... are channels that generate configuration values, while the configurator builder methods: *add_PARAM1_cfg_chan*, *add_PARAM2_cfg_chan*, ... bind such channels to the parameters they will configure. The configurator builder methods can be any of the following: .. doxygenclass:: hux::sensors::STMicroelectronics::LSM303AGR::anonymous_namespace{LSM303AGR.hpp}::SensorConfiguratorBuilder :members: :members-only: