X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fcortex-m3%2Fio%2Fstm32_i2c.h;h=1f6b3adb76c90c451fca5f714940446b7ad4ab4a;hb=ec47d0bd8a351e1f32e1e32b83d2cdb2f5134a04;hp=56f265404e37e9e693e48b6939d272ff04c02a9d;hpb=b7e2d109273eea51248e355f56abb36b0b9018d6;p=bertos.git diff --git a/bertos/cpu/cortex-m3/io/stm32_i2c.h b/bertos/cpu/cortex-m3/io/stm32_i2c.h index 56f26540..1f6b3adb 100644 --- a/bertos/cpu/cortex-m3/io/stm32_i2c.h +++ b/bertos/cpu/cortex-m3/io/stm32_i2c.h @@ -239,11 +239,33 @@ /* I2C CCR mask */ #define CCR_CCR_SET ((uint16_t)0x0FFF) + +/* I2C CR1 */ +#define CR1_POS 11 + /* I2C Status */ -#define SR1_BUSY 1 -#define SR1_MSL 0 +#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 +#define SR1_BTF 2 +#define SR1_SB 0 + +#define SR2_TRA 2 +#define SR2_BUSY 1 +#define SR2_MSL 0 + + +#define SR1_ERR_MASK (BV(SR1_PECERR) | \ + BV(SR1_OVR) | \ + BV(SR1_AF) | \ + BV(SR1_ARLO) | \ + BV(SR1_BERR)) -#define SR2_SB 0 struct stm32_i2c