PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/time.h>
#include <drivers/device/i2c.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <semaphore.h>
#include <string.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <lib/perf/perf_counter.h>
#include <systemlib/err.h>
#include <drivers/drv_mag.h>
#include <drivers/drv_hrt.h>
#include <drivers/device/ringbuffer.h>
#include <drivers/drv_device.h>
#include <uORB/uORB.h>
#include <float.h>
#include <px4_platform_common/getopt.h>
#include <lib/conversion/rotation.h>
#include "hmc5883.h"
Go to the source code of this file.
Classes | |
class | HMC5883 |
struct | HMC5883::_last_report |
used for info() More... | |
Macros | |
#define | HMC5883_CONVERSION_INTERVAL (1000000 / 150) /* microseconds */ |
#define | ADDR_CONF_A 0x00 |
#define | ADDR_CONF_B 0x01 |
#define | ADDR_MODE 0x02 |
#define | ADDR_DATA_OUT_X_MSB 0x03 |
#define | ADDR_DATA_OUT_X_LSB 0x04 |
#define | ADDR_DATA_OUT_Z_MSB 0x05 |
#define | ADDR_DATA_OUT_Z_LSB 0x06 |
#define | ADDR_DATA_OUT_Y_MSB 0x07 |
#define | ADDR_DATA_OUT_Y_LSB 0x08 |
#define | ADDR_STATUS 0x09 |
#define | ADDR_TEMP_OUT_MSB 0x31 |
#define | ADDR_TEMP_OUT_LSB 0x32 |
#define | HMC5883L_MODE_NORMAL (0 << 0) /* default */ |
#define | HMC5883L_MODE_POSITIVE_BIAS (1 << 0) /* positive bias */ |
#define | HMC5883L_MODE_NEGATIVE_BIAS (1 << 1) /* negative bias */ |
#define | HMC5883L_AVERAGING_1 (0 << 5) /* conf a register */ |
#define | HMC5883L_AVERAGING_2 (1 << 5) |
#define | HMC5883L_AVERAGING_4 (2 << 5) |
#define | HMC5883L_AVERAGING_8 (3 << 5) |
#define | MODE_REG_CONTINOUS_MODE (0 << 0) |
#define | MODE_REG_SINGLE_MODE (1 << 0) /* default */ |
#define | STATUS_REG_DATA_OUT_LOCK (1 << 1) /* page 16: set if data is only partially read, read device to reset */ |
#define | STATUS_REG_DATA_READY (1 << 0) /* page 16: set if all axes have valid measurements */ |
#define | HMC5983_TEMP_SENSOR_ENABLE (1 << 7) |
#define ADDR_CONF_A 0x00 |
Definition at line 80 of file HMC5883.hpp.
Referenced by HMC5883::check_conf(), HMC5883::set_excitement(), and HMC5883::set_temperature_compensation().
#define ADDR_CONF_B 0x01 |
Definition at line 81 of file HMC5883.hpp.
Referenced by HMC5883::check_range(), and HMC5883::set_range().
#define ADDR_DATA_OUT_X_LSB 0x04 |
Definition at line 84 of file HMC5883.hpp.
#define ADDR_DATA_OUT_X_MSB 0x03 |
Definition at line 83 of file HMC5883.hpp.
Referenced by HMC5883::collect().
#define ADDR_DATA_OUT_Y_LSB 0x08 |
Definition at line 88 of file HMC5883.hpp.
#define ADDR_DATA_OUT_Y_MSB 0x07 |
Definition at line 87 of file HMC5883.hpp.
#define ADDR_DATA_OUT_Z_LSB 0x06 |
Definition at line 86 of file HMC5883.hpp.
#define ADDR_DATA_OUT_Z_MSB 0x05 |
Definition at line 85 of file HMC5883.hpp.
#define ADDR_MODE 0x02 |
Definition at line 82 of file HMC5883.hpp.
Referenced by HMC5883::measure().
#define ADDR_STATUS 0x09 |
Definition at line 89 of file HMC5883.hpp.
Referenced by RM3100::check_measurement().
#define ADDR_TEMP_OUT_LSB 0x32 |
Definition at line 93 of file HMC5883.hpp.
#define ADDR_TEMP_OUT_MSB 0x31 |
Definition at line 92 of file HMC5883.hpp.
Referenced by HMC5883::collect().
#define HMC5883_CONVERSION_INTERVAL (1000000 / 150) /* microseconds */ |
Definition at line 78 of file HMC5883.hpp.
Referenced by HMC5883::ioctl(), HMC5883::read(), and HMC5883::Run().
#define HMC5883L_AVERAGING_1 (0 << 5) /* conf a register */ |
Definition at line 100 of file HMC5883.hpp.
#define HMC5883L_AVERAGING_2 (1 << 5) |
Definition at line 101 of file HMC5883.hpp.
#define HMC5883L_AVERAGING_4 (2 << 5) |
Definition at line 102 of file HMC5883.hpp.
#define HMC5883L_AVERAGING_8 (3 << 5) |
Definition at line 103 of file HMC5883.hpp.
#define HMC5883L_MODE_NEGATIVE_BIAS (1 << 1) /* negative bias */ |
Definition at line 98 of file HMC5883.hpp.
#define HMC5883L_MODE_NORMAL (0 << 0) /* default */ |
Definition at line 96 of file HMC5883.hpp.
#define HMC5883L_MODE_POSITIVE_BIAS (1 << 0) /* positive bias */ |
Definition at line 97 of file HMC5883.hpp.
#define HMC5983_TEMP_SENSOR_ENABLE (1 << 7) |
Definition at line 111 of file HMC5883.hpp.
Referenced by HMC5883::collect(), and HMC5883::set_temperature_compensation().
#define MODE_REG_CONTINOUS_MODE (0 << 0) |
Definition at line 105 of file HMC5883.hpp.
Referenced by LIS3MDL::measure().
#define MODE_REG_SINGLE_MODE (1 << 0) /* default */ |
Definition at line 106 of file HMC5883.hpp.
Referenced by LIS3MDL::measure(), and HMC5883::measure().
#define STATUS_REG_DATA_OUT_LOCK (1 << 1) /* page 16: set if data is only partially read, read device to reset */ |
Definition at line 108 of file HMC5883.hpp.
#define STATUS_REG_DATA_READY (1 << 0) /* page 16: set if all axes have valid measurements */ |
Definition at line 109 of file HMC5883.hpp.