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  * 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_t i2c_idle(struct i2c_periph *p __attribute__ ((unused))) { return TRUE; }
31 bool_t 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  i2c0.errors = &i2c0_errors;
40  ZEROS_ERR_COUNTER(i2c0_errors);
41 }
42 
43 void i2c0_ev_isr(void) {
44 }
45 
46 void i2c0_er_isr(void) {
47 }
48 #endif
49 
50 #if USE_I2C1
51 struct i2c_errors i2c1_errors;
52 
53 void i2c1_hw_init(void) {
54  i2c1.errors = &i2c1_errors;
55  ZEROS_ERR_COUNTER(i2c1_errors);
56 }
57 
58 void i2c1_ev_isr(void) {
59 }
60 
61 void i2c1_er_isr(void) {
62 }
63 #endif
64 
65 #if USE_I2C2
66 struct i2c_errors i2c2_errors;
67 
68 void i2c2_hw_init(void) {
69  i2c2.errors = &i2c2_errors;
70  ZEROS_ERR_COUNTER(i2c2_errors);
71 }
72 
73 void i2c2_ev_isr(void) {
74 }
75 
76 void i2c2_er_isr(void) {
77 }
78 #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)
#define ZEROS_ERR_COUNTER(_i2c_err)
Definition: i2c.h:179
CM3_WEAK i2c1_er_isr(void)
CM3_WEAK i2c2_er_isr(void)
void i2c2_setbitrate(int bitrate)
Definition: i2c_arch.c:33
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.