aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/i2c_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/templates/i2c_lld.h')
-rw-r--r--os/hal/templates/i2c_lld.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/os/hal/templates/i2c_lld.h b/os/hal/templates/i2c_lld.h
index 77c67cc07..bf7a64082 100644
--- a/os/hal/templates/i2c_lld.h
+++ b/os/hal/templates/i2c_lld.h
@@ -46,6 +46,12 @@
/* Driver data structures and types. */
/*===========================================================================*/
+
+/**
+ * @brief Type of a structure representing an I2C driver.
+ */
+typedef struct I2CDriver I2CDriver;
+
/**
* @brief I2C completion callback type.
*
@@ -70,15 +76,18 @@ typedef struct {
* @note Implementations may extend this structure to contain more,
* architecture dependent, fields.
*/
-typedef struct {
+struct I2CDriver {
/** @brief Driver state.*/
i2cstate_t id_state;
/** @brief Current configuration data.*/
const I2CConfig *id_config;
/** @brief Current callback.*/
i2ccallback_t id_callback;
+#if defined(I2C_DRIVER_EXT_FIELDS)
+ I2C_DRIVER_EXT_FIELDS
+#endif
/* End of the mandatory fields.*/
-} I2CDriver;
+};
/*===========================================================================*/
/* Driver macros. */