APM:Libraries
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
AP_Airspeed_MS5525 Class Reference

#include <AP_Airspeed_MS5525.h>

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

Public Types

enum  MS5525_ADDR { MS5525_ADDR_1 = 0, MS5525_ADDR_2 = 1, MS5525_ADDR_AUTO = 255 }
 

Public Member Functions

 AP_Airspeed_MS5525 (AP_Airspeed &frontend, uint8_t _instance, MS5525_ADDR address)
 
 ~AP_Airspeed_MS5525 (void)
 
bool init () override
 
bool get_differential_pressure (float &pressure) override
 
bool get_temperature (float &temperature) override
 
- Public Member Functions inherited from AP_Airspeed_Backend
 AP_Airspeed_Backend (AP_Airspeed &frontend, uint8_t instance)
 
virtual ~AP_Airspeed_Backend ()
 

Private Member Functions

void measure ()
 
void collect ()
 
void timer ()
 
bool read_prom (void)
 
uint16_t crc4_prom (void)
 
int32_t read_adc ()
 
void calculate ()
 

Private Attributes

float pressure
 
float temperature
 
float temperature_sum
 
float pressure_sum
 
uint32_t temp_count
 
uint32_t press_count
 
uint32_t last_sample_time_ms
 
uint16_t prom [8]
 
uint8_t state
 
int32_t D1
 
int32_t D2
 
uint32_t command_send_us
 
bool ignore_next
 
uint8_t cmd_sent
 
MS5525_ADDR _address
 
AP_HAL::OwnPtr< AP_HAL::I2CDevicedev
 

Additional Inherited Members

- Protected Member Functions inherited from AP_Airspeed_Backend
int8_t get_pin (void) const
 
float get_psi_range (void) const
 
uint8_t get_bus (void) const
 
AP_Airspeed::pitot_tube_order get_tube_order (void) const
 
float get_airspeed_ratio (void) const
 
void set_use_zero_offset (void)
 
void set_skip_cal (void)
 
void set_offset (float ofs)
 
- Protected Attributes inherited from AP_Airspeed_Backend
AP_HAL::Semaphoresem
 

Detailed Description

Definition at line 30 of file AP_Airspeed_MS5525.h.

Member Enumeration Documentation

◆ MS5525_ADDR

Enumerator
MS5525_ADDR_1 
MS5525_ADDR_2 
MS5525_ADDR_AUTO 

Definition at line 33 of file AP_Airspeed_MS5525.h.

Constructor & Destructor Documentation

◆ AP_Airspeed_MS5525()

AP_Airspeed_MS5525::AP_Airspeed_MS5525 ( AP_Airspeed frontend,
uint8_t  _instance,
MS5525_ADDR  address 
)

Definition at line 54 of file AP_Airspeed_MS5525.cpp.

◆ ~AP_Airspeed_MS5525()

AP_Airspeed_MS5525::~AP_Airspeed_MS5525 ( void  )
inline

Definition at line 40 of file AP_Airspeed_MS5525.h.

Here is the call graph for this function:

Member Function Documentation

◆ calculate()

void AP_Airspeed_MS5525::calculate ( void  )
private

Definition at line 194 of file AP_Airspeed_MS5525.cpp.

Referenced by timer(), and ~AP_Airspeed_MS5525().

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

◆ collect()

void AP_Airspeed_MS5525::collect ( )
private

Referenced by ~AP_Airspeed_MS5525().

Here is the caller graph for this function:

◆ crc4_prom()

uint16_t AP_Airspeed_MS5525::crc4_prom ( void  )
private

CRC used by MS pressure devices

Definition at line 114 of file AP_Airspeed_MS5525.cpp.

Referenced by read_prom(), and ~AP_Airspeed_MS5525().

Here is the caller graph for this function:

◆ get_differential_pressure()

bool AP_Airspeed_MS5525::get_differential_pressure ( float &  pressure)
overridevirtual

Implements AP_Airspeed_Backend.

Definition at line 285 of file AP_Airspeed_MS5525.cpp.

Referenced by ~AP_Airspeed_MS5525().

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

◆ get_temperature()

bool AP_Airspeed_MS5525::get_temperature ( float &  temperature)
overridevirtual

Implements AP_Airspeed_Backend.

Definition at line 303 of file AP_Airspeed_MS5525.cpp.

Referenced by ~AP_Airspeed_MS5525().

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

◆ init()

bool AP_Airspeed_MS5525::init ( void  )
overridevirtual

Implements AP_Airspeed_Backend.

Definition at line 61 of file AP_Airspeed_MS5525.cpp.

Referenced by ~AP_Airspeed_MS5525().

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

◆ measure()

void AP_Airspeed_MS5525::measure ( )
private

Referenced by ~AP_Airspeed_MS5525().

Here is the caller graph for this function:

◆ read_adc()

int32_t AP_Airspeed_MS5525::read_adc ( )
private

Definition at line 182 of file AP_Airspeed_MS5525.cpp.

Referenced by timer(), and ~AP_Airspeed_MS5525().

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

◆ read_prom()

bool AP_Airspeed_MS5525::read_prom ( void  )
private

Definition at line 139 of file AP_Airspeed_MS5525.cpp.

Referenced by init(), and ~AP_Airspeed_MS5525().

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

◆ timer()

void AP_Airspeed_MS5525::timer ( )
private

Definition at line 232 of file AP_Airspeed_MS5525.cpp.

Referenced by init(), and ~AP_Airspeed_MS5525().

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

Member Data Documentation

◆ _address

MS5525_ADDR AP_Airspeed_MS5525::_address
private

Definition at line 76 of file AP_Airspeed_MS5525.h.

Referenced by AP_Airspeed_MS5525(), and init().

◆ cmd_sent

uint8_t AP_Airspeed_MS5525::cmd_sent
private

Definition at line 75 of file AP_Airspeed_MS5525.h.

Referenced by timer().

◆ command_send_us

uint32_t AP_Airspeed_MS5525::command_send_us
private

Definition at line 73 of file AP_Airspeed_MS5525.h.

Referenced by init(), and timer().

◆ D1

int32_t AP_Airspeed_MS5525::D1
private

Definition at line 71 of file AP_Airspeed_MS5525.h.

Referenced by calculate(), and timer().

◆ D2

int32_t AP_Airspeed_MS5525::D2
private

Definition at line 72 of file AP_Airspeed_MS5525.h.

Referenced by calculate(), and timer().

◆ dev

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

Definition at line 78 of file AP_Airspeed_MS5525.h.

Referenced by init(), read_adc(), read_prom(), and timer().

◆ ignore_next

bool AP_Airspeed_MS5525::ignore_next
private

Definition at line 74 of file AP_Airspeed_MS5525.h.

Referenced by timer().

◆ last_sample_time_ms

uint32_t AP_Airspeed_MS5525::last_sample_time_ms
private

Definition at line 67 of file AP_Airspeed_MS5525.h.

Referenced by calculate(), get_differential_pressure(), and get_temperature().

◆ press_count

uint32_t AP_Airspeed_MS5525::press_count
private

Definition at line 65 of file AP_Airspeed_MS5525.h.

Referenced by calculate(), and get_differential_pressure().

◆ pressure

float AP_Airspeed_MS5525::pressure
private

Definition at line 60 of file AP_Airspeed_MS5525.h.

Referenced by get_differential_pressure(), and ~AP_Airspeed_MS5525().

◆ pressure_sum

float AP_Airspeed_MS5525::pressure_sum
private

Definition at line 63 of file AP_Airspeed_MS5525.h.

Referenced by calculate(), and get_differential_pressure().

◆ prom

uint16_t AP_Airspeed_MS5525::prom[8]
private

Definition at line 69 of file AP_Airspeed_MS5525.h.

Referenced by calculate(), crc4_prom(), and read_prom().

◆ state

uint8_t AP_Airspeed_MS5525::state
private

Definition at line 70 of file AP_Airspeed_MS5525.h.

Referenced by init(), and timer().

◆ temp_count

uint32_t AP_Airspeed_MS5525::temp_count
private

Definition at line 64 of file AP_Airspeed_MS5525.h.

Referenced by calculate(), and get_temperature().

◆ temperature

float AP_Airspeed_MS5525::temperature
private

Definition at line 61 of file AP_Airspeed_MS5525.h.

Referenced by get_temperature(), and ~AP_Airspeed_MS5525().

◆ temperature_sum

float AP_Airspeed_MS5525::temperature_sum
private

Definition at line 62 of file AP_Airspeed_MS5525.h.

Referenced by calculate(), and get_temperature().


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