summaryrefslogtreecommitdiffstats
path: root/main/common/i2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'main/common/i2c.h')
-rw-r--r--main/common/i2c.h112
1 files changed, 56 insertions, 56 deletions
diff --git a/main/common/i2c.h b/main/common/i2c.h
index e5f0f17..3be9c4d 100644
--- a/main/common/i2c.h
+++ b/main/common/i2c.h
@@ -1,7 +1,7 @@
/**************************************************************************
*
* Copyright (c) 2013 Alcatel-Lucent
- *
+ *
* Alcatel Lucent licenses this file to You under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. A copy of the License is contained the
@@ -34,23 +34,23 @@ extern int i2cVerbose;
*
* Commands used by i2cCtrl():
*/
-#define I2CCTRL_INIT 1
-#define I2CCTRL_SHOW 2
-#define I2CCTRL_START 3 /* Send START condition */
-#define I2CCTRL_STOP 4 /* Send STOP condition */
-#define I2CCTRL_WADD 5 /* Send Write address */
-#define I2CCTRL_RADD 6 /* Send Read address */
-#define I2CCTRL_RDAT 7 /* Read data */
-#define I2CCTRL_WDAT 8 /* Write data */
-#define I2CCTRL_SACK 9 /* Send ACK */
-#define I2CCTRL_WACK 10 /* WaitFor ACK */
+#define I2CCTRL_INIT 1
+#define I2CCTRL_SHOW 2
+#define I2CCTRL_START 3 /* Send START condition */
+#define I2CCTRL_STOP 4 /* Send STOP condition */
+#define I2CCTRL_WADD 5 /* Send Write address */
+#define I2CCTRL_RADD 6 /* Send Read address */
+#define I2CCTRL_RDAT 7 /* Read data */
+#define I2CCTRL_WDAT 8 /* Write data */
+#define I2CCTRL_SACK 9 /* Send ACK */
+#define I2CCTRL_WACK 10 /* WaitFor ACK */
/********************************************************************
*
* Upper bits of the bigaddr integer used for special case read/write
*/
-#define REPEATED_START 0x40000000
-#define OMIT_STOP 0x20000000
+#define REPEATED_START 0x40000000
+#define OMIT_STOP 0x20000000
/********************************************************************
*
@@ -60,67 +60,67 @@ extern int i2cVerbose;
/* i2cCtrl()
* Parameters:
- * int interface-
- * This parameter supports the case where the target hardware has more
- * than one i2c controller. The interface number would correspond to
- * one of potentially several different controllers.
- * int cmd-
- * Command to be carried out by the control function.
- * ulong arg1-
- * First command-specific argument.
- * ulong arg2-
- * Second command-specific argument.
+ * int interface-
+ * This parameter supports the case where the target hardware has more
+ * than one i2c controller. The interface number would correspond to
+ * one of potentially several different controllers.
+ * int cmd-
+ * Command to be carried out by the control function.
+ * ulong arg1-
+ * First command-specific argument.
+ * ulong arg2-
+ * Second command-specific argument.
*/
extern int i2cCtrl(int interface,int cmd,unsigned long arg1,unsigned long arg2);
/* i2cRead()
* Parameters:
- * int interface-
- * See description under i2cCtrl.
- * int bigaddr-
- * The device address on the I2C bus. Referred to here as "big" because
- * it is an "int" so it supports 10-bit addresses (if needed).
- * uchar *data-
- * Pointer to the data buffer into which the data is to be placed.
- * int len-
- * Number of bytes to be read from the I2C device. This must not be
- * larger than the size of the data buffer.
+ * int interface-
+ * See description under i2cCtrl.
+ * int bigaddr-
+ * The device address on the I2C bus. Referred to here as "big" because
+ * it is an "int" so it supports 10-bit addresses (if needed).
+ * uchar *data-
+ * Pointer to the data buffer into which the data is to be placed.
+ * int len-
+ * Number of bytes to be read from the I2C device. This must not be
+ * larger than the size of the data buffer.
* Return:
- * int
- * The function should return the number of bytes read. If everything
- * went well, then the return value should equal the len parameter.
- * Negative represents some failure.
+ * int
+ * The function should return the number of bytes read. If everything
+ * went well, then the return value should equal the len parameter.
+ * Negative represents some failure.
*/
extern int i2cRead(int interface,int bigaddr,unsigned char *data,int len);
/* i2cWrite()
* Parameters:
- * int interface-
- * See description under i2cCtrl.
- * int bigaddr-
- * See description under i2cRead.
- * uchar *data-
- * Buffer from which the data is to be taken and put into the specified
- * I2C device.
- * int len-
- * Number of bytes to be written.
+ * int interface-
+ * See description under i2cCtrl.
+ * int bigaddr-
+ * See description under i2cRead.
+ * uchar *data-
+ * Buffer from which the data is to be taken and put into the specified
+ * I2C device.
+ * int len-
+ * Number of bytes to be written.
* Return:
- * int
- * The function should return the number of bytes written. If everything
- * went well, then the return value should equal the len parameter.
- * Negative represents some failure.
+ * int
+ * The function should return the number of bytes written. If everything
+ * went well, then the return value should equal the len parameter.
+ * Negative represents some failure.
*/
extern int i2cWrite(int interface,int bigaddr,unsigned char *data,int len);
/* i2cShow()
* Parameters:
- * int interface-
- * See description under i2cCtrl.
+ * int interface-
+ * See description under i2cCtrl.
* Return:
- * void
- * The function should be part of target-specific code that simply
- * prints out a list of the device names and their address on the
- * I-Squared-C bus of the specfied interface.
+ * void
+ * The function should be part of target-specific code that simply
+ * prints out a list of the device names and their address on the
+ * I-Squared-C bus of the specfied interface.
*/
extern void i2cShow(int interface);