PX4 Firmware
PX4 Autopilot Software http://px4.io
MPL3115A2_I2C Class Reference
Inheritance diagram for MPL3115A2_I2C:
Collaboration diagram for MPL3115A2_I2C:

Public Member Functions

 MPL3115A2_I2C (uint8_t bus)
 
virtual ~MPL3115A2_I2C ()=default
 
virtual int init ()
 
virtual int read (unsigned offset, void *data, unsigned count)
 
virtual int ioctl (unsigned operation, unsigned &arg)
 

Protected Member Functions

virtual int probe ()
 

Private Member Functions

int _measure (unsigned addr)
 Send a measure command to the MPL3115A2. More...
 
int reg_read (uint8_t reg, void *data, unsigned count=1)
 
int reg_write (uint8_t reg, uint8_t data)
 
int reset ()
 

Detailed Description

Definition at line 46 of file mpl3115a2_i2c.cpp.

Constructor & Destructor Documentation

◆ MPL3115A2_I2C()

MPL3115A2_I2C::MPL3115A2_I2C ( uint8_t  bus)

Definition at line 80 of file mpl3115a2_i2c.cpp.

Referenced by MPL3115A2_i2c_interface().

Here is the caller graph for this function:

◆ ~MPL3115A2_I2C()

virtual MPL3115A2_I2C::~MPL3115A2_I2C ( )
virtualdefault

Member Function Documentation

◆ _measure()

int MPL3115A2_I2C::_measure ( unsigned  addr)
private

Send a measure command to the MPL3115A2.

Parameters
addrWhich address to use for the measure operation.

Definition at line 186 of file mpl3115a2_i2c.cpp.

References reg_write().

Referenced by ioctl().

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

◆ init()

int MPL3115A2_I2C::init ( )
virtual

Definition at line 86 of file mpl3115a2_i2c.cpp.

References ToneAlarmInterface::init(), and MPL3115A2_ADDRESS.

Here is the call graph for this function:

◆ ioctl()

int MPL3115A2_I2C::ioctl ( unsigned  operation,
unsigned &  arg 
)
virtual

Definition at line 147 of file mpl3115a2_i2c.cpp.

References _measure(), IOCTL_MEASURE, IOCTL_RESET, and reset().

Here is the call graph for this function:

◆ probe()

int MPL3115A2_I2C::probe ( )
protectedvirtual

Definition at line 168 of file mpl3115a2_i2c.cpp.

References MPL3115A2_REG_WHO_AM_I, MPL3115A2_WHO_AM_I, and reg_read().

Here is the call graph for this function:

◆ read()

int MPL3115A2_I2C::read ( unsigned  offset,
void *  data,
unsigned  count 
)
virtual

Definition at line 110 of file mpl3115a2_i2c.cpp.

References MPL3115A2_CTRL_REG1, OUT_P_MSB, and reg_read().

Here is the call graph for this function:

◆ reg_read()

int MPL3115A2_I2C::reg_read ( uint8_t  reg,
void *  data,
unsigned  count = 1 
)
private

Definition at line 197 of file mpl3115a2_i2c.cpp.

Referenced by probe(), read(), and reset().

Here is the caller graph for this function:

◆ reg_write()

int MPL3115A2_I2C::reg_write ( uint8_t  reg,
uint8_t  data 
)
private

Definition at line 204 of file mpl3115a2_i2c.cpp.

Referenced by _measure(), and reset().

Here is the caller graph for this function:

◆ reset()

int MPL3115A2_I2C::reset ( )
private

Definition at line 94 of file mpl3115a2_i2c.cpp.

References CTRL_REG1_RST, math::max(), MPL3115A2_CTRL_REG1, reg_read(), and reg_write().

Referenced by ioctl().

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

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