comparison Small_CPU/Inc/i2c.h @ 38:5f11787b4f42

include in ostc4 repository
author heinrichsweikamp
date Sat, 28 Apr 2018 11:52:34 +0200
parents
children e9cce686fe41
comparison
equal deleted inserted replaced
37:ccc45c0e1ea2 38:5f11787b4f42
1 /* Define to prevent recursive inclusion -------------------------------------*/
2 #ifndef I2C_H
3 #define I2C_H
4
5 /* Drucksensor */
6 #define DEVICE_PRESSURE 0xEE
7
8 /* Kompass */
9 #define DEVICE_ACCELARATOR_MMA8452Q 0x38 // 0x1C // chip 3
10 #define DEVICE_COMPASS_HMC5883L 0x3C //0x1E // chip 4
11
12 //#define DEVICE_ACCELARATOR_303D 0x1E // x0011110 // SA0 to GND
13 #define DEVICE_COMPASS_303D 0x3C // 0x1E // x0011110_ // SA0 to GND
14 #define DEVICE_ACCELARATOR_303DLHC 0x32 // 0x19 // x0011001_ // SA0 to GND
15
16 /* Battery Gas Gauge */
17 #define DEVICE_BATTERYGAUGE 0xC8 // 0x64
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 */