Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
lsm303d_regs.h File Reference

Register defs for ST LSM303D 3D accelerometer and magnetometer. More...

Go to the source code of this file.

Macros

#define LSM303D_REG_TEMP_OUT_L   0x05
 
#define LSM303D_REG_TEMP_OUT_H   0x06
 
#define LSM303D_REG_STATUS_M   0x07
 
#define LSM303D_REG_OUT_X_L_M   0x08
 
#define LSM303D_REG_OUT_X_H_M   0x09
 
#define LSM303D_REG_OUT_Y_L_M   0x0A
 
#define LSM303D_REG_OUT_Y_H_M   0x0B
 
#define LSM303D_REG_OUT_Z_L_M   0x0C
 
#define LSM303D_REG_OUT_Z_H_M   0x0D
 
#define LSM303D_REG_WHO_AM_I   0x0F
 
#define LSM303D_REG_INT_CTRL_M   0x12
 
#define LSM303D_REG_INT_SRC_M   0x13
 
#define LSM303D_REG_INT_THS_L_M   0x14
 
#define LSM303D_REG_INT_THS_H_M   0x15
 
#define LSM303D_REG_OFFSET_X_L_M   0x16
 
#define LSM303D_REG_OFFSET_X_H_M   0x17
 
#define LSM303D_REG_OFFSET_Y_L_M   0x18
 
#define LSM303D_REG_OFFSET_Y_H_M   0x19
 
#define LSM303D_REG_OFFSET_Z_L_M   0x1A
 
#define LSM303D_REG_OFFSET_Z_H_M   0x1B
 
#define LSM303D_REG_REFERENCE_X   0x1C
 
#define LSM303D_REG_REFERENCE_Y   0x1D
 
#define LSM303D_REG_REFERENCE_Z   0x1E
 
#define LSM303D_REG_CTRL0   0x1F
 
#define LSM303D_REG_CTRL1   0x20
 
#define LSM303D_REG_CTRL2   0x21
 
#define LSM303D_REG_CTRL3   0x22
 
#define LSM303D_REG_CTRL4   0x23
 
#define LSM303D_REG_CTRL5   0x24
 
#define LSM303D_REG_CTRL6   0x25
 
#define LSM303D_REG_CTRL7   0x26
 
#define LSM303D_REG_STATUS_A   0x27
 
#define LSM303D_REG_OUT_X_L_A   0x28
 
#define LSM303D_REG_OUT_X_H_A   0x29
 
#define LSM303D_REG_OUT_Y_L_A   0x2A
 
#define LSM303D_REG_OUT_Y_H_A   0x2B
 
#define LSM303D_REG_OUT_Z_L_A   0x2C
 
#define LSM303D_REG_OUT_Z_H_A   0x2D
 
#define LSM303D_REG_FIFO_CTRL   0x2E
 
#define LSM303D_REG_FIFO_SRC   0x2F
 
#define LSM303D_REG_IG_CFG1   0x30
 
#define LSM303D_REG_IG_SRC1   0x31
 
#define LSM303D_REG_IG_THS1   0x32
 
#define LSM303D_REG_IG_DUR1   0x33
 
#define LSM303D_REG_IG_CFG2   0x34
 
#define LSM303D_REG_IG_SRC2   0x35
 
#define LSM303D_REG_IG_THS2   0x36
 
#define LSM303D_REG_IG_DUR2   0x37
 
#define LSM303D_REG_CLICK_CFG   0x38
 
#define LSM303D_REG_CLICK_SRC   0x39
 
#define LSM303D_REG_CLICK_THS   0x3A
 
#define LSM303D_REG_TIME_LIMIT   0x3B
 
#define LSM303D_REG_TIME_LATENCY   0x3C
 
#define LSM303D_REG_TIME_WINDOW   0x3D
 
#define LSM303D_REG_ACT_THS   0x3E
 
#define LSM303D_REG_ACT_DUR   0x3F
 
#define LSM303D_WHO_AM_I   0x49
 LSM303D device identifier in LSM303D_REG_WHO_AM_I. More...
 
#define LSM303D_AXEN   (1 << 0)
 
#define LSM303D_AYEN   (1 << 1)
 
#define LSM303D_AZEN   (1 << 3)
 

Enumerations

enum  Lsm303dAccelRates {
  LSM303D_ACC_RATE_OFF = 0x0, LSM303D_ACC_RATE_3_125HZ = 0x1, LSM303D_ACC_RATE_6_25HZ = 0x2, LSM303D_ACC_RATE_12_5HZ = 0x3,
  LSM303D_ACC_RATE_25HZ = 0x4, LSM303D_ACC_RATE_50HZ = 0x5, LSM303D_ACC_RATE_100HZ = 0x6, LSM303D_ACC_RATE_200HZ = 0x7,
  LSM303D_ACC_RATE_400HZ = 0x8, LSM303D_ACC_RATE_800HZ = 0x9, LSM303D_ACC_RATE_1600HZ = 0xA
}
 LSM303D acceleration data rate (bits 4-7 in LSM303D_REG_CTRL1) More...
 
enum  Lsm303dAccelBandwidth { LSM303D_ACC_BW_773HZ = 0, LSM303D_ACC_BW_194HZ = 1, LSM303D_ACC_BW_362HZ = 2, LSM303D_ACC_BW_50HZ = 3 }
 LSM303D accelerometer anti-alias filter bandwidth (bits 6-7 in LSM303D_REG_CTRL2) More...
 
enum  Lsm303dAccelRanges {
  LSM303D_ACC_RANGE_2G = 0x0, LSM303D_ACC_RANGE_4G = 0x1, LSM303D_ACC_RANGE_6G = 0x2, LSM303D_ACC_RANGE_8G = 0x3,
  LSM303D_ACC_RANGE_16G = 0x4
}
 LSM303D accelerometer anti-alias filter bandwidth (bits 3-5 in LSM303D_REG_CTRL2) More...
 
enum  Lsm303dMagRates {
  LSM303D_MAG_RATE_3_125HZ = 0x0, LSM303D_MAG_RATE_6_25HZ = 0x1, LSM303D_MAG_RATE_12_5HZ = 0x2, LSM303D_MAG_RATE_25HZ = 0x3,
  LSM303D_MAG_RATE_50HZ = 0x4, LSM303D_MAG_RATE_100HZ = 0x5
}
 LSM303D magnetic data rate (bits 2-4 in LSM303D_REG_CTRL5) More...
 
enum  Lsm303dMagRange { LSM303D_MAG_RANGE_2GAUSS = 0, LSM303D_MAG_RANGE_4GAUSS = 1, LSM303D_MAG_RANGE_8GAUSS = 2, LSM303D_MAG_RANGE_12GAUSS = 3 }
 LSM303D magnetic range (bits 5-6 in LSM303D_REG_CTRL6) More...
 

Detailed Description

Register defs for ST LSM303D 3D accelerometer and magnetometer.

Has an I2C and SPI interface. The LSM303D has linear acceleration full scales of ±2g / ±4g / ±6g / ±8g / ±16g and a magnetic field full scale of ±2 / ±4 / ±8 / ±12 gauss.

Definition in file lsm303d_regs.h.

Macro Definition Documentation

#define LSM303D_AXEN   (1 << 0)

Definition at line 113 of file lsm303d_regs.h.

#define LSM303D_AYEN   (1 << 1)

Definition at line 114 of file lsm303d_regs.h.

#define LSM303D_AZEN   (1 << 3)

Definition at line 115 of file lsm303d_regs.h.

#define LSM303D_REG_ACT_DUR   0x3F

Definition at line 92 of file lsm303d_regs.h.

#define LSM303D_REG_ACT_THS   0x3E

Definition at line 91 of file lsm303d_regs.h.

#define LSM303D_REG_CLICK_CFG   0x38

Definition at line 85 of file lsm303d_regs.h.

#define LSM303D_REG_CLICK_SRC   0x39

Definition at line 86 of file lsm303d_regs.h.

#define LSM303D_REG_CLICK_THS   0x3A

Definition at line 87 of file lsm303d_regs.h.

#define LSM303D_REG_CTRL0   0x1F

Definition at line 60 of file lsm303d_regs.h.

#define LSM303D_REG_CTRL1   0x20

Definition at line 61 of file lsm303d_regs.h.

#define LSM303D_REG_CTRL2   0x21

Definition at line 62 of file lsm303d_regs.h.

#define LSM303D_REG_CTRL3   0x22

Definition at line 63 of file lsm303d_regs.h.

#define LSM303D_REG_CTRL4   0x23

Definition at line 64 of file lsm303d_regs.h.

#define LSM303D_REG_CTRL5   0x24

Definition at line 65 of file lsm303d_regs.h.

#define LSM303D_REG_CTRL6   0x25

Definition at line 66 of file lsm303d_regs.h.

#define LSM303D_REG_CTRL7   0x26

Definition at line 67 of file lsm303d_regs.h.

#define LSM303D_REG_FIFO_CTRL   0x2E

Definition at line 75 of file lsm303d_regs.h.

#define LSM303D_REG_FIFO_SRC   0x2F

Definition at line 76 of file lsm303d_regs.h.

#define LSM303D_REG_IG_CFG1   0x30

Definition at line 77 of file lsm303d_regs.h.

#define LSM303D_REG_IG_CFG2   0x34

Definition at line 81 of file lsm303d_regs.h.

#define LSM303D_REG_IG_DUR1   0x33

Definition at line 80 of file lsm303d_regs.h.

#define LSM303D_REG_IG_DUR2   0x37

Definition at line 84 of file lsm303d_regs.h.

#define LSM303D_REG_IG_SRC1   0x31

Definition at line 78 of file lsm303d_regs.h.

#define LSM303D_REG_IG_SRC2   0x35

Definition at line 82 of file lsm303d_regs.h.

#define LSM303D_REG_IG_THS1   0x32

Definition at line 79 of file lsm303d_regs.h.

#define LSM303D_REG_IG_THS2   0x36

Definition at line 83 of file lsm303d_regs.h.

#define LSM303D_REG_INT_CTRL_M   0x12

Definition at line 47 of file lsm303d_regs.h.

#define LSM303D_REG_INT_SRC_M   0x13

Definition at line 48 of file lsm303d_regs.h.

#define LSM303D_REG_INT_THS_H_M   0x15

Definition at line 50 of file lsm303d_regs.h.

#define LSM303D_REG_INT_THS_L_M   0x14

Definition at line 49 of file lsm303d_regs.h.

#define LSM303D_REG_OFFSET_X_H_M   0x17

Definition at line 52 of file lsm303d_regs.h.

#define LSM303D_REG_OFFSET_X_L_M   0x16

Definition at line 51 of file lsm303d_regs.h.

#define LSM303D_REG_OFFSET_Y_H_M   0x19

Definition at line 54 of file lsm303d_regs.h.

#define LSM303D_REG_OFFSET_Y_L_M   0x18

Definition at line 53 of file lsm303d_regs.h.

#define LSM303D_REG_OFFSET_Z_H_M   0x1B

Definition at line 56 of file lsm303d_regs.h.

#define LSM303D_REG_OFFSET_Z_L_M   0x1A

Definition at line 55 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_X_H_A   0x29

Definition at line 70 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_X_H_M   0x09

Definition at line 39 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_X_L_A   0x28

Definition at line 69 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_X_L_M   0x08

Definition at line 38 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_Y_H_A   0x2B

Definition at line 72 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_Y_H_M   0x0B

Definition at line 41 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_Y_L_A   0x2A

Definition at line 71 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_Y_L_M   0x0A

Definition at line 40 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_Z_H_A   0x2D

Definition at line 74 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_Z_H_M   0x0D

Definition at line 43 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_Z_L_A   0x2C

Definition at line 73 of file lsm303d_regs.h.

#define LSM303D_REG_OUT_Z_L_M   0x0C

Definition at line 42 of file lsm303d_regs.h.

#define LSM303D_REG_REFERENCE_X   0x1C

Definition at line 57 of file lsm303d_regs.h.

#define LSM303D_REG_REFERENCE_Y   0x1D

Definition at line 58 of file lsm303d_regs.h.

#define LSM303D_REG_REFERENCE_Z   0x1E

Definition at line 59 of file lsm303d_regs.h.

#define LSM303D_REG_STATUS_A   0x27

Definition at line 68 of file lsm303d_regs.h.

#define LSM303D_REG_STATUS_M   0x07

Definition at line 37 of file lsm303d_regs.h.

#define LSM303D_REG_TEMP_OUT_H   0x06

Definition at line 36 of file lsm303d_regs.h.

#define LSM303D_REG_TEMP_OUT_L   0x05

Definition at line 35 of file lsm303d_regs.h.

#define LSM303D_REG_TIME_LATENCY   0x3C

Definition at line 89 of file lsm303d_regs.h.

#define LSM303D_REG_TIME_LIMIT   0x3B

Definition at line 88 of file lsm303d_regs.h.

#define LSM303D_REG_TIME_WINDOW   0x3D

Definition at line 90 of file lsm303d_regs.h.

#define LSM303D_REG_WHO_AM_I   0x0F

Definition at line 45 of file lsm303d_regs.h.

#define LSM303D_WHO_AM_I   0x49

LSM303D device identifier in LSM303D_REG_WHO_AM_I.

Definition at line 95 of file lsm303d_regs.h.

Enumeration Type Documentation

LSM303D accelerometer anti-alias filter bandwidth (bits 6-7 in LSM303D_REG_CTRL2)

Enumerator
LSM303D_ACC_BW_773HZ 
LSM303D_ACC_BW_194HZ 
LSM303D_ACC_BW_362HZ 
LSM303D_ACC_BW_50HZ 

Definition at line 118 of file lsm303d_regs.h.

LSM303D accelerometer anti-alias filter bandwidth (bits 3-5 in LSM303D_REG_CTRL2)

Enumerator
LSM303D_ACC_RANGE_2G 
LSM303D_ACC_RANGE_4G 
LSM303D_ACC_RANGE_6G 
LSM303D_ACC_RANGE_8G 
LSM303D_ACC_RANGE_16G 

Definition at line 126 of file lsm303d_regs.h.

LSM303D acceleration data rate (bits 4-7 in LSM303D_REG_CTRL1)

Enumerator
LSM303D_ACC_RATE_OFF 
LSM303D_ACC_RATE_3_125HZ 
LSM303D_ACC_RATE_6_25HZ 
LSM303D_ACC_RATE_12_5HZ 
LSM303D_ACC_RATE_25HZ 
LSM303D_ACC_RATE_50HZ 
LSM303D_ACC_RATE_100HZ 
LSM303D_ACC_RATE_200HZ 
LSM303D_ACC_RATE_400HZ 
LSM303D_ACC_RATE_800HZ 
LSM303D_ACC_RATE_1600HZ 

Definition at line 98 of file lsm303d_regs.h.

LSM303D magnetic range (bits 5-6 in LSM303D_REG_CTRL6)

Enumerator
LSM303D_MAG_RANGE_2GAUSS 
LSM303D_MAG_RANGE_4GAUSS 
LSM303D_MAG_RANGE_8GAUSS 
LSM303D_MAG_RANGE_12GAUSS 

Definition at line 145 of file lsm303d_regs.h.

LSM303D magnetic data rate (bits 2-4 in LSM303D_REG_CTRL5)

Enumerator
LSM303D_MAG_RATE_3_125HZ 
LSM303D_MAG_RATE_6_25HZ 
LSM303D_MAG_RATE_12_5HZ 
LSM303D_MAG_RATE_25HZ 
LSM303D_MAG_RATE_50HZ 
LSM303D_MAG_RATE_100HZ 

Definition at line 135 of file lsm303d_regs.h.