diff options
Diffstat (limited to 'apps/system/i2c/README.txt')
-rwxr-xr-x | apps/system/i2c/README.txt | 65 |
1 files changed, 58 insertions, 7 deletions
diff --git a/apps/system/i2c/README.txt b/apps/system/i2c/README.txt index 0435be148..97801bcaa 100755 --- a/apps/system/i2c/README.txt +++ b/apps/system/i2c/README.txt @@ -21,6 +21,7 @@ CONTENTS - dev
- get
- set
+ - verf
o I2C Build Configuration
- NuttX Configuration Requirements
- I2C Tool Configuration Options
@@ -74,12 +75,13 @@ options. Usage: i2c <cmd> [arguments]
Where <cmd> is one of:
- Show help: ?
- List buses: bus
- List devices: dev [OPTIONS] <first> <last>
- Read register: get [OPTIONS]
- Show help: help
- Write register: set [OPTIONS] <value>
+ Show help : ?
+ List buses : bus
+ List devices : dev [OPTIONS] <first> <last>
+ Read register : get [OPTIONS] [<repititions>]
+ Show help : help
+ Write register: set [OPTIONS] <value> [<repititions>]
+ Verify access : verf [OPTIONS] <value> [<repititions>]
Where common "sticky" OPTIONS include:
[-a addr] is the I2C device address (hex). Default: 03 Current: 03
@@ -87,6 +89,7 @@ options. [-r regaddr] is the I2C device register address (hex). Default: 00 Current: 00
[-w width] is the data width (8 or 16 decimal). Default: 8 Current: 8
[-s|n], send/don't send start between command and data. Default: -n Current: -n
+ [-i|j], Auto increment|don't increment regaddr on repititions. Default: NO Current: NO
[-f freq] I2C frequency. Default: 100000 Current: 100000
NOTES:
@@ -195,6 +198,11 @@ Common Option Summary This determines whether or not there should be a new I2C START between
sending of the register address and sending/receiving of the register data.
+[-i|j], Auto increment|don't increment regaddr on repititions. Default: NO Current: NO
+
+ On commands that take a optional number of repetitions, the option can be
+ used to temporarily increment the regaddr value by one on each repitition.
+
[-f freq] I2C frequency. Default: 400000 Current: 400000
The [-f freq] sets the frequency of the I2C device.
@@ -257,6 +265,13 @@ Read register: get [OPTIONS] data value from the device. Optionally, it may re-start the transfer
before obtaining the data.
+ An optional <repititions> argument can be supplied to repeat the
+ read operation an arbitrary number of times (up to 2 billion). If
+ auto-increment is select (-i), then the register address will be
+ temporarily incremented on each repitions. The increment is temporary
+ in the since that it will not alter the "sticky" value of the
+ register address.
+
On success, the output will look like the following (the data value
read will be shown as a 4-character hexadecimal number if the 16-bit
data width option is selected).
@@ -274,10 +289,17 @@ Write register: set [OPTIONS] <value> range 00-ff) or a 16-bit value (in the range 0000-ffff), depending upon
the selected data width.
- This command with write the 8-bit address value then write the 8- or 16-bit
+ This command will write the 8-bit address value then write the 8- or 16-bit
data value to the device. Optionally, it may re-start the transfer
before writing the data.
+ An optional <repititions> argument can be supplied to repeat the
+ write operation an arbitrary number of times (up to 2 billion). If
+ auto-increment is select (-i), then the register address will be
+ temporarily incremented on each repitions. The increment is temporary
+ in the since that it will not alter the "sticky" value of the
+ register address.
+
On success, the output will look like the following (the data value
written will be shown as a 4-character hexadecimal number if the 16-bit
data width option is selected).
@@ -286,6 +308,35 @@ Write register: set [OPTIONS] <value> All values (except the bus numbers) are hexadecimal.
+Verify access : verf [OPTIONS] <value> [<repititions>]
+------------------------------------------------------
+
+ This command combines writing and reading from an I2C device register.
+ It will write a value to an will write a value to an I2C register using
+ the selected I2C parameters in the common options just as described for
+ tie 'set' command. Then this command will read the value back just
+ as described with the 'get' command. Finally, this command will compare
+ the value read and against the value written and emit an error message
+ if they do not match.
+
+ If no value is provided, then this command will use the register address
+ itself as the data, providing for a address-in-address test.
+
+ An optional <repititions> argument can be supplied to repeat the
+ verify operation an arbitrary number of times (up to 2 billion). If
+ auto-increment is select (-i), then the register address will be
+ temporarily incremented on each repitions. The increment is temporary
+ in the since that it will not alter the "sticky" value of the
+ register address.
+
+ On success, the output will look like the following (the data value
+ written will be shown as a 4-character hexadecimal number if the 16-bit
+ data width option is selected).
+
+ VERIFY Bus: 1 Addr: 49 Subaddr: 04 Wrote: 96 Read: 92 FAILURE
+
+ All values (except the bus numbers) are hexadecimal.
+
I2C BUILD CONFIGURATION
=======================
|