Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
i2c_arch.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 The Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
27 #include "mcu_periph/i2c.h"
28 
29 
30 bool i2c_idle(struct i2c_periph *p __attribute__((unused))) { return true; }
31 bool i2c_submit(struct i2c_periph *p __attribute__((unused)), struct i2c_transaction *t __attribute__((unused))) { return true;}
32 void i2c_event(void) { }
33 void i2c_setbitrate(struct i2c_periph *p __attribute__((unused)), int bitrate __attribute__((unused))) { }
34 
35 #if USE_I2C0
36 struct i2c_errors i2c0_errors;
37 
38 void i2c0_hw_init(void)
39 {
40  i2c0.errors = &i2c0_errors;
41  ZEROS_ERR_COUNTER(i2c0_errors);
42 }
43 
44 #endif
45 
46 #if USE_I2C1
47 struct i2c_errors i2c1_errors;
48 
49 void i2c1_hw_init(void)
50 {
51  i2c1.errors = &i2c1_errors;
52  ZEROS_ERR_COUNTER(i2c1_errors);
53 }
54 
55 #endif
56 
57 #if USE_I2C2
58 struct i2c_errors i2c2_errors;
59 
60 void i2c2_hw_init(void)
61 {
62  i2c2.errors = &i2c2_errors;
63  ZEROS_ERR_COUNTER(i2c2_errors);
64 }
65 
66 #endif
I2C errors counter.
Definition: i2c.h:154
bool i2c_idle(struct i2c_periph *p)
i2c_idle() function
Definition: i2c_arch.c:413
void i2c_setbitrate(struct i2c_periph *p, int bitrate)
i2c_setbitrate() function
Definition: i2c_arch.c:355
#define ZEROS_ERR_COUNTER(_i2c_err)
Definition: i2c.h:170
bool i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
i2c_submit() function
Definition: i2c_arch.c:374
I2C transaction structure.
Definition: i2c.h:93
I2C peripheral structure.
Definition: i2c.h:138
static float p[2][2]
void i2c_event(void)
i2c_event() function
Definition: i2c_arch.c:347
Architecture independent I2C (Inter-Integrated Circuit Bus) API.