CARME-M4 BSP  V1.5
i2c.h
Go to the documentation of this file.
1 #ifndef __I2C_H__
2 #define __I2C_H__
3 
72 #ifdef __cplusplus
73 extern "C" {
74 #endif /* __cplusplus */
75 
76 /*----- Header-Files -------------------------------------------------------*/
77 #include <stm32f4xx.h> /* Processor STM32F407IG */
78 #include <carme.h> /* CARME Module */
79 
80 /*----- Macros -------------------------------------------------------------*/
81 #define CARME_I2C_BOARD I2C2
82 #define CARME_I2C_AUDIO I2C3
84 #define CARME_I2C_SPEED 100000
85 #define CARME_I2C_ADDR_BOARD 0xA0
87 #define CARME_I2C_ADDR_AUDIO 0x33
90 #define CARME_ERROR_I2C_TIMEOUT CARME_ERROR_I2C_BASE + 0
92 /*----- Data types ---------------------------------------------------------*/
93 
94 /*----- Function prototypes ------------------------------------------------*/
95 extern void CARME_I2C_Init(I2C_TypeDef *I2Cx);
96 ERROR_CODES CARME_I2C_Write(I2C_TypeDef *I2Cx, uint8_t addr, uint16_t reg,
97  uint8_t twoByte, uint8_t *pdata, uint16_t count);
98 ERROR_CODES CARME_I2C_Read(I2C_TypeDef *I2Cx, uint8_t addr, uint16_t reg,
99  uint8_t twoByte, uint8_t *pdata, uint16_t count);
100 
101 /*----- Data ---------------------------------------------------------------*/
102 
103 #ifdef __cplusplus
104 }
105 #endif /* __cplusplus */
106 
112 #endif /* __I2C_H__ */
uint8_t ERROR_CODES
Error variable.
Definition: carme.h:255
ERROR_CODES CARME_I2C_Read(I2C_TypeDef *I2Cx, uint8_t addr, uint16_t reg, uint8_t twoByte, uint8_t *pdata, uint16_t count)
Read data from an I2C slave device on a specific register address.
Definition: i2c.c:312
void CARME_I2C_Init(I2C_TypeDef *I2Cx)
I2C initialization.
Definition: i2c.c:124
ERROR_CODES CARME_I2C_Write(I2C_TypeDef *I2Cx, uint8_t addr, uint16_t reg, uint8_t twoByte, uint8_t *pdata, uint16_t count)
Write data to an I2C slave device on a specific register address.
Definition: i2c.c:226