git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4046
38d2e660-2303-0410-9eaa-
f027e97ec537
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;
}
/**