Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
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 i2c2_setbitrate(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 void i2c0_ev_isr(void)
45 {
46 }
47 
48 void i2c0_er_isr(void)
49 {
50 }
51 #endif
52 
53 #if USE_I2C1
54 struct i2c_errors i2c1_errors;
55 
56 void i2c1_hw_init(void)
57 {
58  i2c1.errors = &i2c1_errors;
59  ZEROS_ERR_COUNTER(i2c1_errors);
60 }
61 
62 void i2c1_ev_isr(void)
63 {
64 }
65 
66 void i2c1_er_isr(void)
67 {
68 }
69 #endif
70 
71 #if USE_I2C2
72 struct i2c_errors i2c2_errors;
73 
74 void i2c2_hw_init(void)
75 {
76  i2c2.errors = &i2c2_errors;
77  ZEROS_ERR_COUNTER(i2c2_errors);
78 }
79 
80 void i2c2_ev_isr(void)
81 {
82 }
83 
84 void i2c2_er_isr(void)
85 {
86 }
87 #endif
I2C errors counter.
Definition: i2c.h:154
bool i2c_idle(struct i2c_periph *p)
i2c_idle() 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:316
void i2c2_setbitrate(int bitrate)
Definition: i2c_arch.c:33
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:289
Architecture independent I2C (Inter-Integrated Circuit Bus) API.