APM:Libraries
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AP_RangeFinder_VL53L0X Class Reference

#include <AP_RangeFinder_VL53L0X.h>

Inheritance diagram for AP_RangeFinder_VL53L0X:
[legend]
Collaboration diagram for AP_RangeFinder_VL53L0X:
[legend]

Classes

struct  RegData
 
struct  SequenceStepEnables
 
struct  SequenceStepTimeouts
 

Public Member Functions

void update (void)
 
- Public Member Functions inherited from AP_RangeFinder_Backend
 AP_RangeFinder_Backend (RangeFinder::RangeFinder_State &_state)
 
virtual ~AP_RangeFinder_Backend (void)
 
virtual void handle_msg (mavlink_message_t *msg)
 
void update_pre_arm_check ()
 
enum Rotation orientation () const
 
uint16_t distance_cm () const
 
uint16_t voltage_mv () const
 
int16_t max_distance_cm () const
 
int16_t min_distance_cm () const
 
int16_t ground_clearance_cm () const
 
MAV_DISTANCE_SENSOR get_mav_distance_sensor_type () const
 
RangeFinder::RangeFinder_Status status () const
 
RangeFinder::RangeFinder_Type type () const
 
bool has_data () const
 
uint8_t range_valid_count () const
 
const Vector3fget_pos_offset () const
 

Static Public Member Functions

static AP_RangeFinder_Backenddetect (RangeFinder::RangeFinder_State &_state, AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev)
 

Protected Member Functions

virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type () const override
 
- Protected Member Functions inherited from AP_RangeFinder_Backend
void update_status ()
 
void set_status (RangeFinder::RangeFinder_Status status)
 

Private Types

enum  vcselPeriodType { VcselPeriodPreRange, VcselPeriodFinalRange }
 

Private Member Functions

 AP_RangeFinder_VL53L0X (RangeFinder::RangeFinder_State &_state, AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev)
 
void init ()
 
void timer ()
 
bool check_id (void)
 
bool get_reading (uint16_t &reading_cm)
 
uint8_t read_register (uint8_t reg)
 
uint16_t read_register16 (uint8_t reg)
 
void write_register (uint8_t reg, uint8_t value)
 
void write_register16 (uint8_t reg, uint16_t value)
 
bool get_SPAD_info (uint8_t *count, bool *type_is_aperture)
 
void getSequenceStepEnables (SequenceStepEnables *enables)
 
uint32_t getMeasurementTimingBudget (void)
 
void getSequenceStepTimeouts (SequenceStepEnables const *enables, SequenceStepTimeouts *timeouts)
 
uint8_t getVcselPulsePeriod (vcselPeriodType type)
 
uint32_t timeoutMclksToMicroseconds (uint16_t timeout_period_mclks, uint8_t vcsel_period_pclks)
 
uint16_t decodeTimeout (uint16_t reg_val)
 
bool setMeasurementTimingBudget (uint32_t budget_us)
 
uint32_t timeoutMicrosecondsToMclks (uint32_t timeout_period_us, uint8_t vcsel_period_pclks)
 
uint16_t encodeTimeout (uint16_t timeout_mclks)
 
bool performSingleRefCalibration (uint8_t vhv_init_byte)
 
void start_continuous (void)
 

Private Attributes

AP_HAL::OwnPtr< AP_HAL::I2CDevicedev
 
uint8_t stop_variable
 
uint32_t measurement_timing_budget_us
 
uint32_t start_ms
 
uint32_t sum_mm
 
uint32_t counter
 

Static Private Attributes

static const RegData tuning_data []
 

Additional Inherited Members

- Protected Attributes inherited from AP_RangeFinder_Backend
RangeFinder::RangeFinder_Statestate
 
AP_HAL::Semaphore_sem
 

Detailed Description

Definition at line 7 of file AP_RangeFinder_VL53L0X.h.

Member Enumeration Documentation

◆ vcselPeriodType

Enumerator
VcselPeriodPreRange 
VcselPeriodFinalRange 

Definition at line 61 of file AP_RangeFinder_VL53L0X.h.

Constructor & Destructor Documentation

◆ AP_RangeFinder_VL53L0X()

AP_RangeFinder_VL53L0X::AP_RangeFinder_VL53L0X ( RangeFinder::RangeFinder_State _state,
AP_HAL::OwnPtr< AP_HAL::I2CDevice dev 
)
private

Definition at line 219 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by _get_mav_distance_sensor_type(), and detect().

Here is the caller graph for this function:

Member Function Documentation

◆ _get_mav_distance_sensor_type()

virtual MAV_DISTANCE_SENSOR AP_RangeFinder_VL53L0X::_get_mav_distance_sensor_type ( ) const
inlineoverrideprotectedvirtual

Implements AP_RangeFinder_Backend.

Definition at line 19 of file AP_RangeFinder_VL53L0X.h.

Here is the call graph for this function:

◆ check_id()

bool AP_RangeFinder_VL53L0X::check_id ( void  )
private

Definition at line 257 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by _get_mav_distance_sensor_type(), and detect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decodeTimeout()

uint16_t AP_RangeFinder_VL53L0X::decodeTimeout ( uint16_t  reg_val)
private

Definition at line 357 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by getSequenceStepTimeouts().

Here is the caller graph for this function:

◆ detect()

AP_RangeFinder_Backend * AP_RangeFinder_VL53L0X::detect ( RangeFinder::RangeFinder_State _state,
AP_HAL::OwnPtr< AP_HAL::I2CDevice dev 
)
static

Definition at line 229 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by RangeFinder::detect_instance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encodeTimeout()

uint16_t AP_RangeFinder_VL53L0X::encodeTimeout ( uint16_t  timeout_mclks)
private

Definition at line 455 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by setMeasurementTimingBudget().

Here is the caller graph for this function:

◆ get_reading()

bool AP_RangeFinder_VL53L0X::get_reading ( uint16_t &  reading_cm)
private

Definition at line 722 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by _get_mav_distance_sensor_type(), and timer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_SPAD_info()

bool AP_RangeFinder_VL53L0X::get_SPAD_info ( uint8_t *  count,
bool *  type_is_aperture 
)
private

Definition at line 273 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMeasurementTimingBudget()

uint32_t AP_RangeFinder_VL53L0X::getMeasurementTimingBudget ( void  )
private

Definition at line 401 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSequenceStepEnables()

void AP_RangeFinder_VL53L0X::getSequenceStepEnables ( SequenceStepEnables enables)
private

Definition at line 319 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by getMeasurementTimingBudget(), and setMeasurementTimingBudget().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSequenceStepTimeouts()

void AP_RangeFinder_VL53L0X::getSequenceStepTimeouts ( SequenceStepEnables const *  enables,
SequenceStepTimeouts timeouts 
)
private

Definition at line 368 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by getMeasurementTimingBudget(), and setMeasurementTimingBudget().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVcselPulsePeriod()

uint8_t AP_RangeFinder_VL53L0X::getVcselPulsePeriod ( vcselPeriodType  type)
private

Definition at line 332 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by getSequenceStepTimeouts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void AP_RangeFinder_VL53L0X::init ( void  )
private

Definition at line 559 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by _get_mav_distance_sensor_type(), and detect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ performSingleRefCalibration()

bool AP_RangeFinder_VL53L0X::performSingleRefCalibration ( uint8_t  vhv_init_byte)
private

Definition at line 684 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_register()

uint8_t AP_RangeFinder_VL53L0X::read_register ( uint8_t  reg)
private

Definition at line 750 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by get_reading(), get_SPAD_info(), getSequenceStepEnables(), getSequenceStepTimeouts(), getVcselPulsePeriod(), init(), and performSingleRefCalibration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_register16()

uint16_t AP_RangeFinder_VL53L0X::read_register16 ( uint8_t  reg)
private

Definition at line 757 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by get_reading(), and getSequenceStepTimeouts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMeasurementTimingBudget()

bool AP_RangeFinder_VL53L0X::setMeasurementTimingBudget ( uint32_t  budget_us)
private

Definition at line 482 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_continuous()

void AP_RangeFinder_VL53L0X::start_continuous ( void  )
private

Definition at line 705 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by get_reading(), and init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeoutMclksToMicroseconds()

uint32_t AP_RangeFinder_VL53L0X::timeoutMclksToMicroseconds ( uint16_t  timeout_period_mclks,
uint8_t  vcsel_period_pclks 
)
private

Definition at line 345 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by getSequenceStepTimeouts().

Here is the caller graph for this function:

◆ timeoutMicrosecondsToMclks()

uint32_t AP_RangeFinder_VL53L0X::timeoutMicrosecondsToMclks ( uint32_t  timeout_period_us,
uint8_t  vcsel_period_pclks 
)
private

Definition at line 444 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by setMeasurementTimingBudget().

Here is the caller graph for this function:

◆ timer()

void AP_RangeFinder_VL53L0X::timer ( void  )
private

Definition at line 779 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by _get_mav_distance_sensor_type(), and init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void AP_RangeFinder_VL53L0X::update ( void  )
virtual

Implements AP_RangeFinder_Backend.

Definition at line 767 of file AP_RangeFinder_VL53L0X.cpp.

Here is the call graph for this function:

◆ write_register()

void AP_RangeFinder_VL53L0X::write_register ( uint8_t  reg,
uint8_t  value 
)
private

Definition at line 745 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by get_reading(), get_SPAD_info(), init(), performSingleRefCalibration(), and start_continuous().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_register16()

void AP_RangeFinder_VL53L0X::write_register16 ( uint8_t  reg,
uint16_t  value 
)
private

Definition at line 739 of file AP_RangeFinder_VL53L0X.cpp.

Referenced by init(), and setMeasurementTimingBudget().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ counter

uint32_t AP_RangeFinder_VL53L0X::counter
private

Definition at line 81 of file AP_RangeFinder_VL53L0X.h.

Referenced by timer(), and update().

◆ dev

AP_HAL::OwnPtr<AP_HAL::I2CDevice> AP_RangeFinder_VL53L0X::dev
private

◆ measurement_timing_budget_us

uint32_t AP_RangeFinder_VL53L0X::measurement_timing_budget_us
private

◆ start_ms

uint32_t AP_RangeFinder_VL53L0X::start_ms
private

Definition at line 78 of file AP_RangeFinder_VL53L0X.h.

Referenced by get_reading(), and start_continuous().

◆ stop_variable

uint8_t AP_RangeFinder_VL53L0X::stop_variable
private

Definition at line 76 of file AP_RangeFinder_VL53L0X.h.

Referenced by init(), and start_continuous().

◆ sum_mm

uint32_t AP_RangeFinder_VL53L0X::sum_mm
private

Definition at line 80 of file AP_RangeFinder_VL53L0X.h.

Referenced by timer(), and update().

◆ tuning_data

const AP_RangeFinder_VL53L0X::RegData AP_RangeFinder_VL53L0X::tuning_data
staticprivate

Definition at line 59 of file AP_RangeFinder_VL53L0X.h.

Referenced by init().


The documentation for this class was generated from the following files: