From 07f26e31bbbafac691cab784ab5c4812653a7c98 Mon Sep 17 00:00:00 2001 From: asterix Date: Mon, 26 Jul 2010 14:01:19 +0000 Subject: [PATCH] Add definition for generic send and recv. git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4067 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/i2c.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bertos/drv/i2c.h b/bertos/drv/i2c.h index f527f359..75fb54a5 100644 --- a/bertos/drv/i2c.h +++ b/bertos/drv/i2c.h @@ -45,6 +45,11 @@ #include "cfg/cfg_i2c.h" +#define LOG_LEVEL I2C_LOG_LEVEL +#define LOG_FORMAT I2C_LOG_FORMAT + +#include + #include #include #include @@ -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; } -- 2.25.1