From a672c20aa703dc23a672884a7c250da0f58fd1e0 Mon Sep 17 00:00:00 2001 From: asterix Date: Wed, 7 Jul 2010 16:06:44 +0000 Subject: [PATCH] Add status registry defines. git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4005 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/cortex-m3/io/stm32_i2c.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bertos/cpu/cortex-m3/io/stm32_i2c.h b/bertos/cpu/cortex-m3/io/stm32_i2c.h index 0ac30694..1f6b3adb 100644 --- a/bertos/cpu/cortex-m3/io/stm32_i2c.h +++ b/bertos/cpu/cortex-m3/io/stm32_i2c.h @@ -239,7 +239,16 @@ /* I2C CCR mask */ #define CCR_CCR_SET ((uint16_t)0x0FFF) + +/* I2C CR1 */ +#define CR1_POS 11 + /* I2C Status */ +#define SR1_PECERR 12 +#define SR1_OVR 11 +#define SR1_AF 10 +#define SR1_ARLO 9 +#define SR1_BERR 8 #define SR1_TXE 7 #define SR1_RXE 6 #define SR1_ADDR 1 @@ -251,6 +260,12 @@ #define SR2_MSL 0 +#define SR1_ERR_MASK (BV(SR1_PECERR) | \ + BV(SR1_OVR) | \ + BV(SR1_AF) | \ + BV(SR1_ARLO) | \ + BV(SR1_BERR)) + struct stm32_i2c -- 2.25.1