Correction of AVR hal_i2c_lld to respect the project code style.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10020 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
tfateba 2017-01-04 20:34:47 +00:00
parent 1bfb237b48
commit 6a0f53a89e
3 changed files with 36 additions and 32 deletions

View File

@ -20,7 +20,7 @@
*/
/**
* @file AVR/gpt_lld.h
* @file hal_gpt_lld.h
* @brief AVR GPT driver subsystem low level driver.
*
* @addtogroup GPT

View File

@ -15,7 +15,7 @@
*/
/**
* @file AVR/i2c_lld.c
* @file hal_i2c_lld.c
* @brief AVR I2C subsystem low level driver source.
*
* @addtogroup I2C
@ -76,10 +76,12 @@ OSAL_IRQ_HANDLER(TWI_vect) {
if (i2cp->txidx < i2cp->txbytes) {
TWDR = i2cp->txbuf[i2cp->txidx++];
TWCR = ((1 << TWINT) | (1 << TWEN) | (1 << TWIE));
} else {
}
else {
if (i2cp->rxbuf && i2cp->rxbytes) {
TWCR = ((1 << TWSTA) | (1 << TWINT) | (1 << TWEN) | (1 << TWIE));
} else {
}
else {
TWCR = ((1 << TWSTO) | (1 << TWINT) | (1 << TWEN));
_i2c_wakeup_isr(i2cp);
}
@ -88,7 +90,8 @@ OSAL_IRQ_HANDLER(TWI_vect) {
case TWI_MASTER_RX_ADDR_ACK:
if (i2cp->rxidx == (i2cp->rxbytes - 1)) {
TWCR = ((1 << TWINT) | (1 << TWEN) | (1 << TWIE));
} else {
}
else {
TWCR = ((1 << TWEA) | (1 << TWINT) | (1 << TWEN) | (1 << TWIE));
}
break;
@ -96,7 +99,8 @@ OSAL_IRQ_HANDLER(TWI_vect) {
i2cp->rxbuf[i2cp->rxidx++] = TWDR;
if (i2cp->rxidx == (i2cp->rxbytes - 1)) {
TWCR = ((1 << TWINT) | (1 << TWEN) | (1 << TWIE));
} else {
}
else {
TWCR = ((1 << TWEA) | (1 << TWINT) | (1 << TWEN) | (1 << TWIE));
}
break;
@ -147,7 +151,7 @@ void i2c_lld_init(void) {
/**
* @brief Configures and activates the I2C peripheral.
*
* @param[in] i2cp pointer to the @p I2CDriver object
* @param[in] i2cp pointer to the @p I2CDriver object
*
* @notapi
*/
@ -169,7 +173,7 @@ void i2c_lld_start(I2CDriver *i2cp) {
/**
* @brief Deactivates the I2C peripheral.
*
* @param[in] i2cp pointer to the @p I2CDriver object
* @param[in] i2cp pointer to the @p I2CDriver object
*
* @notapi
*/
@ -184,14 +188,14 @@ void i2c_lld_stop(I2CDriver *i2cp) {
/**
* @brief Receives data via the I2C bus as master.
*
* @param[in] i2cp pointer to the @p I2CDriver object
* @param[in] addr slave device address
* @param[out] rxbuf pointer to the receive buffer
* @param[in] rxbytes number of bytes to be received
* @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_INFINITE no timeout.
* .
* @param[in] i2cp pointer to the @p I2CDriver object
* @param[in] addr slave device address
* @param[out] rxbuf pointer to the receive buffer
* @param[in] rxbytes number of bytes to be received
* @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_INFINITE no timeout.
*
* @return The operation status.
* @retval MSG_OK if the function succeeded.
* @retval MSG_RESET if one or more I2C errors occurred, the errors can
@ -223,16 +227,16 @@ msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, i2caddr_t addr,
/**
* @brief Transmits data via the I2C bus as master.
*
* @param[in] i2cp pointer to the @p I2CDriver object
* @param[in] addr slave device address
* @param[in] txbuf pointer to the transmit buffer
* @param[in] txbytes number of bytes to be transmitted
* @param[out] rxbuf pointer to the receive buffer
* @param[in] rxbytes number of bytes to be received
* @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_INFINITE no timeout.
* .
* @param[in] i2cp pointer to the @p I2CDriver object
* @param[in] addr slave device address
* @param[in] txbuf pointer to the transmit buffer
* @param[in] txbytes number of bytes to be transmitted
* @param[out] rxbuf pointer to the receive buffer
* @param[in] rxbytes number of bytes to be received
* @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_INFINITE no timeout.
*
* @return The operation status.
* @retval MSG_OK if the function succeeded.
* @retval MSG_RESET if one or more I2C errors occurred, the errors can

View File

@ -15,7 +15,7 @@
*/
/**
* @file AVR/i2c_lld.h
* @file hal_i2c_lld.h
* @brief AVR I2C subsystem low level driver header.
*
* @addtogroup I2C
@ -67,9 +67,9 @@
* @{
*/
/**
* @brief I2C driver enable switch.
* @details If set to @p TRUE the support for I2C is included.
* @note The default is @p FALSE.
* @brief I2C driver enable switch.
* @details If set to @p TRUE the support for I2C is included.
* @note The default is @p FALSE.
*/
#if !defined(AVR_I2C_USE_I2C1) || defined(__DOXYGEN__)
#define AVR_I2C_USE_I2C1 FALSE
@ -109,7 +109,7 @@ typedef struct {
} I2CConfig;
/**
* @brief Structure representing an I2C driver.
* @brief Structure representing an I2C driver.
*/
struct I2CDriver {
/**
@ -180,7 +180,7 @@ typedef struct I2CDriver I2CDriver;
/**
* @brief Get errors from I2C driver.
*
* @param[in] i2cp pointer to the @p I2CDriver object
* @param[in] i2cp pointer to the @p I2CDriver object
*
* @notapi
*/