APM:Libraries
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
AP_Baro_ICM20789 Class Reference

#include <AP_Baro_ICM20789.h>

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

Public Member Functions

void update ()
 
- Public Member Functions inherited from AP_Baro_Backend
 AP_Baro_Backend (AP_Baro &baro)
 
virtual ~AP_Baro_Backend (void)
 
virtual void accumulate (void)
 
virtual void handle_baro_msg (float pressure, float temperature)
 
void backend_update (uint8_t instance)
 
bool pressure_ok (float press)
 
uint32_t get_error_count () const
 

Static Public Member Functions

static AP_Baro_Backendprobe (AP_Baro &baro, AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev, AP_HAL::OwnPtr< AP_HAL::Device > dev_imu)
 

Private Member Functions

 AP_Baro_ICM20789 (AP_Baro &baro, AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev, AP_HAL::OwnPtr< AP_HAL::Device > dev_imu)
 
bool init ()
 
bool send_cmd16 (uint16_t cmd)
 
bool read_calibration_data (void)
 
void convert_data (uint32_t Praw, uint32_t Traw)
 
void calculate_conversion_constants (const float p_Pa[3], const float p_LUT[3], float &A, float &B, float &C)
 
float get_pressure (uint32_t p_LSB, uint32_t T_LSB)
 
bool imu_spi_init (void)
 
bool imu_i2c_init (void)
 
void timer (void)
 

Private Attributes

int16_t sensor_constants [4]
 
uint8_t instance
 
AP_HAL::OwnPtr< AP_HAL::I2CDevicedev
 
AP_HAL::OwnPtr< AP_HAL::Devicedev_imu
 
uint32_t last_measure_us
 
struct {
   float   tsum
 
   float   psum
 
   uint32_t   count
 
accum
 
const float p_Pa_calib [3] = {45000.0, 80000.0, 105000.0}
 
const float LUT_lower = 3.5 * (1U<<20)
 
const float LUT_upper = 11.5 * (1U<<20)
 
const float quadr_factor = 1 / 16777216.0
 
const float offst_factor = 2048.0
 

Additional Inherited Members

- Protected Member Functions inherited from AP_Baro_Backend
void _copy_to_frontend (uint8_t instance, float pressure, float temperature)
 
virtual void update_healthy_flag (uint8_t instance)
 
- Protected Attributes inherited from AP_Baro_Backend
AP_Baro_frontend
 
AP_HAL::Semaphore_sem
 
float _mean_pressure
 
uint32_t _error_count
 

Detailed Description

Definition at line 15 of file AP_Baro_ICM20789.h.

Constructor & Destructor Documentation

◆ AP_Baro_ICM20789()

AP_Baro_ICM20789::AP_Baro_ICM20789 ( AP_Baro baro,
AP_HAL::OwnPtr< AP_HAL::I2CDevice dev,
AP_HAL::OwnPtr< AP_HAL::Device dev_imu 
)
private

Definition at line 68 of file AP_Baro_ICM20789.cpp.

Referenced by probe().

Here is the caller graph for this function:

Member Function Documentation

◆ calculate_conversion_constants()

void AP_Baro_ICM20789::calculate_conversion_constants ( const float  p_Pa[3],
const float  p_LUT[3],
float &  A,
float &  B,
float &  C 
)
private

Definition at line 257 of file AP_Baro_ICM20789.cpp.

Referenced by get_pressure().

Here is the caller graph for this function:

◆ convert_data()

void AP_Baro_ICM20789::convert_data ( uint32_t  Praw,
uint32_t  Traw 
)
private

Definition at line 296 of file AP_Baro_ICM20789.cpp.

Referenced by timer().

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

◆ get_pressure()

float AP_Baro_ICM20789::get_pressure ( uint32_t  p_LSB,
uint32_t  T_LSB 
)
private

Definition at line 276 of file AP_Baro_ICM20789.cpp.

Referenced by convert_data().

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

◆ imu_i2c_init()

bool AP_Baro_ICM20789::imu_i2c_init ( void  )
private

Definition at line 141 of file AP_Baro_ICM20789.cpp.

Referenced by init().

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

◆ imu_spi_init()

bool AP_Baro_ICM20789::imu_spi_init ( void  )
private

Definition at line 95 of file AP_Baro_ICM20789.cpp.

Referenced by init().

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

◆ init()

bool AP_Baro_ICM20789::init ( void  )
private

Definition at line 167 of file AP_Baro_ICM20789.cpp.

Referenced by probe().

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

◆ probe()

AP_Baro_Backend * AP_Baro_ICM20789::probe ( AP_Baro baro,
AP_HAL::OwnPtr< AP_HAL::I2CDevice dev,
AP_HAL::OwnPtr< AP_HAL::Device dev_imu 
)
static

Definition at line 75 of file AP_Baro_ICM20789.cpp.

Referenced by AP_Baro::init().

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

◆ read_calibration_data()

bool AP_Baro_ICM20789::read_calibration_data ( void  )
private

Definition at line 233 of file AP_Baro_ICM20789.cpp.

Referenced by init().

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

◆ send_cmd16()

bool AP_Baro_ICM20789::send_cmd16 ( uint16_t  cmd)
private

Definition at line 227 of file AP_Baro_ICM20789.cpp.

Referenced by init(), read_calibration_data(), and timer().

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

◆ timer()

void AP_Baro_ICM20789::timer ( void  )
private

Definition at line 323 of file AP_Baro_ICM20789.cpp.

Referenced by init().

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

◆ update()

void AP_Baro_ICM20789::update ( void  )
virtual

Implements AP_Baro_Backend.

Definition at line 343 of file AP_Baro_ICM20789.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ accum

struct { ... } AP_Baro_ICM20789::accum

Referenced by convert_data(), and update().

◆ count

uint32_t AP_Baro_ICM20789::count

Definition at line 56 of file AP_Baro_ICM20789.h.

◆ dev

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

Definition at line 46 of file AP_Baro_ICM20789.h.

Referenced by imu_i2c_init(), init(), read_calibration_data(), send_cmd16(), and timer().

◆ dev_imu

AP_HAL::OwnPtr<AP_HAL::Device> AP_Baro_ICM20789::dev_imu
private

Definition at line 47 of file AP_Baro_ICM20789.h.

Referenced by imu_i2c_init(), imu_spi_init(), and init().

◆ instance

uint8_t AP_Baro_ICM20789::instance
private

Definition at line 44 of file AP_Baro_ICM20789.h.

Referenced by init(), and update().

◆ last_measure_us

uint32_t AP_Baro_ICM20789::last_measure_us
private

Definition at line 50 of file AP_Baro_ICM20789.h.

Referenced by timer().

◆ LUT_lower

const float AP_Baro_ICM20789::LUT_lower = 3.5 * (1U<<20)
private

Definition at line 62 of file AP_Baro_ICM20789.h.

Referenced by get_pressure().

◆ LUT_upper

const float AP_Baro_ICM20789::LUT_upper = 11.5 * (1U<<20)
private

Definition at line 63 of file AP_Baro_ICM20789.h.

Referenced by get_pressure().

◆ offst_factor

const float AP_Baro_ICM20789::offst_factor = 2048.0
private

Definition at line 65 of file AP_Baro_ICM20789.h.

Referenced by get_pressure().

◆ p_Pa_calib

const float AP_Baro_ICM20789::p_Pa_calib[3] = {45000.0, 80000.0, 105000.0}
private

Definition at line 61 of file AP_Baro_ICM20789.h.

Referenced by get_pressure().

◆ psum

float AP_Baro_ICM20789::psum

Definition at line 55 of file AP_Baro_ICM20789.h.

◆ quadr_factor

const float AP_Baro_ICM20789::quadr_factor = 1 / 16777216.0
private

Definition at line 64 of file AP_Baro_ICM20789.h.

Referenced by get_pressure().

◆ sensor_constants

int16_t AP_Baro_ICM20789::sensor_constants[4]
private

Definition at line 42 of file AP_Baro_ICM20789.h.

Referenced by get_pressure(), and read_calibration_data().

◆ tsum

float AP_Baro_ICM20789::tsum

Definition at line 54 of file AP_Baro_ICM20789.h.


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