PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Classes | |
struct | lis3mdl_bus_option |
Functions | |
int | calibrate (struct lis3mdl_bus_option &bus) |
Calibrate and self test. More... | |
int | info (struct lis3mdl_bus_option &bus) |
Prints info about the driver. More... | |
int | init (struct lis3mdl_bus_option &bus) |
Initializes the driver – sets defaults and starts a cycle. More... | |
int | reset (struct lis3mdl_bus_option &bus) |
Resets the driver. More... | |
int | start_bus (struct lis3mdl_bus_option &bus, Rotation rotation) |
Starts the driver for a specific bus option. More... | |
int | start (struct lis3mdl_bus_option &bus, Rotation rotation) |
Starts the driver. More... | |
int | stop (struct lis3mdl_bus_option &bus) |
Stop the driver. More... | |
int | test (struct lis3mdl_bus_option &bus) |
Perform some basic functional tests on the driver; make sure we can collect data from the sensor in polled and automatic modes. More... | |
void | usage () |
Prints info about the driver argument usage. More... | |
Variables | |
struct lis3mdl::lis3mdl_bus_option | bus_options [] |
int lis3mdl::calibrate | ( | struct lis3mdl_bus_option & | bus | ) |
Calibrate and self test.
Self test feature cannot be used to calculate scale.
SELF TEST OPERATION Note: To check the LIS3MDL for proper operation, a self test feature is incorporated : sensor offset straps are excited to create a nominal field strength (bias field) to be measured. To implement self test, the least significant bits (MS1 and MS0) of configuration register A are changed from 00 to 01 (positive bias). A few measurements are taken and stored with and without the additional magnetic field. According to ST datasheet, those values must stay between thresholds in order to pass the self test.
Definition at line 49 of file lis3mdl_main.cpp.
References lis3mdl::lis3mdl_bus_option::bus_id, lis3mdl::lis3mdl_bus_option::devpath, fd, MAGIOCCALIBRATE, and OK.
Referenced by lis3mdl_main().
int lis3mdl::info | ( | struct lis3mdl_bus_option & | bus | ) |
Prints info about the driver.
Definition at line 73 of file lis3mdl_main.cpp.
References lis3mdl::lis3mdl_bus_option::bus_id, lis3mdl::lis3mdl_bus_option::dev, lis3mdl::lis3mdl_bus_option::devpath, and LIS3MDL::print_info().
Referenced by lis3mdl_main().
int lis3mdl::init | ( | struct lis3mdl_bus_option & | bus | ) |
Initializes the driver – sets defaults and starts a cycle.
Definition at line 81 of file lis3mdl_main.cpp.
References lis3mdl::lis3mdl_bus_option::devpath, errx, fd, SENSOR_POLLRATE_DEFAULT, and SENSORIOCSPOLLRATE.
Referenced by lis3mdl_main().
int lis3mdl::reset | ( | struct lis3mdl_bus_option & | bus | ) |
Resets the driver.
Definition at line 230 of file lis3mdl_main.cpp.
References lis3mdl::lis3mdl_bus_option::bus_id, lis3mdl::lis3mdl_bus_option::devpath, fd, SENSOR_POLLRATE_DEFAULT, SENSORIOCRESET, and SENSORIOCSPOLLRATE.
Referenced by lis3mdl_main().
int lis3mdl::start | ( | struct lis3mdl_bus_option & | bus, |
Rotation | rotation | ||
) |
Starts the driver.
This function call only returns once the driver is either successfully up and running or failed to start.
Definition at line 134 of file lis3mdl_main.cpp.
References lis3mdl::lis3mdl_bus_option::dev, and bmp280::start_bus().
Referenced by lis3mdl_main().
int lis3mdl::start_bus | ( | struct lis3mdl_bus_option & | bus, |
Rotation | rotation | ||
) |
Starts the driver for a specific bus option.
Definition at line 106 of file lis3mdl_main.cpp.
References lis3mdl::lis3mdl_bus_option::dev, errx, OK, and warnx.
int lis3mdl::stop | ( | struct lis3mdl_bus_option & | bus | ) |
Stop the driver.
Definition at line 146 of file lis3mdl_main.cpp.
References lis3mdl::lis3mdl_bus_option::dev, and LIS3MDL::stop().
Referenced by lis3mdl_main().
int lis3mdl::test | ( | struct lis3mdl_bus_option & | bus | ) |
Perform some basic functional tests on the driver; make sure we can collect data from the sensor in polled and automatic modes.
Definition at line 161 of file lis3mdl_main.cpp.
References lis3mdl::lis3mdl_bus_option::bus_id, lis3mdl::lis3mdl_bus_option::devpath, fd, mag_report, MAGIOCGEXTERNAL, OK, read(), and SENSORIOCSPOLLRATE.
Referenced by lis3mdl_main().
void lis3mdl::usage | ( | void | ) |
Prints info about the driver argument usage.
Prints info about the driver argument usage.
Definition at line 257 of file lis3mdl_main.cpp.
Referenced by lis3mdl_main().
struct lis3mdl::lis3mdl_bus_option lis3mdl::bus_options[] |
Referenced by lis3mdl_main().