44 #include <px4_platform_common/px4_config.h> 45 #include <px4_platform_common/defines.h> 46 #include <px4_platform_common/getopt.h> 47 #include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp> 59 #if defined PX4_SPI_BUS_EXPANSION // crazyflie 60 # define PAW3902_BUS PX4_SPI_BUS_EXPANSION 61 #elif defined PX4_SPI_BUS_EXTERNAL1 // fmu-v5 62 # define PAW3902_BUS PX4_SPI_BUS_EXTERNAL1 63 #elif defined PX4_SPI_BUS_EXTERNAL // fmu-v4 extspi 64 # define PAW3902_BUS PX4_SPI_BUS_EXTERNAL 66 # error "add the required spi bus from board_config.h here" 69 #if defined PX4_SPIDEV_EXPANSION_2 // crazyflie flow deck 70 # define PAW3902_SPIDEV PX4_SPIDEV_EXPANSION_2 71 #elif defined PX4_SPIDEV_EXTERNAL1_1 // fmu-v5 ext CS1 72 # define PAW3902_SPIDEV PX4_SPIDEV_EXTERNAL1_1 73 #elif defined PX4_SPIDEV_EXTERNAL // fmu-v4 extspi 74 # define PAW3902_SPIDEV PX4_SPIDEV_EXTERNAL 76 # error "add the required spi dev from board_config.h here" 79 #define PAW3902_SPI_BUS_SPEED (2000000L) // 2MHz 81 #define DIR_WRITE(a) ((a) | (1 << 7)) 82 #define DIR_READ(a) ((a) & 0x7f) 89 class PAW3902 :
public device::SPI,
public px4::ScheduledWorkItem
109 uint8_t registerRead(uint8_t reg);
110 void registerWrite(uint8_t reg, uint8_t
data);
116 bool modeSuperLowLight();
118 bool changeMode(
Mode newMode);
126 static constexpr uint64_t _collect_time{15000};
128 uint64_t _previous_collect_timestamp{0};
129 uint64_t _flow_dt_sum_usec{0};
130 unsigned _frame_count_since_last{0};
perf_counter_t _sample_perf
perf_counter_t _comms_errors
int reset(enum LPS22HB_BUS busid)
Reset the driver.
High-resolution timer with callouts and timekeeping.
Global flash based parameter store.
perf_counter_t _dupe_count_perf
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
void init()
Activates/configures the hardware registers.
Rotation
Enum for board and external compass rotations.
Performance measuring tools.