diff --git a/os/hal/lib/fallback/I2C/hal_i2c_lld.h b/os/hal/lib/fallback/I2C/hal_i2c_lld.h index 38c1552e8..862a4d3d2 100644 --- a/os/hal/lib/fallback/I2C/hal_i2c_lld.h +++ b/os/hal/lib/fallback/I2C/hal_i2c_lld.h @@ -110,9 +110,9 @@ typedef uint8_t i2cflags_t; typedef void (*i2c_delay_t)(void); /** - * @brief Type of I2C driver configuration structure. + * @brief I2C driver configuration structure. */ -typedef struct { +struct hal_i2c_config { /** * @brief 10 bits addressing switch. */ @@ -136,17 +136,22 @@ typedef struct { */ i2c_delay_t delay; #endif -} I2CConfig; +}; + +/** + * @brief Type of a structure representing an I2C configuration. + */ +typedef struct hal_i2c_config I2CConfig; /** * @brief Type of a structure representing an I2C driver. */ -typedef struct I2CDriver I2CDriver; +typedef struct hal_i2c_driver I2CDriver; /** * @brief Structure representing an I2C driver. */ -struct I2CDriver { +struct hal_i2c_driver { /** * @brief Driver state. */ diff --git a/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.h b/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.h index b1a663022..3e31154ef 100644 --- a/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.h +++ b/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.h @@ -99,19 +99,24 @@ typedef uint8_t i2cflags_t; * @note Implementations may extend this structure to contain more, * architecture dependent, fields. */ -typedef struct { +struct hal_i2c_config { /** * @brief Specifies the I2C clock frequency. */ uint32_t clock_speed; -} I2CConfig; +}; + +/** + * @brief Type of a structure representing an I2C configuration. + */ +typedef struct hal_i2c_config I2CConfig; /** * @brief Structure representing an I2C driver. */ -struct I2CDriver { +struct hal_i2c_driver { /** * @brief Driver state. */ @@ -171,7 +176,7 @@ struct I2CDriver { /** * @brief Type of a structure representing an I2C driver. */ -typedef struct I2CDriver I2CDriver; +typedef struct hal_i2c_driver I2CDriver; /*==========================================================================*/ /* Driver macros. */ diff --git a/os/hal/ports/RP/LLD/I2Cv1/hal_i2c_lld.h b/os/hal/ports/RP/LLD/I2Cv1/hal_i2c_lld.h index 0e85ce624..2516d9acc 100644 --- a/os/hal/ports/RP/LLD/I2Cv1/hal_i2c_lld.h +++ b/os/hal/ports/RP/LLD/I2Cv1/hal_i2c_lld.h @@ -68,24 +68,29 @@ typedef uint16_t i2caddr_t; typedef uint32_t i2cflags_t; /** - * @brief Type of I2C driver configuration structure. + * @brief I2C driver configuration structure. * @note Implementations may extend this structure to contain more, * architecture dependent, fields. */ -typedef struct { +struct hal_i2c_config { /* End of the mandatory fields.*/ uint32_t dummy; -} I2CConfig; +}; + +/** + * @brief Type of a structure representing an I2C configuration. + */ +typedef struct hal_i2c_config I2CConfig; /** * @brief Type of a structure representing an I2C driver. */ -typedef struct I2CDriver I2CDriver; +typedef struct hal_i2c_driver I2CDriver; /** * @brief Structure representing an I2C driver. */ -struct I2CDriver { +struct hal_i2c_driver { /** * @brief Driver state. */ diff --git a/os/hal/ports/STM32/LLD/I2Cv1/hal_i2c_lld.h b/os/hal/ports/STM32/LLD/I2Cv1/hal_i2c_lld.h index 1328d4768..81a8532f7 100644 --- a/os/hal/ports/STM32/LLD/I2Cv1/hal_i2c_lld.h +++ b/os/hal/ports/STM32/LLD/I2Cv1/hal_i2c_lld.h @@ -385,9 +385,9 @@ typedef enum { } i2cdutycycle_t; /** - * @brief Type of I2C driver configuration structure. + * @brief I2C driver configuration structure. */ -typedef struct { +struct hal_i2c_config { /* End of the mandatory fields.*/ i2copmode_t op_mode; /**< @brief Specifies the I2C mode. */ uint32_t clock_speed; /**< @brief Specifies the clock frequency. @@ -395,17 +395,22 @@ typedef struct { than 400kHz. */ i2cdutycycle_t duty_cycle; /**< @brief Specifies the I2C fast mode duty cycle. */ -} I2CConfig; +}; + +/** + * @brief Type of a structure representing an I2C configuration. + */ +typedef struct hal_i2c_config I2CConfig; /** * @brief Type of a structure representing an I2C driver. */ -typedef struct I2CDriver I2CDriver; +typedef struct hal_i2c_driver I2CDriver; /** * @brief Structure representing an I2C driver. */ -struct I2CDriver { +struct hal_i2c_driver { /** * @brief Driver state. */ diff --git a/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.h b/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.h index b1004e793..6fa7ac91a 100644 --- a/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.h +++ b/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.h @@ -355,9 +355,9 @@ typedef uint16_t i2caddr_t; typedef uint32_t i2cflags_t; /** - * @brief Type of I2C driver configuration structure. + * @brief I2C driver configuration structure. */ -typedef struct { +struct hal_i2c_config { /** * @brief TIMINGR register initialization. * @note Refer to the STM32 reference manual, the values are affected @@ -374,17 +374,22 @@ typedef struct { * @note Only the ADD10 bit can eventually be specified here. */ uint32_t cr2; -} I2CConfig; +}; + +/** + * @brief Type of a structure representing an I2C configuration. + */ +typedef struct hal_i2c_config I2CConfig; /** * @brief Type of a structure representing an I2C driver. */ -typedef struct I2CDriver I2CDriver; +typedef struct hal_i2c_driver I2CDriver; /** * @brief Structure representing an I2C driver. */ -struct I2CDriver { +struct hal_i2c_driver { /** * @brief Driver state. */ diff --git a/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.h b/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.h index ee29a4e0c..36a0c6a1c 100644 --- a/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.h +++ b/os/hal/ports/STM32/LLD/I2Cv3/hal_i2c_lld.h @@ -413,9 +413,9 @@ typedef uint16_t i2caddr_t; typedef uint32_t i2cflags_t; /** - * @brief Type of I2C driver configuration structure. + * @brief I2C driver configuration structure. */ -typedef struct { +struct hal_i2c_config { /** * @brief TIMINGR register initialization. * @note Refer to the STM32 reference manual, the values are affected @@ -432,17 +432,22 @@ typedef struct { * @note Only the ADD10 bit can eventually be specified here. */ uint32_t cr2; -} I2CConfig; +}; + +/** + * @brief Type of a structure representing an I2C configuration. + */ +typedef struct hal_i2c_config I2CConfig; /** * @brief Type of a structure representing an I2C driver. */ -typedef struct I2CDriver I2CDriver; +typedef struct hal_i2c_driver I2CDriver; /** * @brief Structure representing an I2C driver. */ -struct I2CDriver { +struct hal_i2c_driver { /** * @brief Driver state. */ diff --git a/os/hal/templates/hal_i2c_lld.h b/os/hal/templates/hal_i2c_lld.h index a1148062c..c1b1e615f 100644 --- a/os/hal/templates/hal_i2c_lld.h +++ b/os/hal/templates/hal_i2c_lld.h @@ -68,24 +68,29 @@ typedef uint16_t i2caddr_t; typedef uint32_t i2cflags_t; /** - * @brief Type of I2C driver configuration structure. + * @brief I2C driver configuration structure. * @note Implementations may extend this structure to contain more, * architecture dependent, fields. */ -typedef struct { +struct hal_i2c_config { /* End of the mandatory fields.*/ uint32_t dummy; -} I2CConfig; +}; + +/** + * @brief Type of a structure representing an I2C configuration. + */ +typedef struct hal_i2c_config I2CConfig; /** * @brief Type of a structure representing an I2C driver. */ -typedef struct I2CDriver I2CDriver; +typedef struct hal_i2c_driver I2CDriver; /** * @brief Structure representing an I2C driver. */ -struct I2CDriver { +struct hal_i2c_driver { /** * @brief Driver state. */