diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2010-06-21 21:41:07 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2010-06-21 21:41:07 +0000 |
commit | 206227096477f328dfe16fee2d9ec13d631bd6e6 (patch) | |
tree | 0edd9336df4bb217186aa7799a522d3cacebc4f9 /firmware/export/generic_i2c.h | |
parent | 06b9064205d3e8aaf7f743fb1486733dd369ce1c (diff) | |
download | rockbox-206227096477f328dfe16fee2d9ec13d631bd6e6.tar.gz rockbox-206227096477f328dfe16fee2d9ec13d631bd6e6.zip |
Apply FS #11423 - Use udelay in AMS driver for FM radio I2C
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27035 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/generic_i2c.h')
-rw-r--r-- | firmware/export/generic_i2c.h | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/firmware/export/generic_i2c.h b/firmware/export/generic_i2c.h index 6679b78415..f71736acf0 100644 --- a/firmware/export/generic_i2c.h +++ b/firmware/export/generic_i2c.h | |||
@@ -21,27 +21,26 @@ | |||
21 | #ifndef _GEN_I2C_ | 21 | #ifndef _GEN_I2C_ |
22 | #define _GEN_I2C_ | 22 | #define _GEN_I2C_ |
23 | 23 | ||
24 | #include <stdbool.h> | ||
25 | |||
24 | struct i2c_interface | 26 | struct i2c_interface |
25 | { | 27 | { |
26 | void (*scl_hi)(void); /* Drive SCL high, might sleep on clk stretch */ | 28 | void (*scl_dir)(bool out); /* Set SCL as input or output */ |
27 | void (*scl_lo)(void); /* Drive SCL low */ | 29 | void (*sda_dir)(bool out); /* Set SDA as input or output */ |
28 | void (*sda_hi)(void); /* Drive SDA high */ | 30 | void (*scl_out)(bool high); /* Drive SCL, might sleep on clk stretch */ |
29 | void (*sda_lo)(void); /* Drive SDA low */ | 31 | void (*sda_out)(bool high); /* Drive SDA */ |
30 | void (*sda_input)(void); /* Set SDA as input */ | 32 | bool (*scl_in)(void); /* Read SCL, returns true if high */ |
31 | void (*sda_output)(void); /* Set SDA as output */ | 33 | bool (*sda_in)(void); /* Read SDA, returns true if high */ |
32 | void (*scl_input)(void); /* Set SCL as input */ | 34 | void (*delay)(int delay); /* Delay for the specified amount */ |
33 | void (*scl_output)(void); /* Set SCL as output */ | 35 | |
34 | int (*scl)(void); /* Read SCL, returns 0 or non-zero */ | ||
35 | int (*sda)(void); /* Read SDA, returns 0 or non-zero */ | ||
36 | |||
37 | /* These are the delays specified in the I2C specification, the | 36 | /* These are the delays specified in the I2C specification, the |
38 | time pairs to the right are the minimum 100kHz and 400kHz specs */ | 37 | time pairs to the right are the minimum 100kHz and 400kHz specs */ |
39 | void (*delay_hd_sta)(void); /* START SDA hold (tHD:SDA) 4.0us/0.6us */ | 38 | int delay_hd_sta; /* START SDA hold (tHD:SDA) 4.0us/0.6us */ |
40 | void (*delay_hd_dat)(void); /* SDA hold (tHD:DAT) 5.0us/0us */ | 39 | int delay_hd_dat; /* SDA hold (tHD:DAT) 5.0us/0us */ |
41 | void (*delay_su_dat)(void); /* SDA setup (tSU:DAT) 250ns/100ns */ | 40 | int delay_su_dat; /* SDA setup (tSU:DAT) 250ns/100ns */ |
42 | void (*delay_su_sto)(void); /* STOP setup (tSU:STO) 4.0us/0.6us */ | 41 | int delay_su_sto; /* STOP setup (tSU:STO) 4.0us/0.6us */ |
43 | void (*delay_su_sta)(void); /* Rep. START setup (tSU:STA) 4.7us/0.6us */ | 42 | int delay_su_sta; /* Rep. START setup (tSU:STA) 4.7us/0.6us */ |
44 | void (*delay_thigh)(void); /* SCL high period (tHIGH) 4.0us/0.6us */ | 43 | int delay_thigh; /* SCL high period (tHIGH) 4.0us/0.6us */ |
45 | }; | 44 | }; |
46 | 45 | ||
47 | int i2c_add_node(const struct i2c_interface *iface); | 46 | int i2c_add_node(const struct i2c_interface *iface); |