Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
lsm303dlhc.h File Reference
#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.

Driver for ST LSM303DLHC 3D accelerometer and magnetometer. UNTESTED

Definition in file lsm303dlhc.h.


Data Structure Documentation

◆ Lsm303dlhcAccConfig

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²)

◆ Lsm303dlhcMagConfig

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

◆ LSM303DLHC_DEFAULT_AFS

#define LSM303DLHC_DEFAULT_AFS   (0x04 <<3)

Definition at line 41 of file lsm303dlhc.h.

◆ LSM303DLHC_DEFAULT_AODR

#define LSM303DLHC_DEFAULT_AODR   (0x01 << 4)

Definition at line 37 of file lsm303dlhc.h.

◆ LSM303DLHC_DEFAULT_MD

#define LSM303DLHC_DEFAULT_MD   (0x00 << 0)

Definition at line 53 of file lsm303dlhc.h.

◆ LSM303DLHC_DEFAULT_MFS

#define LSM303DLHC_DEFAULT_MFS   (0x0 << 5)

Definition at line 49 of file lsm303dlhc.h.

◆ LSM303DLHC_DEFAULT_MODR

#define LSM303DLHC_DEFAULT_MODR   (0x5 << 2)

Definition at line 45 of file lsm303dlhc.h.

Enumeration Type Documentation

◆ Lsm303dlhcConfStatus

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.

◆ Lsm303dlhcTarget

Enumerator
LSM_TARGET_ACC 
LSM_TARGET_MAG 

Definition at line 81 of file lsm303dlhc.h.

Function Documentation

◆ lsm303dlhc_acc_set_default_config()

static void lsm303dlhc_acc_set_default_config ( struct Lsm303dlhcAccConfig c)
inlinestatic

Definition at line 86 of file lsm303dlhc.h.

References c(), LSM303DLHC_DEFAULT_AFS, and LSM303DLHC_DEFAULT_AODR.

Referenced by lsm303dlhc_i2c_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lsm303dlhc_mag_set_default_config()

static void lsm303dlhc_mag_set_default_config ( struct Lsm303dlhcMagConfig c)
inlinestatic

Definition at line 92 of file lsm303dlhc.h.

References c(), LSM303DLHC_DEFAULT_MD, LSM303DLHC_DEFAULT_MFS, and LSM303DLHC_DEFAULT_MODR.

Referenced by lsm303dlhc_i2c_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: