summaryrefslogtreecommitdiff
path: root/firmware/drivers/i2c.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-06-24 10:34:24 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-06-24 10:34:24 +0000
commitb922a96ae3c6fb7e117923512108a4b3056469c1 (patch)
treebf736ebb8bcb7b246393d9ff97d6b403d283c3a0 /firmware/drivers/i2c.c
parent6a6217a2e580c7fa6cdfe90763d52c3a399d563a (diff)
downloadrockbox-b922a96ae3c6fb7e117923512108a4b3056469c1.tar.gz
rockbox-b922a96ae3c6fb7e117923512108a4b3056469c1.zip
Added functions for exclusive I2C access
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1144 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/i2c.c')
-rw-r--r--firmware/drivers/i2c.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/drivers/i2c.c b/firmware/drivers/i2c.c
index 5aa822e83b..ccd11e01de 100644
--- a/firmware/drivers/i2c.c
+++ b/firmware/drivers/i2c.c
@@ -41,6 +41,18 @@
41/* arbitrary delay loop */ 41/* arbitrary delay loop */
42#define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0) 42#define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0)
43 43
44static struct mutex i2c_mtx;
45
46void i2c_begin(void)
47{
48 mutex_lock(&i2c_mtx);
49}
50
51void i2c_end(void)
52{
53 mutex_unlock(&i2c_mtx);
54}
55
44void i2c_start(void) 56void i2c_start(void)
45{ 57{
46 SDA_OUTPUT; 58 SDA_OUTPUT;