Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mpl3115.h File Reference

Driver for the baro MPL3115A2 from Freescale (i2c) More...

#include "std.h"
#include "math/pprz_algebra_int.h"
#include "mcu_periph/i2c.h"
+ Include dependency graph for mpl3115.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MPL3115_I2C_ADDR   0xC0
 
#define MPL3115_I2C_DEV   i2c0
 
#define MPL3115_REG_STATUS   0x00
 
#define MPL3115_REG_OUT_P_MSB   0x01
 
#define MPL3115_REG_OUT_P_CSB   0x02
 
#define MPL3115_REG_OUT_P_LSB   0x03
 
#define MPL3115_REG_OUT_T_MSB   0x04
 
#define MPL3115_REG_OUT_T_LSB   0x05
 
#define MPL3115_REG_WHO_AM_I   0x0C
 
#define MPL3115_REG_PT_DATA_CFG   0x13
 
#define MPL3115_REG_CTRL_REG1   0x26
 
#define MPL3115_REG_CTRL_REG2   0x27
 
#define MPL3115_REG_CTRL_REG3   0x28
 
#define MPL3115_REG_CTRL_REG4   0x29
 
#define MPL3115_REG_CTRL_REG5   0x2A
 
#define MPL3115_OST_BIT   (1<<1)
 
#define MPL3115_PT_DATA_CFG   0x2
 
#define MPL3115_OVERSAMPLING   0x5
 
#define MPL3115_RAW_OUTPUT   0x0
 
#define MPL3115_ALT_MODE   0x1
 
#define MPL3115_CTRL_REG1   ((MPL3115_OVERSAMPLING<<3)|(MPL3115_RAW_OUTPUT<<6)|(MPL3115_ALT_MODE<<7))
 
#define Mpl3115Periodic()
 

Functions

void mpl3115_init (void)
 
void mpl3115_configure (void)
 
void mpl3115_read (void)
 
void mpl3115_event (void)
 

Variables

bool_t mpl3115_initialized
 
volatile bool_t mpl3115_data_available
 
uint32_t mpl3115_pressure
 
int16_t mpl3115_temperature
 
float mpl3115_alt
 

Detailed Description

Driver for the baro MPL3115A2 from Freescale (i2c)

Definition in file mpl3115.h.

Macro Definition Documentation

#define MPL3115_ALT_MODE   0x1

Definition at line 70 of file mpl3115.h.

#define MPL3115_CTRL_REG1   ((MPL3115_OVERSAMPLING<<3)|(MPL3115_RAW_OUTPUT<<6)|(MPL3115_ALT_MODE<<7))

Definition at line 73 of file mpl3115.h.

Referenced by mpl3115_read(), and mpl3115_send_config().

#define MPL3115_I2C_ADDR   0xC0

Definition at line 35 of file mpl3115.h.

Referenced by mpl3115_read(), and mpl3115_send_config().

#define MPL3115_I2C_DEV   i2c0

Definition at line 39 of file mpl3115.h.

Referenced by mpl3115_read(), and mpl3115_send_config().

#define MPL3115_OST_BIT   (1<<1)

Definition at line 57 of file mpl3115.h.

Referenced by mpl3115_read().

#define MPL3115_OVERSAMPLING   0x5

Definition at line 64 of file mpl3115.h.

#define MPL3115_PT_DATA_CFG   0x2

Definition at line 61 of file mpl3115.h.

Referenced by mpl3115_send_config().

#define MPL3115_RAW_OUTPUT   0x0

Definition at line 67 of file mpl3115.h.

#define MPL3115_REG_CTRL_REG1   0x26

Definition at line 51 of file mpl3115.h.

Referenced by mpl3115_read(), and mpl3115_send_config().

#define MPL3115_REG_CTRL_REG2   0x27

Definition at line 52 of file mpl3115.h.

#define MPL3115_REG_CTRL_REG3   0x28

Definition at line 53 of file mpl3115.h.

#define MPL3115_REG_CTRL_REG4   0x29

Definition at line 54 of file mpl3115.h.

#define MPL3115_REG_CTRL_REG5   0x2A

Definition at line 55 of file mpl3115.h.

#define MPL3115_REG_OUT_P_CSB   0x02

Definition at line 45 of file mpl3115.h.

#define MPL3115_REG_OUT_P_LSB   0x03

Definition at line 46 of file mpl3115.h.

#define MPL3115_REG_OUT_P_MSB   0x01

Definition at line 44 of file mpl3115.h.

#define MPL3115_REG_OUT_T_LSB   0x05

Definition at line 48 of file mpl3115.h.

#define MPL3115_REG_OUT_T_MSB   0x04

Definition at line 47 of file mpl3115.h.

#define MPL3115_REG_PT_DATA_CFG   0x13

Definition at line 50 of file mpl3115.h.

Referenced by mpl3115_send_config().

#define MPL3115_REG_STATUS   0x00

Definition at line 43 of file mpl3115.h.

Referenced by mpl3115_read().

#define MPL3115_REG_WHO_AM_I   0x0C

Definition at line 49 of file mpl3115.h.

#define Mpl3115Periodic ( )
Value:
{ \
}
void mpl3115_read(void)
Definition: mpl3115.c:99
void mpl3115_configure(void)
Definition: mpl3115.c:88
if(PrimarySpektrumState.SpektrumTimer)--PrimarySpektrumState.SpektrumTimer
bool_t mpl3115_initialized
Definition: mpl3115.c:47

Definition at line 93 of file mpl3115.h.

Referenced by baro_mpl3115_read_periodic(), and baro_periodic().

Function Documentation

void mpl3115_configure ( void  )

Definition at line 88 of file mpl3115.c.

References I2CTransDone, I2CTransSuccess, mpl3115_init_status, mpl3115_send_config(), mpl3115_trans, MPL_CONF_UNINIT, and i2c_transaction::status.

+ Here is the call graph for this function:

void mpl3115_event ( void  )
void mpl3115_init ( void  )

Variable Documentation

float mpl3115_alt

Definition at line 41 of file mpl3115.c.

Referenced by baro_mpl3115_read_periodic(), mpl3115_event(), and mpl3115_init().

volatile bool_t mpl3115_data_available

Definition at line 37 of file mpl3115.c.

Referenced by baro_mpl3115_read_periodic(), baro_periodic(), and mpl3115_event().

bool_t mpl3115_initialized

Definition at line 47 of file mpl3115.c.

Referenced by mpl3115_event(), mpl3115_init(), mpl3115_read(), and mpl3115_send_config().

uint32_t mpl3115_pressure

Definition at line 39 of file mpl3115.c.

Referenced by baro_mpl3115_read_periodic(), mpl3115_event(), and mpl3115_init().

int16_t mpl3115_temperature

Definition at line 40 of file mpl3115.c.

Referenced by baro_mpl3115_read_periodic(), mpl3115_event(), and mpl3115_init().