system/i2c: Fix typo in "repetitions" word
This commit is contained in:
parent
a63bdcbacb
commit
f167754743
@ -69,10 +69,10 @@ Where <cmd> is one of:
|
||||
Show help : ?
|
||||
List buses : bus
|
||||
List devices : dev [OPTIONS] <first> <last>
|
||||
Read register : get [OPTIONS] [<repititions>]
|
||||
Read register : get [OPTIONS] [<repetitions>]
|
||||
Show help : help
|
||||
Write register: set [OPTIONS] <value> [<repititions>]
|
||||
Verify access : verf [OPTIONS] <value> [<repititions>]
|
||||
Write register: set [OPTIONS] <value> [<repetitions>]
|
||||
Verify access : verf [OPTIONS] <value> [<repetitions>]
|
||||
|
||||
Where common _sticky_ OPTIONS include:
|
||||
[-a addr] is the I2C device address (hex). Default: 03 Current: 03
|
||||
@ -80,7 +80,7 @@ Where <cmd> is one of:
|
||||
[-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
|
||||
[-i|j], Auto increment|don't increment regaddr on repetitions. Default: NO Current: NO
|
||||
[-f freq] I2C frequency. Default: 100000 Current: 100000
|
||||
```
|
||||
|
||||
@ -192,7 +192,7 @@ NSH scripts to execute a longer, more complex series of I2C commands.
|
||||
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:
|
||||
- `[-i|j]`, Auto increment|don't increment `regaddr` on repetitions. Default:
|
||||
`NO` Current: `NO`
|
||||
|
||||
On commands that take a optional number of repetitions, the option can be used
|
||||
@ -269,10 +269,10 @@ This command with write the 8-bit address value then read an 8- or 16-bit 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
|
||||
An optional `<repetitions>` 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
|
||||
repetitions. 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
|
||||
@ -297,10 +297,10 @@ 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
|
||||
An optional `<repetitions>` 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
|
||||
repetitions. 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
|
||||
@ -313,7 +313,7 @@ WROTE Bus: 1 Addr: 49 Subaddr: 04 Value: 96
|
||||
|
||||
All values (except the bus numbers) are hexadecimal.
|
||||
|
||||
### Verify access: `verf [OPTIONS] <value> [<repititions>]`
|
||||
### Verify access: `verf [OPTIONS] <value> [<repetitions>]`
|
||||
|
||||
|
||||
This command combines writing and reading from an I2C device register. It will
|
||||
@ -326,10 +326,10 @@ 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
|
||||
An optional `<repetitions>` 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
|
||||
repetitions. 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
|
||||
|
@ -58,7 +58,7 @@ int i2ccmd_get(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
||||
FAR char *ptr;
|
||||
uint16_t result;
|
||||
uint8_t regaddr;
|
||||
long repititions;
|
||||
long repetitions;
|
||||
int nargs;
|
||||
int argndx;
|
||||
int ret;
|
||||
@ -92,11 +92,11 @@ int i2ccmd_get(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
||||
* count.
|
||||
*/
|
||||
|
||||
repititions = 1;
|
||||
repetitions = 1;
|
||||
if (argndx < argc)
|
||||
{
|
||||
repititions = strtol(argv[argndx], NULL, 16);
|
||||
if (repititions < 1)
|
||||
repetitions = strtol(argv[argndx], NULL, 16);
|
||||
if (repetitions < 1)
|
||||
{
|
||||
i2ctool_printf(i2ctool, g_i2cargrange, argv[0]);
|
||||
return ERROR;
|
||||
@ -120,12 +120,12 @@ int i2ccmd_get(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* Loop for the requested number of repititions */
|
||||
/* Loop for the requested number of repetitions */
|
||||
|
||||
regaddr = i2ctool->regaddr;
|
||||
ret = OK;
|
||||
|
||||
for (i = 0; i < repititions; i++)
|
||||
for (i = 0; i < repetitions; i++)
|
||||
{
|
||||
/* Read from the I2C bus */
|
||||
|
||||
|
@ -71,11 +71,11 @@ static const struct cmdmap_s g_i2ccmds[] =
|
||||
{ "?", i2ccmd_help, "Show help ", NULL },
|
||||
{ "bus", i2ccmd_bus, "List buses ", NULL },
|
||||
{ "dev", i2ccmd_dev, "List devices ", "[OPTIONS] <first> <last>" },
|
||||
{ "get", i2ccmd_get, "Read register ", "[OPTIONS] [<repititions>]" },
|
||||
{ "get", i2ccmd_get, "Read register ", "[OPTIONS] [<repetitions>]" },
|
||||
{ "dump", i2ccmd_dump, "Dump register ", "[OPTIONS] [<num bytes>]" },
|
||||
{ "help", i2ccmd_help, "Show help ", NULL },
|
||||
{ "set", i2ccmd_set, "Write register", "[OPTIONS] <value> [<repititions>]" },
|
||||
{ "verf", i2ccmd_verf, "Verify access ", "[OPTIONS] [<value>] [<repititions>]" },
|
||||
{ "set", i2ccmd_set, "Write register", "[OPTIONS] <value> [<repetitions>]" },
|
||||
{ "verf", i2ccmd_verf, "Verify access ", "[OPTIONS] [<value>] [<repetitions>]" },
|
||||
{ NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@ -133,7 +133,7 @@ static int i2ccmd_help(FAR struct i2ctool_s *i2ctool, int argc, char **argv)
|
||||
i2ctool_printf(i2ctool, " [-s|n], send/don't send start between command and data. "
|
||||
"Default: -n Current: %s\n",
|
||||
i2ctool->start ? "-s" : "-n");
|
||||
i2ctool_printf(i2ctool, " [-i|j], Auto increment|don't increment regaddr on repititions. "
|
||||
i2ctool_printf(i2ctool, " [-i|j], Auto increment|don't increment regaddr on repetitions. "
|
||||
"Default: NO Current: %s\n",
|
||||
i2ctool->autoincr ? "YES" : "NO");
|
||||
i2ctool_printf(i2ctool, " [-f freq] I2C frequency. "
|
||||
|
@ -58,7 +58,7 @@ int i2ccmd_set(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
||||
FAR char *ptr;
|
||||
uint8_t regaddr;
|
||||
long value;
|
||||
long repititions;
|
||||
long repetitions;
|
||||
int nargs;
|
||||
int argndx;
|
||||
int ret;
|
||||
@ -120,11 +120,11 @@ int i2ccmd_set(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
||||
* count.
|
||||
*/
|
||||
|
||||
repititions = 1;
|
||||
repetitions = 1;
|
||||
if (argndx < argc)
|
||||
{
|
||||
repititions = strtol(argv[argndx], NULL, 16);
|
||||
if (repititions < 1)
|
||||
repetitions = strtol(argv[argndx], NULL, 16);
|
||||
if (repetitions < 1)
|
||||
{
|
||||
i2ctool_printf(i2ctool, g_i2cargrange, argv[0]);
|
||||
return ERROR;
|
||||
@ -148,12 +148,12 @@ int i2ccmd_set(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* Loop for the requested number of repititions */
|
||||
/* Loop for the requested number of repetitions */
|
||||
|
||||
regaddr = i2ctool->regaddr;
|
||||
ret = OK;
|
||||
|
||||
for (i = 0; i < repititions; i++)
|
||||
for (i = 0; i < repetitions; i++)
|
||||
{
|
||||
/* Write to the I2C bus */
|
||||
|
||||
|
@ -60,7 +60,7 @@ int i2ccmd_verf(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
||||
uint8_t regaddr;
|
||||
bool addrinaddr;
|
||||
long wrvalue;
|
||||
long repititions;
|
||||
long repetitions;
|
||||
int nargs;
|
||||
int argndx;
|
||||
int ret;
|
||||
@ -122,11 +122,11 @@ int i2ccmd_verf(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
||||
* count.
|
||||
*/
|
||||
|
||||
repititions = 1;
|
||||
repetitions = 1;
|
||||
if (argndx < argc)
|
||||
{
|
||||
repititions = strtol(argv[argndx], NULL, 16);
|
||||
if (repititions < 1)
|
||||
repetitions = strtol(argv[argndx], NULL, 16);
|
||||
if (repetitions < 1)
|
||||
{
|
||||
i2ctool_printf(i2ctool, g_i2cargrange, argv[0]);
|
||||
return ERROR;
|
||||
@ -150,12 +150,12 @@ int i2ccmd_verf(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* Loop for the requested number of repititions */
|
||||
/* Loop for the requested number of repetitions */
|
||||
|
||||
regaddr = i2ctool->regaddr;
|
||||
ret = OK;
|
||||
|
||||
for (i = 0; i < repititions; i++)
|
||||
for (i = 0; i < repetitions; i++)
|
||||
{
|
||||
/* If we are performing an address-in-address test, then use the register
|
||||
* address as the value to write.
|
||||
|
@ -142,7 +142,7 @@ struct i2ctool_s
|
||||
uint8_t regaddr; /* [-r regaddr] is the I2C device register address */
|
||||
uint8_t width; /* [-w width] is the data width (8 or 16) */
|
||||
bool start; /* [-s|n], send|don't send start between command and data */
|
||||
bool autoincr; /* [-i|j], Auto increment|don't increment regaddr on repititions */
|
||||
bool autoincr; /* [-i|j], Auto increment|don't increment regaddr on repetitions */
|
||||
bool hasregindx; /* true with the use of -r */
|
||||
uint32_t freq; /* [-f freq] I2C frequency */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user