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