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.h28
1 files changed, 9 insertions, 19 deletions
diff --git a/os/hal/templates/i2c_lld.h b/os/hal/templates/i2c_lld.h
index 83da65c11..7a33acddd 100644
--- a/os/hal/templates/i2c_lld.h
+++ b/os/hal/templates/i2c_lld.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
+ ChibiOS/HAL - Copyright (C) 2006-2014 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
/**
- * @file templates/i2c_lld.h
- * @brief I2C Driver subsystem low level driver header template.
+ * @file i2c_lld.h
+ * @brief PLATFORM I2C subsystem low level driver header.
*
* @addtogroup I2C
* @{
@@ -45,7 +45,7 @@
* @note The default is @p FALSE.
*/
#if !defined(PLATFORM_I2C_USE_I2C1) || defined(__DOXYGEN__)
-#define PLATFORM_I2C_USE_I2C1 FALSE
+#define PLATFORM_I2C_USE_I2C1 FALSE
#endif
/** @} */
@@ -58,7 +58,7 @@
/*===========================================================================*/
/**
- * @brief Type representing I2C address.
+ * @brief Type representing an I2C address.
*/
typedef uint16_t i2caddr_t;
@@ -68,15 +68,12 @@ typedef uint16_t i2caddr_t;
typedef uint32_t i2cflags_t;
/**
- * @brief Driver configuration structure.
+ * @brief Type of I2C driver configuration structure.
* @note Implementations may extend this structure to contain more,
* architecture dependent, fields.
*/
-
-/**
- * @brief Driver configuration structure.
- */
typedef struct {
+ /* End of the mandatory fields.*/
uint32_t dummy;
} I2CConfig;
@@ -86,7 +83,7 @@ typedef struct {
typedef struct I2CDriver I2CDriver;
/**
- * @brief Structure representing an I2C driver.
+ * @brief Structure representing an I2C driver.
*/
struct I2CDriver {
/**
@@ -102,14 +99,7 @@ struct I2CDriver {
*/
i2cflags_t errors;
#if I2C_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__)
-#if CH_USE_MUTEXES || defined(__DOXYGEN__)
- /**
- * @brief Mutex protecting the bus.
- */
- Mutex mutex;
-#elif CH_USE_SEMAPHORES
- Semaphore semaphore;
-#endif
+ mutex_t mutex;
#endif /* I2C_USE_MUTUAL_EXCLUSION */
#if defined(I2C_DRIVER_EXT_FIELDS)
I2C_DRIVER_EXT_FIELDS