aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/i2c_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/templates/i2c_lld.c')
-rw-r--r--os/hal/templates/i2c_lld.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/os/hal/templates/i2c_lld.c b/os/hal/templates/i2c_lld.c
index 318686b27..7cf8d1adf 100644
--- a/os/hal/templates/i2c_lld.c
+++ b/os/hal/templates/i2c_lld.c
@@ -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,14 +15,13 @@
*/
/**
- * @file templates/i2c_lld.c
- * @brief I2C Driver subsystem low level driver source template.
+ * @file i2c_lld.c
+ * @brief PLATFORM I2C subsystem low level driver source.
*
* @addtogroup I2C
* @{
*/
-#include "ch.h"
#include "hal.h"
#if HAL_USE_I2C || defined(__DOXYGEN__)
@@ -87,7 +86,6 @@ void i2c_lld_start(I2CDriver *i2cp) {
}
#endif /* PLATFORM_I2C_USE_I2C1 */
}
- /* Configures the peripheral.*/
}
@@ -101,7 +99,6 @@ void i2c_lld_start(I2CDriver *i2cp) {
void i2c_lld_stop(I2CDriver *i2cp) {
if (i2cp->state != I2C_STOP) {
- /* Resets the peripheral.*/
/* Disables the peripheral.*/
#if PLATFORM_I2C_USE_I2C1
@@ -114,8 +111,6 @@ void i2c_lld_stop(I2CDriver *i2cp) {
/**
* @brief Receives data via the I2C bus as master.
- * @details Number of receiving bytes must be more than 1 on STM32F1x. This is
- * hardware restriction.
*
* @param[in] i2cp pointer to the @p I2CDriver object
* @param[in] addr slave device address
@@ -126,10 +121,10 @@ void i2c_lld_stop(I2CDriver *i2cp) {
* - @a TIME_INFINITE no timeout.
* .
* @return The operation status.
- * @retval RDY_OK if the function succeeded.
- * @retval RDY_RESET if one or more I2C errors occurred, the errors can
+ * @retval MSG_OK if the function succeeded.
+ * @retval MSG_RESET if one or more I2C errors occurred, the errors can
* be retrieved using @p i2cGetErrors().
- * @retval RDY_TIMEOUT if a timeout occurred before operation end. <b>After a
+ * @retval MSG_TIMEOUT if a timeout occurred before operation end. <b>After a
* timeout the driver must be stopped and restarted
* because the bus is in an uncertain state</b>.
*
@@ -145,13 +140,11 @@ msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, i2caddr_t addr,
(void)rxbytes;
(void)timeout;
- return RDY_OK;
+ return MSG_OK;
}
/**
* @brief Transmits data via the I2C bus as master.
- * @details Number of receiving bytes must be 0 or more than 1 on STM32F1x.
- * This is hardware restriction.
*
* @param[in] i2cp pointer to the @p I2CDriver object
* @param[in] addr slave device address
@@ -164,10 +157,10 @@ msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, i2caddr_t addr,
* - @a TIME_INFINITE no timeout.
* .
* @return The operation status.
- * @retval RDY_OK if the function succeeded.
- * @retval RDY_RESET if one or more I2C errors occurred, the errors can
+ * @retval MSG_OK if the function succeeded.
+ * @retval MSG_RESET if one or more I2C errors occurred, the errors can
* be retrieved using @p i2cGetErrors().
- * @retval RDY_TIMEOUT if a timeout occurred before operation end. <b>After a
+ * @retval MSG_TIMEOUT if a timeout occurred before operation end. <b>After a
* timeout the driver must be stopped and restarted
* because the bus is in an uncertain state</b>.
*
@@ -186,7 +179,7 @@ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr,
(void)rxbytes;
(void)timeout;
- return RDY_OK;
+ return MSG_OK;
}
#endif /* HAL_USE_I2C */