aboutsummaryrefslogtreecommitdiff
path: root/core/include/drivers/stm32_i2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/drivers/stm32_i2c.h')
-rw-r--r--core/include/drivers/stm32_i2c.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/include/drivers/stm32_i2c.h b/core/include/drivers/stm32_i2c.h
index ac0ea225..6efcf00e 100644
--- a/core/include/drivers/stm32_i2c.h
+++ b/core/include/drivers/stm32_i2c.h
@@ -14,6 +14,23 @@
#include <types_ext.h>
/*
+ * I2C specification values as per version 6.0, 4th of April 2014 [1],
+ * table 10 page 48: Characteristics of the SDA and SCL bus lines for
+ * Standard, Fast, and Fast-mode Plus I2C-bus devices.
+ *
+ * [1] https://www.nxp.com/docs/en/user-guide/UM10204.pdf
+ */
+enum i2c_speed_e {
+ I2C_SPEED_STANDARD, /* 100 kHz */
+ I2C_SPEED_FAST, /* 400 kHz */
+ I2C_SPEED_FAST_PLUS, /* 1 MHz */
+};
+
+#define I2C_STANDARD_RATE 100000
+#define I2C_FAST_RATE 400000
+#define I2C_FAST_PLUS_RATE 1000000
+
+/*
* Initialization configuration structure for the STM32 I2C bus.
* Refer to the SoC Reference Manual for more details on configuration items.
*