38
|
1 /* Define to prevent recursive inclusion -------------------------------------*/
|
|
2 #ifndef I2C_H
|
|
3 #define I2C_H
|
|
4
|
165
|
5 /* Pressure Sensor */
|
|
6 #define DEVICE_PRESSURE 0xEE // 2019 hardware (gen 3) will use 0xEC (MS5837), all other use 0xEE (MS5803)
|
38
|
7
|
165
|
8 /* Compass/Accelerometer */
|
|
9 #define DEVICE_ACCELARATOR_MMA8452Q 0x38 // Hardware gen 1 (Two chip solution with MMA8452Q and HMC5883L)
|
|
10 #define DEVICE_COMPASS_HMC5883L 0x3C // Hardware gen 1
|
38
|
11
|
165
|
12 #define DEVICE_COMPASS_303D 0x3C // Hardware gen 2 (Single chip solution LSM303D)
|
|
13 #define DEVICE_ACCELARATOR_303DLHC 0x32 // Hardware gen 2 (Single chip solution LSM303DLHC)
|
|
14 #define DEVICE_COMPASS_303AGR 0x3C // Hardware gen 3 (Single chip solution LSM303AGR)
|
38
|
15
|
|
16 /* Battery Gas Gauge */
|
165
|
17 #define DEVICE_BATTERYGAUGE 0xC8 // LTC2941 battery gauge
|
38
|
18
|
|
19
|
|
20 /* Includes ------------------------------------------------------------------*/
|
|
21 #include "stm32f4xx_hal.h"
|
|
22
|
|
23 HAL_StatusTypeDef I2C_Master_Transmit( uint16_t DevAddress, uint8_t *pData, uint16_t Size);
|
|
24 HAL_StatusTypeDef I2C_Master_TransmitNoStop( uint16_t DevAddress, uint8_t *pData, uint16_t Size);
|
|
25 HAL_StatusTypeDef I2C_Master_Receive( uint16_t DevAddress, uint8_t *pData, uint16_t Size);
|
|
26 HAL_StatusTypeDef MX_I2C1_Init(void);
|
|
27 void I2C_DeInit(void);
|
|
28 HAL_StatusTypeDef I2C1_Status(void);
|
|
29
|
|
30 GPIO_PinState MX_I2C1_TestAndClear(void);
|
|
31
|
|
32 //void I2C_Error(void);
|
|
33
|
|
34
|
|
35 #endif /* I2C_H */
|