45 #include <px4_workqueue.h> 49 #include <drivers/device/i2c.h> 53 #include <uORB/topics/distance_sensor.h> 57 #define LL40LS_BASEADDR 0x62 58 #define LL40LS_BASEADDR_OLD 0x42 62 #define LL40LS_MEASURE_REG 0x00 63 #define LL40LS_MSRREG_RESET 0x00 64 #define LL40LS_MSRREG_ACQUIRE 0x04 65 #define LL40LS_DISTHIGH_REG 0x0F 66 #define LL40LS_AUTO_INCREMENT 0x80 67 #define LL40LS_HW_VERSION 0x41 68 #define LL40LS_SW_VERSION 0x4f 69 #define LL40LS_SIGNAL_STRENGTH_REG 0x0e 70 #define LL40LS_PEAK_STRENGTH_REG 0x0c 71 #define LL40LS_UNIT_ID_HIGH 0x16 72 #define LL40LS_UNIT_ID_LOW 0x17 74 #define LL40LS_SIG_COUNT_VAL_REG 0x02 75 #define LL40LS_SIG_COUNT_VAL_MAX 0xFF 77 #define LL40LS_SIGNAL_STRENGTH_LOW 24 // Minimum (relative) signal strength value for accepting a measurement 78 #define LL40LS_PEAK_STRENGTH_LOW 135 // Minimum peak strength raw value for accepting a measurement 79 #define LL40LS_PEAK_STRENGTH_HIGH 234 // Max peak strength raw value 85 uint8_t rotation = distance_sensor_s::ROTATION_DOWNWARD_FACING,
86 int address = LL40LS_BASEADDR);
92 int ioctl(
device::file_t *filp,
int cmd,
unsigned long arg)
override;
104 const char *get_dev_name()
override;
107 int probe()
override;
108 int read_reg(uint8_t reg, uint8_t &val);
109 int write_reg(uint8_t reg, uint8_t val);
111 int measure()
override;
112 int reset_sensor()
override;
117 ringbuffer::RingBuffer *_reports;
121 int _orb_class_instance;
129 uint16_t _last_distance;
130 uint16_t _zero_counter;
131 uint64_t _acquire_time_usec;
132 volatile bool _pause_measurements;
148 int lidar_transfer(
const uint8_t *send,
unsigned send_len, uint8_t *recv,
unsigned recv_len);
157 int probe_address(uint8_t address);
165 void start()
override;
170 void stop()
override;
177 int collect()
override;
185 static void cycle_trampoline(
void *arg);
A flexible ringbuffer class.
Definition: LidarLiteI2C.h:81
void print_info() override
Diagnostics - print some basic information about the driver.
Definition: LidarLiteI2C.cpp:645
Definition: LidarLite.h:57
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
Definition: uORB.h:134
void print_registers() override
print registers to console
Definition: LidarLiteI2C.cpp:372
API for the uORB lightweight object broker.
Definition: cdev_platform.hpp:20
Definition: video_device.h:50
Performance measuring tools.