Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
lsm303d.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  Lsm303dConfig
 

Macros

#define LSM303D_DEFAULT_AODR   (LSM303D_ACC_RATE_1600HZ << 4)
 
#define LSM303D_DEFAULT_AFS   (LSM303D_ACC_RANGE_16G << 3)
 
#define LSM303D_DEFAULT_MODR   (LSM303D_MAG_RATE_100HZ << 2)
 
#define LSM303D_DEFAULT_MFS   (LSM303D_MAG_RANGE_2GAUSS << 5)
 
#define LSM303D_DEFAULT_MD   (LSM303D_MAG_MODE_CONTINOUS_CONVERSION << 0)
 
#define LSM303D_ACCEL_SENS_16G_NUM   13723
 default accel sensitivy from the datasheet LSM303DLHC has 732 LSB/g fixed point sens: 9.81 [m/s^2] / 732 [LSB/g] * 2^INT32_ACCEL_FRAC sens = 9.81 / 732 * 1024 = 13.72 More...
 
#define LSM303D_ACCEL_SENS_16G_DEN   1000
 

Enumerations

enum  Lsm303dConfStatus {
  LSM303D_CONF_UNINIT , LSM303D_CONF_WHO_AM_I , LSM303D_CONF_CTRL_REG1 , LSM303D_CONF_CTRL_REG2 ,
  LSM303D_CONF_CTRL_REG3 , LSM303D_CONF_CTRL_REG4 , LSM303D_CONF_CTRL_REG5 , LSM303D_CONF_CTRL_REG6 ,
  LSM303D_CONF_CTRL_REG7 , LSM303D_CONF_DONE
}
 config status states More...
 
enum  Lsm303dTarget { LSM303D_TARGET_ACC , LSM303D_TARGET_MAG }
 

Functions

static void lsm303d_set_default_config (struct Lsm303dConfig *c)
 

Detailed Description

Driver for ST LSM303D 3D accelerometer and magnetometer.

Definition in file lsm303d.h.


Data Structure Documentation

◆ Lsm303dConfig

struct Lsm303dConfig

Definition at line 64 of file lsm303d.h.

Data Fields
uint8_t acc_rate Data Output Rate (Hz)
uint8_t acc_scale full scale selection (m/s²)
uint8_t mag_mode Measurement mode.
uint8_t mag_rate Data Output Rate Bits (Hz)
uint8_t mag_scale Full scale gain configuration (Gauss)

Macro Definition Documentation

◆ LSM303D_ACCEL_SENS_16G_DEN

#define LSM303D_ACCEL_SENS_16G_DEN   1000

Definition at line 62 of file lsm303d.h.

◆ LSM303D_ACCEL_SENS_16G_NUM

#define LSM303D_ACCEL_SENS_16G_NUM   13723

default accel sensitivy from the datasheet LSM303DLHC has 732 LSB/g fixed point sens: 9.81 [m/s^2] / 732 [LSB/g] * 2^INT32_ACCEL_FRAC sens = 9.81 / 732 * 1024 = 13.72

Definition at line 61 of file lsm303d.h.

◆ LSM303D_DEFAULT_AFS

#define LSM303D_DEFAULT_AFS   (LSM303D_ACC_RANGE_16G << 3)

Definition at line 41 of file lsm303d.h.

◆ LSM303D_DEFAULT_AODR

#define LSM303D_DEFAULT_AODR   (LSM303D_ACC_RATE_1600HZ << 4)

Definition at line 37 of file lsm303d.h.

◆ LSM303D_DEFAULT_MD

#define LSM303D_DEFAULT_MD   (LSM303D_MAG_MODE_CONTINOUS_CONVERSION << 0)

Definition at line 53 of file lsm303d.h.

◆ LSM303D_DEFAULT_MFS

#define LSM303D_DEFAULT_MFS   (LSM303D_MAG_RANGE_2GAUSS << 5)

Definition at line 49 of file lsm303d.h.

◆ LSM303D_DEFAULT_MODR

#define LSM303D_DEFAULT_MODR   (LSM303D_MAG_RATE_100HZ << 2)

Definition at line 45 of file lsm303d.h.

Enumeration Type Documentation

◆ Lsm303dConfStatus

config status states

Enumerator
LSM303D_CONF_UNINIT 
LSM303D_CONF_WHO_AM_I 
LSM303D_CONF_CTRL_REG1 
LSM303D_CONF_CTRL_REG2 
LSM303D_CONF_CTRL_REG3 
LSM303D_CONF_CTRL_REG4 
LSM303D_CONF_CTRL_REG5 
LSM303D_CONF_CTRL_REG6 
LSM303D_CONF_CTRL_REG7 
LSM303D_CONF_DONE 

Definition at line 75 of file lsm303d.h.

◆ Lsm303dTarget

Enumerator
LSM303D_TARGET_ACC 
LSM303D_TARGET_MAG 

Definition at line 88 of file lsm303d.h.

Function Documentation

◆ lsm303d_set_default_config()

static void lsm303d_set_default_config ( struct Lsm303dConfig c)
inlinestatic