Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
i2c.c
Go to the documentation of this file.
1 #include "mcu_periph/i2c.h"
2 
3 #ifdef USE_I2C0
4 
5 struct i2c_periph i2c0;
6 
7 void i2c0_init(void) {
8  i2c_init(&i2c0);
9  i2c0_hw_init();
10 }
11 
12 #endif /* USE_I2C0 */
13 
14 
15 #ifdef USE_I2C1
16 
17 struct i2c_periph i2c1;
18 
19 void i2c1_init(void) {
20  i2c_init(&i2c1);
21  i2c1_hw_init();
22 }
23 
24 #endif /* USE_I2C1 */
25 
26 
27 #ifdef USE_I2C2
28 
29 struct i2c_periph i2c2;
30 
31 void i2c2_init(void) {
32  i2c_init(&i2c2);
33  i2c2_hw_init();
34 }
35 
36 #endif /* USE_I2C2 */
37 
38 void i2c_init(struct i2c_periph* p) {
39  p->trans_insert_idx = 0;
40  p->trans_extract_idx = 0;
41  p->status = I2CIdle;
42 }
43 
44 
uint8_t trans_extract_idx
Definition: i2c.h:58
enum I2CStatus status
Definition: i2c.h:60
Definition: i2c.h:23
void i2c_init(struct i2c_periph *p)
Definition: i2c.c:38
uint8_t trans_insert_idx
Definition: i2c.h:57
Definition: i2c.h:54