45 #include <semaphore.h> 51 #include <sys/types.h> 55 #include <arch/board/board.h> 56 #include <board_config.h> 64 #include <nuttx/arch.h> 65 #include <nuttx/clock.h> 67 #include <px4_platform_common/px4_config.h> 68 #include <px4_platform_common/defines.h> 69 #include <px4_platform_common/getopt.h> 70 #include <px4_platform_common/log.h> 71 #include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp> 74 #include "board_config.h" 76 #define MPL3115A2_REG_WHO_AM_I 0x0c 77 #define MPL3115A2_WHO_AM_I 0xC4 79 #define OUT_P_MSB 0x01 81 #define MPL3115A2_CTRL_REG1 0x26 82 # define CTRL_REG1_ALT (1 << 7) 83 # define CTRL_REG1_RAW (1 << 6) 84 # define CTRL_REG1_OS_SHIFTS (3) 85 # define CTRL_REG1_OS_MASK (0x7 << CTRL_REG1_OS_SHIFTS) 86 # define CTRL_REG1_OS(n) (((n)& 0x7) << CTRL_REG1_OS_SHIFTS) 87 # define CTRL_REG1_RST (1 << 2) 88 # define CTRL_REG1_OST (1 << 1) 89 # define CTRL_REG1_SBYB (1 << 0) 93 #define IOCTL_MEASURE 2 98 uint16_t
w[
sizeof(
q) /
sizeof(uint16_t)];
99 uint8_t
b[
sizeof(
q) /
sizeof(uint8_t)];
104 uint8_t
b[
sizeof(
w)];
High-resolution timer with callouts and timekeeping.
device::Device * MPL3115A2_sim_interface(uint8_t busnum)
Definitions for the generic base classes in the device framework.
union MPL3115A2_data_t::@1 temperature
union MPL3115A2_data_t::@0 pressure
uint8_t b[sizeof(q)/sizeof(uint8_t)]
Simple error/warning functions, heavily inspired by the BSD functions of the same names...
device::Device * MPL3115A2_i2c_interface(uint8_t busnum)
begin_packed_struct struct MPL3115A2_data_t MPL3115A2_data_t
Fundamental base class for all physical drivers (I2C, SPI).
uint16_t w[sizeof(q)/sizeof(uint16_t)]
Barometric pressure sensor driver interface.
Performance measuring tools.
Base class for devices connected via I2C.