aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/KINETIS/LLD/hal_i2c_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/KINETIS/LLD/hal_i2c_lld.h')
-rw-r--r--os/hal/ports/KINETIS/LLD/hal_i2c_lld.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/os/hal/ports/KINETIS/LLD/hal_i2c_lld.h b/os/hal/ports/KINETIS/LLD/hal_i2c_lld.h
index a7214c5..3576b60 100644
--- a/os/hal/ports/KINETIS/LLD/hal_i2c_lld.h
+++ b/os/hal/ports/KINETIS/LLD/hal_i2c_lld.h
@@ -34,7 +34,11 @@
#define STATE_STOP 0x00
#define STATE_SEND 0x01
#define STATE_RECV 0x02
-#define STATE_DUMMY 0x03
+
+#if defined(KL27Zxxx) || defined(KL27Zxx) /* KL27Z RST workaround */
+#define RSTA_WORKAROUND_OFF 0x00
+#define RSTA_WORKAROUND_ON 0x01
+#endif /* KL27Z RST workaround */
/*===========================================================================*/
/* Driver pre-compile time settings. */
@@ -77,6 +81,13 @@
#define KINETIS_I2C_I2C1_PRIORITY 12
#endif
+/**
+ * @brief Timeout for external clearing BUSY bus (in ms).
+ */
+#if !defined(KINETIS_I2C_BUSY_TIMEOUT) || defined(__DOXYGEN__)
+#define KINETIS_I2C_BUSY_TIMEOUT 50
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
@@ -181,6 +192,10 @@ struct I2CDriver {
intstate_t intstate;
/* @brief Low-level register access. */
I2C_TypeDef *i2c;
+#if defined(KL27Zxxx) || defined(KL27Zxx) /* KL27Z RST workaround */
+ /* @brief Auxiliary variable for KL27Z repeated start workaround. */
+ intstate_t rsta_workaround;
+#endif /* KL27Z RST workaround */
};
/*===========================================================================*/