Implement put function and remove send.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 22 Jul 2010 10:20:01 +0000 (10:20 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 22 Jul 2010 10:20:01 +0000 (10:20 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4046 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/drv/i2c_stm32.c

index 9f782383e2f2cfd92292c4d17e7b8bd52af475de..62f9dafab037cb906bebbcb729edea743f1e1a70 100644 (file)
@@ -175,37 +175,19 @@ void i2c_builtin_stop(void)
 
 bool i2c_builtin_put(const uint8_t data)
 {
-       return true;
-}
+       i2c->DR = data;
+       WAIT_BTF(i2c);
 
-int i2c_builtin_get(bool ack)
-{
+       if(check_i2cStatus(I2C_EVENT_MASTER_BYTE_TRANSMITTED))
+               return true;
 
-       return 0;
+       return false;
 }
 
-bool i2c_send(const void *_buf, size_t count)
+int i2c_builtin_get(bool ack)
 {
-       const uint8_t *buf = (const uint8_t *)_buf;
-
-       i2c->DR = *buf++;
-       count--;
-
 
-       while (count)
-       {
-               ASSERT(buf);
-               WAIT_BTF(i2c);
-
-               i2c->DR = *buf++;
-               count--;
-
-    }
-
-       if(check_i2cStatus(I2C_EVENT_MASTER_BYTE_TRANSMITTED))
-               return true;
-
-       return false;
+       return 0;
 }
 
 /**