Paparazzi UAS  v5.15_devel-47-g0391b4d
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
lsm303dlhc.h File Reference

Driver for ST LSM303DLHC 3D accelerometer and magnetometer. More...

#include "std.h"
#include "peripherals/lsm303dlhc_regs.h"
+ Include dependency graph for lsm303dlhc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Lsm303dlhcAccConfig
 
struct  Lsm303dlhcMagConfig
 

Macros

#define LSM303DLHC_DEFAULT_AODR   (0x01 << 4)
 
#define LSM303DLHC_DEFAULT_AFS   (0x04 <<3)
 
#define LSM303DLHC_DEFAULT_MODR   (0x5 << 2)
 
#define LSM303DLHC_DEFAULT_MFS   (0x0 << 5)
 
#define LSM303DLHC_DEFAULT_MD   (0x00 << 0)
 

Enumerations

enum  Lsm303dlhcConfStatus {
  LSM_CONF_UNINIT, LSM_CONF_WHO_AM_I, LSM_CONF_CTRL_REG1, LSM_CONF_CTRL_REG2,
  LSM_CONF_CTRL_REG3, LSM_CONF_CTRL_REG4, LSM_CONF_CTRL_REG5, LSM_CONF_CTRL_REG6,
  LSM_CONF_CTRL_REG7, LSM_CONF_DONE
}
 config status states More...
 
enum  Lsm303dlhcTarget { LSM_TARGET_ACC, LSM_TARGET_MAG }
 

Functions

static void lsm303dlhc_acc_set_default_config (struct Lsm303dlhcAccConfig *c)
 
static void lsm303dlhc_mag_set_default_config (struct Lsm303dlhcMagConfig *c)
 

Detailed Description

Driver for ST LSM303DLHC 3D accelerometer and magnetometer.

UNTESTED

Definition in file lsm303dlhc.h.


Data Structure Documentation

struct Lsm303dlhcAccConfig

Definition at line 56 of file lsm303dlhc.h.

Data Fields
uint8_t rate Data Output Rate (Hz)
uint8_t scale full scale selection (m/s²)
struct Lsm303dlhcMagConfig

Definition at line 61 of file lsm303dlhc.h.

Data Fields
uint8_t mode Measurement mode.
uint8_t rate Data Output Rate Bits (Hz)
uint8_t scale Full scale gain configuration (Gauss)

Macro Definition Documentation

#define LSM303DLHC_DEFAULT_AFS   (0x04 <<3)

Definition at line 41 of file lsm303dlhc.h.

Referenced by lsm303dlhc_acc_set_default_config().

#define LSM303DLHC_DEFAULT_AODR   (0x01 << 4)

Definition at line 37 of file lsm303dlhc.h.

Referenced by lsm303dlhc_acc_set_default_config().

#define LSM303DLHC_DEFAULT_MD   (0x00 << 0)

Definition at line 53 of file lsm303dlhc.h.

Referenced by lsm303dlhc_mag_set_default_config().

#define LSM303DLHC_DEFAULT_MFS   (0x0 << 5)

Definition at line 49 of file lsm303dlhc.h.

Referenced by lsm303dlhc_mag_set_default_config().

#define LSM303DLHC_DEFAULT_MODR   (0x5 << 2)

Definition at line 45 of file lsm303dlhc.h.

Referenced by lsm303dlhc_mag_set_default_config().

Enumeration Type Documentation

config status states

Enumerator
LSM_CONF_UNINIT 
LSM_CONF_WHO_AM_I 
LSM_CONF_CTRL_REG1 
LSM_CONF_CTRL_REG2 
LSM_CONF_CTRL_REG3 
LSM_CONF_CTRL_REG4 
LSM_CONF_CTRL_REG5 
LSM_CONF_CTRL_REG6 
LSM_CONF_CTRL_REG7 
LSM_CONF_DONE 

Definition at line 68 of file lsm303dlhc.h.

Enumerator
LSM_TARGET_ACC 
LSM_TARGET_MAG 

Definition at line 81 of file lsm303dlhc.h.

Function Documentation

static void lsm303dlhc_acc_set_default_config ( struct Lsm303dlhcAccConfig c)
inlinestatic

Definition at line 86 of file lsm303dlhc.h.

References LSM303DLHC_DEFAULT_AFS, LSM303DLHC_DEFAULT_AODR, Lsm303dlhcAccConfig::rate, and Lsm303dlhcAccConfig::scale.

Referenced by lsm303dlhc_i2c_init().

+ Here is the caller graph for this function:

static void lsm303dlhc_mag_set_default_config ( struct Lsm303dlhcMagConfig c)
inlinestatic

Definition at line 92 of file lsm303dlhc.h.

References LSM303DLHC_DEFAULT_MD, LSM303DLHC_DEFAULT_MFS, LSM303DLHC_DEFAULT_MODR, Lsm303dlhcMagConfig::mode, Lsm303dlhcMagConfig::rate, and Lsm303dlhcMagConfig::scale.

Referenced by lsm303dlhc_i2c_init().

+ Here is the caller graph for this function: