From: asterix Date: Tue, 27 Jul 2010 12:22:54 +0000 (+0000) Subject: Add some header to use new i2c api. X-Git-Tag: 2.6.0~288^2~18 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=fc2c568e819946af2e88fbdbd8d1ac160a61c908;p=bertos.git Add some header to use new i2c api. git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4077 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/cortex-m3/drv/i2c_cm3.h b/bertos/cpu/cortex-m3/drv/i2c_cm3.h new file mode 100644 index 00000000..956d1655 --- /dev/null +++ b/bertos/cpu/cortex-m3/drv/i2c_cm3.h @@ -0,0 +1,49 @@ +/** + * \file + * + * + * \brief Low-level I2C module for ARM Cortex-m3 (interface). + * + * \author Daniele Basile + * + */ + +#include + +#if CPU_CM3_LM3S + #include "i2c_lm3s.h" +#elif CPU_CM3_STM32 + #include "i2c_stm32.h" +/*#elif Add other Cortex-M3 CPUs here */ +#else + #error Unknown CPU +#endif + diff --git a/bertos/cpu/cortex-m3/drv/i2c_stm32.h b/bertos/cpu/cortex-m3/drv/i2c_stm32.h new file mode 100644 index 00000000..f29c1531 --- /dev/null +++ b/bertos/cpu/cortex-m3/drv/i2c_stm32.h @@ -0,0 +1,55 @@ +/** + * \file + * + * + * \brief Driver for the STM32F103xx I2C (interface) + * + */ + +#ifndef I2C_STM32_H +#define I2C_STM32_H + +#include + +/** + * \name I2C devices enum + */ +enum +{ + I2C1, + I2C2, + + I2C_CNT /**< Number of serial ports */ +}; + +void i2c_hw_init(I2c *i2c, int dev, uint32_t clock); + +#endif /* I2C_LPC2_H */