PX4 Firmware
PX4 Autopilot Software http://px4.io
mpl3115a2.h File Reference

Shared defines for the mpl3115a2 driver. More...

#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
#include <semaphore.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <math.h>
#include <unistd.h>
#include <arch/board/board.h>
#include <board_config.h>
#include <drivers/device/device.h>
#include <drivers/device/Device.hpp>
#include <drivers/device/i2c.h>
#include <drivers/device/ringbuffer.h>
#include <drivers/drv_baro.h>
#include <drivers/drv_hrt.h>
#include <lib/cdev/CDev.hpp>
#include <nuttx/arch.h>
#include <nuttx/clock.h>
#include <perf/perf_counter.h>
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/getopt.h>
#include <px4_platform_common/log.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <systemlib/err.h>
Include dependency graph for mpl3115a2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MPL3115A2_data_t
 

Macros

#define MPL3115A2_REG_WHO_AM_I   0x0c
 
#define MPL3115A2_WHO_AM_I   0xC4
 
#define OUT_P_MSB   0x01
 
#define MPL3115A2_CTRL_REG1   0x26
 
#define CTRL_REG1_ALT   (1 << 7)
 
#define CTRL_REG1_RAW   (1 << 6)
 
#define CTRL_REG1_OS_SHIFTS   (3)
 
#define CTRL_REG1_OS_MASK   (0x7 << CTRL_REG1_OS_SHIFTS)
 
#define CTRL_REG1_OS(n)   (((n)& 0x7) << CTRL_REG1_OS_SHIFTS)
 
#define CTRL_REG1_RST   (1 << 2)
 
#define CTRL_REG1_OST   (1 << 1)
 
#define CTRL_REG1_SBYB   (1 << 0)
 
#define IOCTL_RESET   1
 
#define IOCTL_MEASURE   2
 

Typedefs

typedef begin_packed_struct struct MPL3115A2_data_t MPL3115A2_data_t
 
typedef device::Device *(* MPL3115A2_constructor) (uint8_t busnum)
 

Functions

device::DeviceMPL3115A2_i2c_interface (uint8_t busnum)
 
device::DeviceMPL3115A2_sim_interface (uint8_t busnum)
 

Detailed Description

Shared defines for the mpl3115a2 driver.

Definition in file mpl3115a2.h.

Macro Definition Documentation

◆ CTRL_REG1_ALT

#define CTRL_REG1_ALT   (1 << 7)

Definition at line 82 of file mpl3115a2.h.

◆ CTRL_REG1_OS

#define CTRL_REG1_OS (   n)    (((n)& 0x7) << CTRL_REG1_OS_SHIFTS)

Definition at line 86 of file mpl3115a2.h.

◆ CTRL_REG1_OS_MASK

#define CTRL_REG1_OS_MASK   (0x7 << CTRL_REG1_OS_SHIFTS)

Definition at line 85 of file mpl3115a2.h.

◆ CTRL_REG1_OS_SHIFTS

#define CTRL_REG1_OS_SHIFTS   (3)

Definition at line 84 of file mpl3115a2.h.

◆ CTRL_REG1_OST

#define CTRL_REG1_OST   (1 << 1)

Definition at line 88 of file mpl3115a2.h.

Referenced by MPL3115A2::collect().

◆ CTRL_REG1_RAW

#define CTRL_REG1_RAW   (1 << 6)

Definition at line 83 of file mpl3115a2.h.

◆ CTRL_REG1_RST

#define CTRL_REG1_RST   (1 << 2)

Definition at line 87 of file mpl3115a2.h.

Referenced by MPL3115A2_I2C::reset().

◆ CTRL_REG1_SBYB

#define CTRL_REG1_SBYB   (1 << 0)

Definition at line 89 of file mpl3115a2.h.

◆ IOCTL_MEASURE

#define IOCTL_MEASURE   2

◆ IOCTL_RESET

#define IOCTL_RESET   1

◆ MPL3115A2_CTRL_REG1

#define MPL3115A2_CTRL_REG1   0x26

◆ MPL3115A2_REG_WHO_AM_I

#define MPL3115A2_REG_WHO_AM_I   0x0c

Definition at line 76 of file mpl3115a2.h.

Referenced by MPL3115A2_I2C::probe().

◆ MPL3115A2_WHO_AM_I

#define MPL3115A2_WHO_AM_I   0xC4

Definition at line 77 of file mpl3115a2.h.

Referenced by MPL3115A2_I2C::probe().

◆ OUT_P_MSB

#define OUT_P_MSB   0x01

Definition at line 79 of file mpl3115a2.h.

Referenced by MPL3115A2::collect(), and MPL3115A2_I2C::read().

Typedef Documentation

◆ MPL3115A2_constructor

typedef device::Device*(* MPL3115A2_constructor) (uint8_t busnum)

Definition at line 111 of file mpl3115a2.h.

◆ MPL3115A2_data_t

typedef begin_packed_struct struct MPL3115A2_data_t MPL3115A2_data_t

Function Documentation

◆ MPL3115A2_i2c_interface()

device::Device * MPL3115A2_i2c_interface ( uint8_t  busnum)

Definition at line 75 of file mpl3115a2_i2c.cpp.

References MPL3115A2_I2C::MPL3115A2_I2C().

Here is the call graph for this function:

◆ MPL3115A2_sim_interface()

device::Device* MPL3115A2_sim_interface ( uint8_t  busnum)