Add definition for generic send and recv.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 26 Jul 2010 14:01:19 +0000 (14:01 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 26 Jul 2010 14:01:19 +0000 (14:01 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4067 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/i2c.h

index f527f359d19d375998633260ba90453e65ea600a..75fb54a51ed1b2e7e1cec744c3afdc10cb9b8dbe 100644 (file)
 
 #include "cfg/cfg_i2c.h"
 
+#define LOG_LEVEL  I2C_LOG_LEVEL
+#define LOG_FORMAT I2C_LOG_FORMAT
+
+#include <cfg/log.h>
+
 #include <cfg/compiler.h>
 #include <cfg/macros.h>
 #include <cfg/debug.h>
@@ -180,6 +185,9 @@ typedef struct I2c
 
 #include CPU_HEADER(i2c)
 
+void i2c_swSend(struct I2c *i2c, const void *_buf, size_t count);
+void i2c_swRecv(struct I2c *i2c, void *_buf, size_t count);
+
 INLINE void i2c_start(I2c *i2c, uint16_t slave_addr, size_t size)
 {
        ASSERT(i2c->vt);
@@ -283,6 +291,12 @@ INLINE int i2c_error(I2c *i2c)
        ASSERT(i2c);
        int err = i2c->errors;
        i2c->errors = 0;
+
+       LOG_ERRB(
+               if (err)
+                       LOG_ERR("err[%02x]\n", err);
+       );
+
        return err;
 }