From fc2c568e819946af2e88fbdbd8d1ac160a61c908 Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 27 Jul 2010 12:22:54 +0000 Subject: [PATCH] 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 --- bertos/cpu/cortex-m3/drv/i2c_cm3.h | 49 +++++++++++++++++++++++++ bertos/cpu/cortex-m3/drv/i2c_stm32.h | 55 ++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 bertos/cpu/cortex-m3/drv/i2c_cm3.h create mode 100644 bertos/cpu/cortex-m3/drv/i2c_stm32.h 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 */ -- 2.25.1