When setting a cache path also enable the cache implicitly.
[Rockbox.git] / firmware / export / generic_i2c.h
blob5570d940fb75399db6e2a9a0931c91e988746a79
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 by Linus Nielsen Feltzing
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #ifndef _GEN_I2C_
20 #define _GEN_I2C_
22 struct i2c_interface
24 unsigned char address; /* Address of the chip that this interface
25 describes */
27 void (*scl_hi)(void); /* Drive SCL high, might sleep on clk stretch */
28 void (*scl_lo)(void); /* Drive SCL low */
29 void (*sda_hi)(void); /* Drive SDA high */
30 void (*sda_lo)(void); /* Drive SDA low */
31 void (*sda_input)(void); /* Set SDA as input */
32 void (*sda_output)(void); /* Set SDA as output */
33 void (*scl_input)(void); /* Set SCL as input */
34 void (*scl_output)(void); /* Set SCL as output */
35 int (*scl)(void); /* Read SCL, returns 0 or non-zero */
36 int (*sda)(void); /* Read SDA, returns 0 or non-zero */
38 /* These are the delays specified in the I2C specification, the
39 time pairs to the right are the minimum 100kHz and 400kHz specs */
40 void (*delay_hd_sta)(void); /* START SDA hold (tHD:SDA) 4.0us/0.6us */
41 void (*delay_hd_dat)(void); /* SDA hold (tHD:DAT) 5.0us/0us */
42 void (*delay_su_dat)(void); /* SDA setup (tSU:DAT) 250ns/100ns */
43 void (*delay_su_sto)(void); /* STOP setup (tSU:STO) 4.0us/0.6us */
44 void (*delay_su_sta)(void); /* Rep. START setup (tSU:STA) 4.7us/0.6us */
45 void (*delay_thigh)(void); /* SCL high period (tHIGH) 4.0us/0.6us */
48 extern void i2c_add_node(struct i2c_interface *iface);
49 extern int i2c_write_data(int bus_address, int address,
50 const unsigned char* buf, int count);
51 extern int i2c_read_data(int bus_address, int address,
52 unsigned char* buf, int count);
53 #endif