From ae96279b0aa99d73b9c7cfe9b1129eed845813ce Mon Sep 17 00:00:00 2001
From: Emilio Corigliano <emilio.corigliano@skywarder.eu>
Date: Sat, 4 Nov 2023 09:37:59 +0000
Subject: [PATCH] [I2C] I2CSlaveConfig now has default parameters

---
 src/shared/drivers/i2c/I2CDriver.h | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/shared/drivers/i2c/I2CDriver.h b/src/shared/drivers/i2c/I2CDriver.h
index 159a288c5..fee1e0531 100644
--- a/src/shared/drivers/i2c/I2CDriver.h
+++ b/src/shared/drivers/i2c/I2CDriver.h
@@ -102,14 +102,19 @@ public:
      */
     typedef struct
     {
-        uint16_t
-            slaveAddress;  ///< Slave address without shifts (in BIT7 addressing
-                           ///< |9-bit unused|7-bit address|; in BIT10
-                           ///< addressing |6-bit unused|10-bit address|).
-        I2CDriver::Addressing addressing;  ///< Addressing mode of the device.
-        I2CDriver::Speed speed;            ///< Speed mode of the communication.
-        bool MSBFirst;  ///< Registers with lower values are the MSB of
-                        ///< multi-byte registers
+        ///< Slave address without shifts:
+        ///< - BIT7 addressing  |9-bit unused|7-bit address|
+        ///< - BIT10 addressing |6-bit unused|10-bit address|
+        uint16_t slaveAddress;
+
+        ///< Addressing mode of the device.
+        I2CDriver::Addressing addressing = I2CDriver::Addressing::BIT7;
+
+        ///< Speed mode of the communication.
+        I2CDriver::Speed speed = I2CDriver::Speed::MAX_SPEED;
+
+        ///< Registers with lower values are the MSB of multi-byte registers
+        bool MSBFirst = false;
     } I2CSlaveConfig;
 
     /**
-- 
GitLab