[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-9-gcd50d2f
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2009-12-04 09:23:17
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via cd50d2f1669b1fceba7cd4ff4f4240ed251177c2 (commit)
from 46244b562c4cfaf4810117db549962b2ff7ea749 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cd50d2f1669b1fceba7cd4ff4f4240ed251177c2
Author: Fabien Marteau <fab...@ar...>
Date: Fri Dec 4 10:22:36 2009 +0100
[OTHER] suppress warning and conform codings rules
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/c/as_93lcxx.c | 7 ++-
target/packages/as_devices/c/as_93lcxx.h | 40 ++++++++--------
target/packages/as_devices/c/as_spi.c | 32 +++++++-------
target/packages/as_devices/c/as_spi.h | 72 ++++++++++++++++--------------
4 files changed, 79 insertions(+), 72 deletions(-)
diff --git a/target/packages/as_devices/c/as_93lcxx.c b/target/packages/as_devices/c/as_93lcxx.c
index 5f48a1a..86926dc 100644
--- a/target/packages/as_devices/c/as_93lcxx.c
+++ b/target/packages/as_devices/c/as_93lcxx.c
@@ -39,13 +39,14 @@
#define EWDS_ADDR (0)
/* Define timings */
-#define MS (1000)
+#define MS (1000)
+
#define TWC (6*MS)
#define TEC (6*MS)
#define TWL (15*MS)
-
-/** @brief private function to ease making spi instructions
+/** @brief Private functions to ease making spi instructions
+ *
*/
static uint8_t address_len(uint8_t aType, uint8_t aWord_size)
{
diff --git a/target/packages/as_devices/c/as_93lcxx.h b/target/packages/as_devices/c/as_93lcxx.h
index 4e43523..a49a68e 100644
--- a/target/packages/as_devices/c/as_93lcxx.h
+++ b/target/packages/as_devices/c/as_93lcxx.h
@@ -50,29 +50,29 @@ struct as_93lcxx_device {
/** @brief open the device
*
- * @param spidev_filename path to spidev
- * @type type of the eeprom
- * @speed clock speed in Hz
- * @word_size word size for transaction
+ * @param aSpidev_filename path to spidev
+ * @param aType of the eeprom
+ * @param aSpeed clock speed in Hz
+ * @param aWord_size word size for transaction
*
* @return as_93lcxx_device struct pointer on success, NULL on error
*/
struct as_93lcxx_device * as_93lcxx_open(unsigned char *aSpidev_filename,
- uint8_t aType,
- uint32_t aSpeed,
- uint8_t aWord_size);
+ uint8_t aType,
+ uint32_t aSpeed,
+ uint8_t aWord_size);
/** @brief close the device
*
- * @param spidev_filename path to spidev
+ * @param aDev spidev structure
*
*/
void as_93lcxx_close(struct as_93lcxx_device *aDev);
/** @brief read a value in address given
*
- * @param dev 93LCxx structure
- * @param address addresse of register to be read
+ * @param aDev 93LCxx structure
+ * @param aAddress addresse of register to be read
*
* @return positive register value on success, negative value on error.
*/
@@ -81,7 +81,7 @@ int32_t as_93lcxx_read(struct as_93lcxx_device *aDev,
/** @brief enable write on eeprom
*
- * @param dev 93LCxx structure
+ * @param aDev 93LCxx structure
*
* @return positive value on success, negative value on error
*/
@@ -89,8 +89,8 @@ int32_t as_93lcxx_ewen(struct as_93lcxx_device *aDev);
/** @brief Force all data bits of the specified iaddress to 1
*
- * @param dev 93LCxx structure
- * @param address addresse of register to be erased
+ * @param aDev 93LCxx structure
+ * @param aAddress addresse of register to be erased
*
* @return positive register value on success, negative value on error.
*/
@@ -99,7 +99,7 @@ int32_t as_93lcxx_erase(struct as_93lcxx_device *aDev,
/** @brief Force all bits in eeprom to 1
*
- * @param dev 93LCxx structure
+ * @param aDev 93LCxx structure
*
* @return positive register value on success, negative value on error.
*/
@@ -107,9 +107,9 @@ int32_t as_93lcxx_erase_all(struct as_93lcxx_device *aDev);
/** @brief write a value in given address
*
- * @param dev 93LCxx structure
- * @param address addresse of register to be read
- * @param value value to be wrote
+ * @param aDev 93LCxx structure
+ * @param aAddress addresse of register to be read
+ * @param aValue value to be wrote
*
* @return positive register value on success, negative value on error.
*/
@@ -119,8 +119,8 @@ int32_t as_93lcxx_write(struct as_93lcxx_device *aDev,
/** @brief write the entire memory array with value given
*
- * @param dev 93LCxx structure
- * @param value value to be wrote
+ * @param aDev 93LCxx structure
+ * @param aValue value to be wrote
*
* @return positive register value on success, negative value on error.
*/
@@ -129,7 +129,7 @@ int32_t as_93lcxx_write_all(struct as_93lcxx_device *aDev,
/** @brief disable write on eeprom
*
- * @param dev 93LCxx structure
+ * @param aDev 93LCxx structure
*
* @return positive value on success, negative value on error
*/
diff --git a/target/packages/as_devices/c/as_spi.c b/target/packages/as_devices/c/as_spi.c
index 966e0f9..75f6e58 100644
--- a/target/packages/as_devices/c/as_spi.c
+++ b/target/packages/as_devices/c/as_spi.c
@@ -34,11 +34,11 @@
#include "as_spi.h"
-int as_spi_open(const unsigned char *spidev_name)
+int as_spi_open(const unsigned char *aSpidev_name)
{
int fd;
- fd = open((char *)spidev_name, O_RDWR);
+ fd = open((char *)aSpidev_name, O_RDWR);
if (fd < 0) {
perror("open");
return -1;
@@ -47,35 +47,35 @@ int as_spi_open(const unsigned char *spidev_name)
return fd;
}
-int as_spi_set_mode(int fd, uint8_t mode)
+int as_spi_set_mode(int aFd, uint8_t aMode)
{
/* TODO */
return -1;
}
-int as_spi_set_lsb(int fd, uint8_t lsb)
+int as_spi_set_lsb(int aFd, uint8_t aLsb)
{
/* TODO */
return -1;
}
-int as_spi_set_bits_per_word(int fd, uint8_t bits)
+int as_spi_set_bits_per_word(int aFd, uint8_t aBits)
{
/* TODO */
return -1;
}
-int as_spi_set_speed(int fd)
+int as_spi_set_speed(int aFd)
{
/* TODO */
return -1;
}
-int as_spi_get_mode(int fd)
+int as_spi_get_mode(int aFd)
{
uint8_t mode;
- if (ioctl(fd, SPI_IOC_RD_MODE, &mode) < 0) {
+ if (ioctl(aFd, SPI_IOC_RD_MODE, &mode) < 0) {
perror("SPI rd_mode");
return -1;
}
@@ -83,11 +83,11 @@ int as_spi_get_mode(int fd)
return mode;
}
-int as_spi_get_lsb(int fd)
+int as_spi_get_lsb(int aFd)
{
uint8_t lsb;
- if (ioctl(fd, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) {
+ if (ioctl(aFd, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) {
perror("SPI rd_lsb_fist");
return -1;
}
@@ -95,11 +95,11 @@ int as_spi_get_lsb(int fd)
return lsb;
}
-int as_spi_get_bits_per_word(int fd)
+int as_spi_get_bits_per_word(int aFd)
{
uint8_t bits;
- if (ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) {
+ if (ioctl(aFd, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) {
perror("SPI bits_per_word");
return -1;
}
@@ -107,11 +107,11 @@ int as_spi_get_bits_per_word(int fd)
return bits;
}
-int as_spi_get_speed(int fd)
+int as_spi_get_speed(int aFd)
{
uint8_t speed;
- if (ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) {
+ if (ioctl(aFd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) {
perror("SPI max_speed_hz");
return -1;
}
@@ -175,9 +175,9 @@ uint32_t as_spi_msg(int aFd,
return msg;
}
-void as_spi_close(int fd)
+void as_spi_close(int aFd)
{
- close(fd);
+ close(aFd);
return;
}
diff --git a/target/packages/as_devices/c/as_spi.h b/target/packages/as_devices/c/as_spi.h
index 78b9365..e0005e1 100644
--- a/target/packages/as_devices/c/as_spi.h
+++ b/target/packages/as_devices/c/as_spi.h
@@ -29,102 +29,108 @@
#ifdef __cplusplus
extern "C" {
-#endif // __cplusplus
+#endif /* __cplusplus */
#include <inttypes.h>
#include <sys/types.h>
/** @brief Open a SPI bus.
*
+ * @param aSpidev_name path name
+ *
* @return the file descriptor of the opened device, -1Â on error
*/
-int as_spi_open(const unsigned char *spidev_name);
+int as_spi_open(const unsigned char *aSpidev_name);
/** @brief Set spi bus mode
*
- * @param fd spidev file handler
- * @param mode
+ * @param aFd spidev file handler
+ * @param aMode
*
* @return mode if positive value, negative value on error
- *
+ * TODO
*/
-int as_spi_set_mode(int fd, uint8_t mode);
+int as_spi_set_mode(int aFd, uint8_t aMode);
/** @brief Set bits order
*
- * @param fd spidev file handler
- * @param lsb if 1 lsb first, else msb first
+ * @param aFd spidev file handler
+ * @param aLsb if 1 lsb first, else msb first
*
* @return lsb first if positive, msb first if 0, negative value on error
+ * TODO
*/
-int as_spi_set_lsb(int fd, uint8_t lsb);
+int as_spi_set_lsb(int aFd, uint8_t aLsb);
/** @brief Set bits per word
*
- * @param fd spidev file handler
- * @param bits number of bits per word
+ * @param aFd spidev file handler
+ * @param aBits number of bits per word
*
* @return bit per word if positive value, negative value on error
+ * TODO
*/
-int as_spi_set_bits_per_word(int fd, uint8_t bits);
+int as_spi_set_bits_per_word(int aFd, uint8_t aBits);
/** @brief Get spi bus mode
*
- * @param fd spidev file handler
+ * @param aFd spidev file handler
*
* @return mode if positive value, negative value on error
- *
+ * TODO
*/
-int as_spi_get_mode(int fd);
+int as_spi_get_mode(int aFd);
/** @brief Get bits order
*
- * @param fd spidev file handler
+ * @param aFd spidev file handler
*
* @return lsb first if positive, msb first if 0, negative value on error
+ *
*/
-int as_spi_get_lsb(int fd);
+int as_spi_get_lsb(int aFd);
/** @brief Get clock bus speed
*
- * @param fd spidev file handler
+ * @param aFd spidev file handler
*
* @return speed in Hz, negative value on error
*/
-int as_spi_get_speed(int fd);
+int as_spi_get_speed(int aFd);
/** @brief Get bits per word
*
- * @param fd spidev file handler
+ * @param aFd spidev file handler
*
* @return bit per word if positive value, negative value on error
*/
-int as_spi_get_bits_per_word(int fd);
+int as_spi_get_bits_per_word(int aFd);
/** @brief Forge arbitrary length message (31bits max) and send it
*
- * @param fd spidev file handler
- * @param msg right adjusted message
- * @param len lenght of the message
- * @param speed clock speed in Hz
+ * @param aFd spidev file handler
+ * @param aMsg right adjusted message
+ * @param aLen lenght of the message
+ * @param aSpeed clock speed in Hz
*
* @return message read
*/
-uint32_t as_spi_msg(int fd,
- uint32_t msg,
- size_t len,
- uint32_t speed);
+uint32_t as_spi_msg(int aFd,
+ uint32_t aMsg,
+ size_t aLen,
+ uint32_t aSpeed);
/** @brief Close a SPI bus.
*
+ * @param aFd file descriptor of SPI bus used
+ *
*/
-void as_spi_close(int fd);
-
+void as_spi_close(int aFd);
#ifdef __cplusplus
}
-#endif // __cplusplus
+#endif /* __cplusplus */
-#endif // AS_SPI_H_
+#endif /* AS_SPI_H_ */
hooks/post-receive
--
armadeus
|