From 9d180dc662d1f010f5d648fc833868e8bf983e37 Mon Sep 17 00:00:00 2001 From: batt Date: Tue, 11 Nov 2008 18:31:59 +0000 Subject: [PATCH] Add some comments. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1927 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/cfg_i2c.h | 1 + bertos/drv/i2c.h | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/bertos/cfg/cfg_i2c.h b/bertos/cfg/cfg_i2c.h index 23313443..376ad5b9 100644 --- a/bertos/cfg/cfg_i2c.h +++ b/bertos/cfg/cfg_i2c.h @@ -54,6 +54,7 @@ * I2C driver can have 2 backends: * I2C_BACKEND_BUILTIN: Use (if present) the builtin i2c hardware. * I2C_BACKEND_BITBANG: Use the emulated bitbang driver. + * \see drv/i2c.h for more information. */ #define CONFIG_I2C_BACKEND I2C_BACKEND_BUILTIN diff --git a/bertos/drv/i2c.h b/bertos/drv/i2c.h index f07c083d..3d720033 100644 --- a/bertos/drv/i2c.h +++ b/bertos/drv/i2c.h @@ -45,26 +45,48 @@ /** * I2C Backends. + * Sometimes your cpu does not have a builtin + * i2c driver or you don't want, for some reason, to + * use that. + * You can choose, at compile time, which backend to use. * \{ */ #define I2C_BACKEND_BUILTIN 0 ///< Uses cpu builtin i2c driver #define I2C_BACKEND_BITBANG 1 ///< Uses emulated bitbang driver /*\}*/ + +/** + * I2c builtin prototypes. + * Do NOT use these function directly, instead, + * you can call the ones named without "_builtin_" + * and specify in cfg_i2c.h ( \see CONFIG_I2C_BACKEND) + * that you want the builtin backend. + * \{ + */ void i2c_builtin_init(void); bool i2c_builtin_start_w(uint8_t id); bool i2c_builtin_start_r(uint8_t id); void i2c_builtin_stop(void); bool i2c_builtin_put(uint8_t _data); int i2c_builtin_get(bool ack); +/*\}*/ +/** + * I2c bitbang prototypes. + * Same thing here: do NOT use these function directly, instead, + * you can call the ones named without "_bitbang_" + * and specify in cfg_i2c.h ( \see CONFIG_I2C_BACKEND) + * that you want the bitbang backend. + * \{ + */ void i2c_bitbang_init(void); bool i2c_bitbang_start_w(uint8_t id); bool i2c_bitbang_start_r(uint8_t id); void i2c_bitbang_stop(void); bool i2c_bitbang_put(uint8_t _data); int i2c_bitbang_get(bool ack); - +/*\}*/ #if CONFIG_I2C_BACKEND == I2C_BACKEND_BUILTIN #define i2c_init i2c_builtin_init -- 2.25.1