Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'include/libopencm3/stm32/common/i2c_common_v2.h')
-rw-r--r--include/libopencm3/stm32/common/i2c_common_v2.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/libopencm3/stm32/common/i2c_common_v2.h b/include/libopencm3/stm32/common/i2c_common_v2.h
index c5f5bafe..cd311064 100644
--- a/include/libopencm3/stm32/common/i2c_common_v2.h
+++ b/include/libopencm3/stm32/common/i2c_common_v2.h
@@ -43,6 +43,9 @@ specific memorymap.h header before including this header file.*/
* @{*/
#define I2C1 I2C1_BASE
#define I2C2 I2C2_BASE
+#ifdef I2C3_BASE
+#define I2C3 I2C3_BASE
+#endif
/**@}*/
/* --- I2C registers ------------------------------------------------------- */
@@ -102,6 +105,19 @@ specific memorymap.h header before including this header file.*/
#define I2C1_TXDR I2C_TXDR(I2C1)
#define I2C2_TXDR I2C_TXDR(I2C2)
+/* Not all parts have i2c3 */
+#ifdef I2C3_BASE
+#define I2C3_CR1 I2C_CR1(I2C3)
+#define I2C3_CR2 I2C_CR2(I2C3)
+#define I2C3_OAR1 I2C_OAR1(I2C3)
+#define I2C3_OAR2 I2C_OAR2(I2C3)
+#define I2C3_DR I2C_DR(I2C3)
+#define I2C3_SR1 I2C_SR1(I2C3)
+#define I2C3_SR2 I2C_SR2(I2C3)
+#define I2C3_CCR I2C_CCR(I2C3)
+#define I2C3_TRISE I2C_TRISE(I2C3)
+#endif
+
/* --- I2Cx_CR1 values ----------------------------------------------------- */
/* PECEN: PEC enable */