PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <ADIS16497.hpp>
Classes | |
struct | ADISReport |
Public Member Functions | |
ADIS16497 (int bus, uint32_t device, enum Rotation rotation=ROTATION_NONE) | |
virtual | ~ADIS16497 () |
virtual int | init () |
void | print_info () |
Protected Member Functions | |
virtual int | probe () |
Private Member Functions | |
void | start () |
Start automatic measurement. More... | |
void | stop () |
Stop automatic measurement. More... | |
int | reset () |
Reset chip. More... | |
void | Run () override |
int | measure () |
Fetch measurements from the sensor and update the report buffers. More... | |
uint16_t | read_reg16 (uint8_t reg) |
void | write_reg (uint8_t reg, uint8_t value) |
void | write_reg16 (uint8_t reg, uint16_t value) |
bool | self_test () |
uint32_t | crc32 (const uint16_t *data, size_t len) const |
Static Private Member Functions | |
static int | data_ready_interrupt (int irq, void *context, void *arg) |
Private Attributes | |
PX4Accelerometer | _px4_accel |
PX4Gyroscope | _px4_gyro |
perf_counter_t | _sample_perf |
perf_counter_t | _bad_transfers |
Definition at line 86 of file ADIS16497.hpp.
ADIS16497::ADIS16497 | ( | int | bus, |
uint32_t | device, | ||
enum Rotation | rotation = ROTATION_NONE |
||
) |
Definition at line 69 of file ADIS16497.cpp.
References _px4_accel, _px4_gyro, ADIS16497_DEFAULT_RATE, CONSTANTS_ONE_G, DRV_ACC_DEVTYPE_ADIS16497, DRV_GYR_DEVTYPE_ADIS16497, f(), math::radians(), PX4Accelerometer::set_device_type(), PX4Gyroscope::set_device_type(), PX4Accelerometer::set_sample_rate(), PX4Gyroscope::set_sample_rate(), PX4Accelerometer::set_scale(), and PX4Gyroscope::set_scale().
|
virtual |
Definition at line 91 of file ADIS16497.cpp.
References _bad_transfers, _sample_perf, perf_free(), and stop().
|
inlineprivate |
Definition at line 167 of file ADIS16497.hpp.
References crc32_tab, and data.
Referenced by measure().
|
staticprivate |
Definition at line 365 of file ADIS16497.cpp.
Referenced by start().
|
virtual |
Definition at line 102 of file ADIS16497.cpp.
References ToneAlarmInterface::init(), OK, and start().
Referenced by adis16497::start().
|
private |
Fetch measurements from the sensor and update the report buffers.
Definition at line 383 of file ADIS16497.cpp.
References _bad_transfers, _px4_accel, _px4_gyro, _sample_perf, BURST_CMD, ADIS16497::ADISReport::cmd, crc32(), DIR_READ, f(), hrt_absolute_time(), hrt_abstime, OK, perf_begin(), perf_count(), perf_end(), perf_event_count(), PX4Accelerometer::set_error_count(), PX4Gyroscope::set_error_count(), PX4Accelerometer::set_temperature(), PX4Gyroscope::set_temperature(), PX4Accelerometer::update(), and PX4Gyroscope::update().
Referenced by Run().
void ADIS16497::print_info | ( | ) |
Definition at line 466 of file ADIS16497.cpp.
References _bad_transfers, _px4_accel, _px4_gyro, _sample_perf, perf_print_counter(), PX4Accelerometer::print_status(), and PX4Gyroscope::print_status().
Referenced by adis16497::status().
|
protectedvirtual |
Definition at line 234 of file ADIS16497.cpp.
References PAGE_ID, PROD_ID, PROD_ID_ADIS16497, read_reg16(), reset(), self_test(), and write_reg16().
|
private |
Definition at line 302 of file ADIS16497.cpp.
References DIR_READ, and T_STALL.
Referenced by probe(), reset(), and self_test().
|
private |
Reset chip.
Resets the chip and measurements ranges, but not scale and offset.
Definition at line 116 of file ADIS16497.cpp.
References CONFIG, DEC_RATE, FILTR_BNK_0, FILTR_BNK_1, FNCTIO_CTRL, GLOB_CMD, NULL_CNFG, OK, PAGE_ID, read_reg16(), and write_reg16().
Referenced by probe().
|
overrideprivate |
Definition at line 376 of file ADIS16497.cpp.
References measure().
|
private |
Definition at line 267 of file ADIS16497.cpp.
References DIAG_STS, GLOB_CMD, PAGE_ID, read_reg16(), SYS_E_FLAG, and write_reg16().
Referenced by probe().
|
private |
Start automatic measurement.
Definition at line 339 of file ADIS16497.cpp.
References ADIS16497_DEFAULT_RATE, data_ready_interrupt(), and stop().
Referenced by init().
|
private |
Stop automatic measurement.
Definition at line 354 of file ADIS16497.cpp.
Referenced by start(), and ~ADIS16497().
|
private |
Definition at line 316 of file ADIS16497.cpp.
|
private |
Definition at line 325 of file ADIS16497.cpp.
References DIR_WRITE, and T_STALL.
Referenced by probe(), reset(), and self_test().
|
private |
Definition at line 105 of file ADIS16497.hpp.
Referenced by measure(), print_info(), and ~ADIS16497().
|
private |
Definition at line 101 of file ADIS16497.hpp.
Referenced by ADIS16497(), measure(), and print_info().
|
private |
Definition at line 102 of file ADIS16497.hpp.
Referenced by ADIS16497(), measure(), and print_info().
|
private |
Definition at line 104 of file ADIS16497.hpp.
Referenced by measure(), print_info(), and ~ADIS16497().