45 #include <px4_platform_common/getopt.h> 46 #include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp> 49 class FXAS21002C :
public device::SPI,
public px4::ScheduledWorkItem
147 void write_reg(
unsigned reg, uint8_t value);
158 void modify_reg(
unsigned reg, uint8_t clearbits, uint8_t setbits);
FXAS21002C(int bus, uint32_t device, enum Rotation rotation)
void test_error()
deliberately trigger an error
void modify_reg(unsigned reg, uint8_t clearbits, uint8_t setbits)
Modify a register in the FXAS21002C.
void start()
Start automatic measurement.
void set_standby(int rate, bool standby_true)
Put the chip In stand by.
void print_registers()
dump register values
void check_registers(void)
check key registers for correct values
Namespace encapsulating all device framework classes, functions and data.
void write_reg(unsigned reg, uint8_t value)
Write a register in the FXAS21002C.
perf_counter_t _sample_perf
uint8_t read_reg(unsigned reg)
Read a register from the FXAS21002C.
void stop()
Stop automatic measurement.
Rotation
Enum for board and external compass rotations.
perf_counter_t _bad_registers
void set_onchip_lowpass_filter(int frequency_hz)
int set_range(unsigned max_dps)
Set the FXAS21002C measurement range.
void measure()
Fetch accel measurements from the sensor and update the report ring.
uint8_t _checked_values[FXAS21002C_NUM_CHECKED_REGISTERS]
int set_samplerate(unsigned frequency)
Set the FXAS21002C internal sampling frequency.
void print_info()
Diagnostics - print some basic information about the driver.
perf_counter_t _duplicates
void write_checked_reg(unsigned reg, uint8_t value)
Write a register in the FXAS21002C, updating _checked_values.
static constexpr int FXAS21002C_NUM_CHECKED_REGISTERS
Performance measuring tools.