PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <ak09916.hpp>
Public Member Functions | |
AK09916 (int bus, const char *path, enum Rotation rotation) | |
~AK09916 () | |
virtual int | init () override |
void | start () |
void | stop () |
void | print_info () |
int | probe () |
Protected Member Functions | |
int | setup () |
int | setup_master_i2c () |
bool | check_id () |
void | Run () |
void | try_measure () |
bool | is_ready () |
void | measure () |
int | reset () |
uint8_t | read_reg (uint8_t reg) |
void | read_block (uint8_t reg, uint8_t *val, uint8_t count) |
void | write_reg (uint8_t reg, uint8_t value) |
Private Member Functions | |
AK09916 (const AK09916 &)=delete | |
AK09916 | operator= (const AK09916 &)=delete |
Private Attributes | |
PX4Magnetometer | _px4_mag |
uint32_t | _cycle_interval {0} |
perf_counter_t | _mag_reads |
perf_counter_t | _mag_errors |
perf_counter_t | _mag_overruns |
perf_counter_t | _mag_overflows |
Definition at line 83 of file ak09916.hpp.
AK09916::AK09916 | ( | int | bus, |
const char * | path, | ||
enum Rotation | rotation | ||
) |
Definition at line 137 of file ak09916.cpp.
References _px4_mag, AK09916_MAG_RANGE_GA, DRV_MAG_DEVTYPE_AK09916, PX4Magnetometer::set_device_type(), and PX4Magnetometer::set_scale().
AK09916::~AK09916 | ( | ) |
Definition at line 150 of file ak09916.cpp.
References _mag_errors, _mag_overflows, _mag_overruns, _mag_reads, and perf_free().
|
privatedelete |
|
protected |
Definition at line 252 of file ak09916.cpp.
References AK09916_DEVICE_ID_A, AK09916REG_WIA, and read_reg().
Referenced by probe().
|
overridevirtual |
Definition at line 159 of file ak09916.cpp.
References ToneAlarmInterface::init(), OK, reset(), and start().
|
protected |
Definition at line 190 of file ak09916.cpp.
References _mag_overruns, AK09916_ST1_DOR, AK09916_ST1_DRDY, AK09916REG_ST1, OK, and perf_count().
Referenced by try_measure().
|
protected |
Definition at line 208 of file ak09916.cpp.
References _mag_errors, _mag_overflows, _px4_mag, AK09916_ST2_HOFL, AK09916REG_HXL, hrt_absolute_time(), hrt_abstime, OK, perf_count(), perf_event_count(), PX4Magnetometer::set_error_count(), PX4Magnetometer::set_external(), ak09916_regs::st2, PX4Magnetometer::update(), ak09916_regs::x, ak09916_regs::y, and ak09916_regs::z.
Referenced by try_measure().
void AK09916::print_info | ( | ) |
Definition at line 232 of file ak09916.cpp.
References _mag_errors, _mag_overruns, _mag_reads, _px4_mag, perf_print_counter(), and PX4Magnetometer::print_status().
int AK09916::probe | ( | ) |
Definition at line 283 of file ak09916.cpp.
References AK09916_RESET, AK09916REG_CNTL3, check_id(), OK, and write_reg().
Referenced by reset().
|
protected |
|
protected |
Definition at line 241 of file ak09916.cpp.
Referenced by check_id().
|
protected |
Definition at line 267 of file ak09916.cpp.
References AK09916_RESET, AK09916REG_CNTL3, OK, probe(), setup(), and write_reg().
Referenced by init().
|
protected |
Definition at line 326 of file ak09916.cpp.
References _cycle_interval, and try_measure().
|
protected |
Definition at line 301 of file ak09916.cpp.
References AK09916_CNTL2_CONTINOUS_MODE_100HZ, AK09916REG_CNTL2, OK, and write_reg().
Referenced by reset().
|
protected |
void AK09916::start | ( | ) |
Definition at line 309 of file ak09916.cpp.
References _cycle_interval, and AK09916_CONVERSION_INTERVAL_us.
Referenced by init().
void AK09916::stop | ( | ) |
Definition at line 317 of file ak09916.cpp.
References _cycle_interval.
|
protected |
Definition at line 180 of file ak09916.cpp.
References is_ready(), and measure().
Referenced by Run().
|
protected |
Definition at line 260 of file ak09916.cpp.
Referenced by probe(), reset(), and setup().
|
private |
Definition at line 113 of file ak09916.hpp.
|
private |
Definition at line 116 of file ak09916.hpp.
Referenced by measure(), print_info(), and ~AK09916().
|
private |
Definition at line 118 of file ak09916.hpp.
Referenced by measure(), and ~AK09916().
|
private |
Definition at line 117 of file ak09916.hpp.
Referenced by is_ready(), print_info(), and ~AK09916().
|
private |
Definition at line 115 of file ak09916.hpp.
Referenced by print_info(), and ~AK09916().
|
private |
Definition at line 111 of file ak09916.hpp.
Referenced by AK09916(), measure(), and print_info().