60 #define LSM303DLHC_OK ((uint32_t) 0)
61 #define LSM303DLHC_FAIL ((uint32_t) 0)
75 #define LSM303DLHC_FLAG_TIMEOUT ((uint32_t)0x1000)
76 #define LSM303DLHC_LONG_TIMEOUT ((uint32_t)(10 * LSM303DLHC_FLAG_TIMEOUT))
80 #define LSM303DLHC_I2C I2C1
81 #define LSM303DLHC_I2C_CLK RCC_APB1Periph_I2C1
83 #define LSM303DLHC_I2C_SCK_PIN GPIO_Pin_6
84 #define LSM303DLHC_I2C_SCK_GPIO_PORT GPIOB
85 #define LSM303DLHC_I2C_SCK_GPIO_CLK RCC_AHBPeriph_GPIOB
86 #define LSM303DLHC_I2C_SCK_SOURCE GPIO_PinSource6
87 #define LSM303DLHC_I2C_SCK_AF GPIO_AF_4
89 #define LSM303DLHC_I2C_SDA_PIN GPIO_Pin_7
90 #define LSM303DLHC_I2C_SDA_GPIO_PORT GPIOB
91 #define LSM303DLHC_I2C_SDA_GPIO_CLK RCC_AHBPeriph_GPIOB
92 #define LSM303DLHC_I2C_SDA_SOURCE GPIO_PinSource7
93 #define LSM303DLHC_I2C_SDA_AF GPIO_AF_4
95 #define LSM303DLHC_DRDY_PIN GPIO_Pin_2
96 #define LSM303DLHC_DRDY_GPIO_PORT GPIOE
97 #define LSM303DLHC_DRDY_GPIO_CLK RCC_AHBPeriph_GPIOE
98 #define LSM303DLHC_DRDY_EXTI_LINE EXTI_Line2
99 #define LSM303DLHC_DRDY_EXTI_PORT_SOURCE EXTI_PortSourceGPIOE
100 #define LSM303DLHC_DRDY_EXTI_PIN_SOURCE EXTI_PinSource2
101 #define LSM303DLHC_DRDY_EXTI_IRQn EXTI2_TS_IRQn
103 #define LSM303DLHC_I2C_INT1_PIN GPIO_Pin_4
104 #define LSM303DLHC_I2C_INT1_GPIO_PORT GPIOE
105 #define LSM303DLHC_I2C_INT1_GPIO_CLK RCC_AHBPeriph_GPIOE
106 #define LSM303DLHC_I2C_INT1_EXTI_LINE EXTI_Line4
107 #define LSM303DLHC_I2C_INT1_EXTI_PORT_SOURCE EXTI_PortSourceGPIOE
108 #define LSM303DLHC_I2C_INT1_EXTI_PIN_SOURCE EXTI_PinSource4
109 #define LSM303DLHC_I2C_INT1_EXTI_IRQn EXTI4_IRQn
111 #define LSM303DLHC_I2C_INT2_PIN GPIO_Pin_5
112 #define LSM303DLHC_I2C_INT2_GPIO_PORT GPIOE
113 #define LSM303DLHC_I2C_INT2_GPIO_CLK RCC_AHBPeriph_GPIOE
114 #define LSM303DLHC_I2C_INT2_EXTI_LINE EXTI_Line5
115 #define LSM303DLHC_I2C_INT2_EXTI_PORT_SOURCE EXTI_PortSourceGPIOE
116 #define LSM303DLHC_I2C_INT2_EXTI_PIN_SOURCE EXTI_PinSource5ss
117 #define LSM303DLHC_I2C_INT2_EXTI_IRQn EXTI9_5_IRQn
123 #define LSM303DLHC_CTRL_REG1_A 0x20
124 #define LSM303DLHC_CTRL_REG2_A 0x21
125 #define LSM303DLHC_CTRL_REG3_A 0x22
126 #define LSM303DLHC_CTRL_REG4_A 0x23
127 #define LSM303DLHC_CTRL_REG5_A 0x24
128 #define LSM303DLHC_CTRL_REG6_A 0x25
129 #define LSM303DLHC_REFERENCE_A 0x26
130 #define LSM303DLHC_STATUS_REG_A 0x27
131 #define LSM303DLHC_OUT_X_L_A 0x28
132 #define LSM303DLHC_OUT_X_H_A 0x29
133 #define LSM303DLHC_OUT_Y_L_A 0x2A
134 #define LSM303DLHC_OUT_Y_H_A 0x2B
135 #define LSM303DLHC_OUT_Z_L_A 0x2C
136 #define LSM303DLHC_OUT_Z_H_A 0x2D
137 #define LSM303DLHC_FIFO_CTRL_REG_A 0x2E
138 #define LSM303DLHC_FIFO_SRC_REG_A 0x2F
140 #define LSM303DLHC_INT1_CFG_A 0x30
141 #define LSM303DLHC_INT1_SOURCE_A 0x31
142 #define LSM303DLHC_INT1_THS_A 0x32
143 #define LSM303DLHC_INT1_DURATION_A 0x33
145 #define LSM303DLHC_INT2_CFG_A 0x34
146 #define LSM303DLHC_INT2_SOURCE_A 0x35
147 #define LSM303DLHC_INT2_THS_A 0x36
148 #define LSM303DLHC_INT2_DURATION_A 0x37
150 #define LSM303DLHC_CLICK_CFG_A 0x38
151 #define LSM303DLHC_CLICK_SOURCE_A 0x39
152 #define LSM303DLHC_CLICK_THS_A 0x3A
154 #define LSM303DLHC_TIME_LIMIT_A 0x3B
155 #define LSM303DLHC_TIME_LATENCY_A 0x3C
156 #define LSM303DLHC_TIME_WINDOW_A 0x3D
159 #define LSM303DLHC_CRA_REG_M 0x00
160 #define LSM303DLHC_CRB_REG_M 0x01
161 #define LSM303DLHC_MR_REG_M 0x02
162 #define LSM303DLHC_OUT_X_H_M 0x03
163 #define LSM303DLHC_OUT_X_L_M 0x04
164 #define LSM303DLHC_OUT_Z_H_M 0x05
165 #define LSM303DLHC_OUT_Z_L_M 0x06
166 #define LSM303DLHC_OUT_Y_H_M 0x07
167 #define LSM303DLHC_OUT_Y_L_M 0x08
169 #define LSM303DLHC_SR_REG_M 0x09
170 #define LSM303DLHC_IRA_REG_M 0x0A
171 #define LSM303DLHC_IRB_REG_M 0x0B
172 #define LSM303DLHC_IRC_REG_M 0x0C
174 #define LSM303DLHC_TEMP_OUT_H_M 0x31
175 #define LSM303DLHC_TEMP_OUT_L_M 0x32
180 #define ACC_I2C_ADDRESS 0x32
181 #define MAG_I2C_ADDRESS 0x3C
186 #define LSM303DLHC_NORMAL_MODE ((uint8_t)0x00)
187 #define LSM303DLHC_LOWPOWER_MODE ((uint8_t)0x08)
195 #define LSM303DLHC_ODR_1_HZ ((uint8_t)0x10)
196 #define LSM303DLHC_ODR_10_HZ ((uint8_t)0x20)
197 #define LSM303DLHC_ODR_25_HZ ((uint8_t)0x30)
198 #define LSM303DLHC_ODR_50_HZ ((uint8_t)0x40)
199 #define LSM303DLHC_ODR_100_HZ ((uint8_t)0x50)
200 #define LSM303DLHC_ODR_200_HZ ((uint8_t)0x60)
201 #define LSM303DLHC_ODR_400_HZ ((uint8_t)0x70)
202 #define LSM303DLHC_ODR_1620_HZ_LP ((uint8_t)0x80)
203 #define LSM303DLHC_ODR_1344_HZ ((uint8_t)0x90)
212 #define LSM303DLHC_X_ENABLE ((uint8_t)0x01)
213 #define LSM303DLHC_Y_ENABLE ((uint8_t)0x02)
214 #define LSM303DLHC_Z_ENABLE ((uint8_t)0x04)
215 #define LSM303DLHC_AXES_ENABLE ((uint8_t)0x07)
216 #define LSM303DLHC_AXES_DISABLE ((uint8_t)0x00)
224 #define LSM303DLHC_HR_ENABLE ((uint8_t)0x08)
225 #define LSM303DLHC_HR_DISABLE ((uint8_t)0x00)
233 #define LSM303DLHC_FULLSCALE_2G ((uint8_t)0x00)
234 #define LSM303DLHC_FULLSCALE_4G ((uint8_t)0x10)
235 #define LSM303DLHC_FULLSCALE_8G ((uint8_t)0x20)
236 #define LSM303DLHC_FULLSCALE_16G ((uint8_t)0x30)
244 #define LSM303DLHC_BlockUpdate_Continous ((uint8_t)0x00)
245 #define LSM303DLHC_BlockUpdate_Single ((uint8_t)0x80)
253 #define LSM303DLHC_BLE_LSB ((uint8_t)0x00)
254 #define LSM303DLHC_BLE_MSB ((uint8_t)0x40)
262 #define LSM303DLHC_BOOT_NORMALMODE ((uint8_t)0x00)
263 #define LSM303DLHC_BOOT_REBOOTMEMORY ((uint8_t)0x80)
271 #define LSM303DLHC_HPM_NORMAL_MODE_RES ((uint8_t)0x00)
272 #define LSM303DLHC_HPM_REF_SIGNAL ((uint8_t)0x40)
273 #define LSM303DLHC_HPM_NORMAL_MODE ((uint8_t)0x80)
274 #define LSM303DLHC_HPM_AUTORESET_INT ((uint8_t)0xC0)
282 #define LSM303DLHC_HPFCF_8 ((uint8_t)0x00)
283 #define LSM303DLHC_HPFCF_16 ((uint8_t)0x10)
284 #define LSM303DLHC_HPFCF_32 ((uint8_t)0x20)
285 #define LSM303DLHC_HPFCF_64 ((uint8_t)0x30)
293 #define LSM303DLHC_HIGHPASSFILTER_DISABLE ((uint8_t)0x00)
294 #define LSM303DLHC_HIGHPASSFILTER_ENABLE ((uint8_t)0x08)
302 #define LSM303DLHC_HPF_CLICK_DISABLE ((uint8_t)0x00)
303 #define LSM303DLHC_HPF_CLICK_ENABLE ((uint8_t)0x04)
311 #define LSM303DLHC_HPF_AOI1_DISABLE ((uint8_t)0x00)
312 #define LSM303DLHC_HPF_AOI1_ENABLE ((uint8_t)0x01)
320 #define LSM303DLHC_HPF_AOI2_DISABLE ((uint8_t)0x00)
321 #define LSM303DLHC_HPF_AOI2_ENABLE ((uint8_t)0x02)
329 #define LSM303DLHC_IT1_CLICK ((uint8_t)0x80)
330 #define LSM303DLHC_IT1_AOI1 ((uint8_t)0x40)
331 #define LSM303DLHC_IT1_AOI2 ((uint8_t)0x20)
332 #define LSM303DLHC_IT1_DRY1 ((uint8_t)0x10)
333 #define LSM303DLHC_IT1_DRY2 ((uint8_t)0x08)
334 #define LSM303DLHC_IT1_WTM ((uint8_t)0x04)
335 #define LSM303DLHC_IT1_OVERRUN ((uint8_t)0x02)
343 #define LSM303DLHC_IT2_CLICK ((uint8_t)0x80)
344 #define LSM303DLHC_IT2_INT1 ((uint8_t)0x40)
345 #define LSM303DLHC_IT2_INT2 ((uint8_t)0x20)
346 #define LSM303DLHC_IT2_BOOT ((uint8_t)0x10)
347 #define LSM303DLHC_IT2_ACT ((uint8_t)0x08)
348 #define LSM303DLHC_IT2_HLACTIVE ((uint8_t)0x02)
356 #define LSM303DLHC_OR_COMBINATION ((uint8_t)0x00)
357 #define LSM303DLHC_AND_COMBINATION ((uint8_t)0x80)
358 #define LSM303DLHC_MOV_RECOGNITION ((uint8_t)0x40)
359 #define LSM303DLHC_POS_RECOGNITION ((uint8_t)0xC0)
367 #define LSM303DLHC_Z_HIGH ((uint8_t)0x20)
368 #define LSM303DLHC_Z_LOW ((uint8_t)0x10)
369 #define LSM303DLHC_Y_HIGH ((uint8_t)0x08)
370 #define LSM303DLHC_Y_LOW ((uint8_t)0x04)
371 #define LSM303DLHC_X_HIGH ((uint8_t)0x02)
372 #define LSM303DLHC_X_LOW ((uint8_t)0x01)
380 #define LSM303DLHC_Z_DOUBLE_CLICK ((uint8_t)0x20)
381 #define LSM303DLHC_Z_SINGLE_CLICK ((uint8_t)0x10)
382 #define LSM303DLHC_Y_DOUBLE_CLICK ((uint8_t)0x08)
383 #define LSM303DLHC_Y_SINGLE_CLICK ((uint8_t)0x04)
384 #define LSM303DLHC_X_DOUBLE_CLICK ((uint8_t)0x02)
385 #define LSM303DLHC_X_SINGLE_CLICK ((uint8_t)0x01)
393 #define LSM303DLHC_INT1INTERRUPT_DISABLE ((uint8_t)0x00)
394 #define LSM303DLHC_INT1INTERRUPT_ENABLE ((uint8_t)0x80)
402 #define LSM303DLHC_INT1INTERRUPT_LOW_EDGE ((uint8_t)0x20)
403 #define LSM303DLHC_INT1INTERRUPT_HIGH_EDGE ((uint8_t)0x00)
411 #define LSM303DLHC_ODR_0_75_HZ ((uint8_t) 0x00)
412 #define LSM303DLHC_ODR_1_5_HZ ((uint8_t) 0x04)
413 #define LSM303DLHC_ODR_3_0_HZ ((uint8_t) 0x08)
414 #define LSM303DLHC_ODR_7_5_HZ ((uint8_t) 0x0C)
415 #define LSM303DLHC_ODR_15_HZ ((uint8_t) 0x10)
416 #define LSM303DLHC_ODR_30_HZ ((uint8_t) 0x14)
417 #define LSM303DLHC_ODR_75_HZ ((uint8_t) 0x18)
418 #define LSM303DLHC_ODR_220_HZ ((uint8_t) 0x1C)
426 #define LSM303DLHC_FS_1_3_GA ((uint8_t) 0x20)
427 #define LSM303DLHC_FS_1_9_GA ((uint8_t) 0x40)
428 #define LSM303DLHC_FS_2_5_GA ((uint8_t) 0x60)
429 #define LSM303DLHC_FS_4_0_GA ((uint8_t) 0x80)
430 #define LSM303DLHC_FS_4_7_GA ((uint8_t) 0xA0)
431 #define LSM303DLHC_FS_5_6_GA ((uint8_t) 0xC0)
432 #define LSM303DLHC_FS_8_1_GA ((uint8_t) 0xE0)
441 #define LSM303DLHC_M_SENSITIVITY_XY_1_3Ga 1100
442 #define LSM303DLHC_M_SENSITIVITY_XY_1_9Ga 855
443 #define LSM303DLHC_M_SENSITIVITY_XY_2_5Ga 670
444 #define LSM303DLHC_M_SENSITIVITY_XY_4Ga 450
445 #define LSM303DLHC_M_SENSITIVITY_XY_4_7Ga 400
446 #define LSM303DLHC_M_SENSITIVITY_XY_5_6Ga 330
447 #define LSM303DLHC_M_SENSITIVITY_XY_8_1Ga 230
448 #define LSM303DLHC_M_SENSITIVITY_Z_1_3Ga 980
449 #define LSM303DLHC_M_SENSITIVITY_Z_1_9Ga 760
450 #define LSM303DLHC_M_SENSITIVITY_Z_2_5Ga 600
451 #define LSM303DLHC_M_SENSITIVITY_Z_4Ga 400
452 #define LSM303DLHC_M_SENSITIVITY_Z_4_7Ga 355
453 #define LSM303DLHC_M_SENSITIVITY_Z_5_6Ga 295
454 #define LSM303DLHC_M_SENSITIVITY_Z_8_1Ga 205
462 #define LSM303DLHC_CONTINUOS_CONVERSION ((uint8_t) 0x00)
463 #define LSM303DLHC_SINGLE_CONVERSION ((uint8_t) 0x01)
464 #define LSM303DLHC_SLEEP ((uint8_t) 0x02)
472 #define LSM303DLHC_TEMPSENSOR_ENABLE ((uint8_t) 0x80)
473 #define LSM303DLHC_TEMPSENSOR_DISABLE ((uint8_t) 0x00)
476 bool lsm303dlhcAccDetect(acc_t *acc);
uint8_t High_Resolution
Definition: accgyro_lsm303dlhc.h:30
uint8_t HighPassFilter_CutOff_Frequency
Definition: accgyro_lsm303dlhc.h:40
uint8_t Endianness
Definition: accgyro_lsm303dlhc.h:32
LSM303DLHC Status.
Definition: accgyro_lsm303dlhc.h:25
uint8_t HighPassFilter_AOI2
Definition: accgyro_lsm303dlhc.h:42
uint8_t HighPassFilter_AOI1
Definition: accgyro_lsm303dlhc.h:41
uint8_t AccOutput_DataRate
Definition: accgyro_lsm303dlhc.h:28
uint8_t HighPassFilter_Mode_Selection
Definition: accgyro_lsm303dlhc.h:39
uint8_t BlockData_Update
Definition: accgyro_lsm303dlhc.h:31
uint8_t Working_Mode
Definition: accgyro_lsm303dlhc.h:50
uint8_t MagOutput_DataRate
Definition: accgyro_lsm303dlhc.h:49
uint8_t Axes_Enable
Definition: accgyro_lsm303dlhc.h:29
uint8_t Temperature_Sensor
Definition: accgyro_lsm303dlhc.h:48
Definition: accgyro_lsm303dlhc.h:46
Definition: accgyro_lsm303dlhc.h:37
uint8_t AccFull_Scale
Definition: accgyro_lsm303dlhc.h:33
uint8_t Power_Mode
Definition: accgyro_lsm303dlhc.h:27
uint8_t MagFull_Scale
Definition: accgyro_lsm303dlhc.h:51