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 : ?
|
Show help : ?
|
||||||
List buses : bus
|
List buses : bus
|
||||||
List devices : dev [OPTIONS] <first> <last>
|
List devices : dev [OPTIONS] <first> <last>
|
||||||
Read register : get [OPTIONS] [<repititions>]
|
Read register : get [OPTIONS] [<repetitions>]
|
||||||
Show help : help
|
Show help : help
|
||||||
Write register: set [OPTIONS] <value> [<repititions>]
|
Write register: set [OPTIONS] <value> [<repetitions>]
|
||||||
Verify access : verf [OPTIONS] <value> [<repititions>]
|
Verify access : verf [OPTIONS] <value> [<repetitions>]
|
||||||
|
|
||||||
Where common _sticky_ OPTIONS include:
|
Where common _sticky_ OPTIONS include:
|
||||||
[-a addr] is the I2C device address (hex). Default: 03 Current: 03
|
[-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
|
[-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
|
[-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
|
[-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
|
[-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
|
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.
|
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`
|
`NO` Current: `NO`
|
||||||
|
|
||||||
On commands that take a optional number of repetitions, the option can be used
|
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
|
value from the device. Optionally, it may re-start the transfer before obtaining
|
||||||
the data.
|
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
|
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
|
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.
|
_sticky_ value of the register address.
|
||||||
|
|
||||||
On success, the output will look like the following (the data value read will be
|
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
|
value to the device. Optionally, it may re-start the transfer before writing the
|
||||||
data.
|
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
|
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
|
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.
|
_sticky_ value of the register address.
|
||||||
|
|
||||||
On success, the output will look like the following (the data value written will
|
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.
|
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
|
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
|
If no value is provided, then this command will use the register address itself
|
||||||
as the data, providing for a address-in-address test.
|
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
|
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
|
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.
|
`sticky` value of the register address.
|
||||||
|
|
||||||
On success, the output will look like the following (the data value written will
|
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;
|
FAR char *ptr;
|
||||||
uint16_t result;
|
uint16_t result;
|
||||||
uint8_t regaddr;
|
uint8_t regaddr;
|
||||||
long repititions;
|
long repetitions;
|
||||||
int nargs;
|
int nargs;
|
||||||
int argndx;
|
int argndx;
|
||||||
int ret;
|
int ret;
|
||||||
@ -92,11 +92,11 @@ int i2ccmd_get(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
|||||||
* count.
|
* count.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
repititions = 1;
|
repetitions = 1;
|
||||||
if (argndx < argc)
|
if (argndx < argc)
|
||||||
{
|
{
|
||||||
repititions = strtol(argv[argndx], NULL, 16);
|
repetitions = strtol(argv[argndx], NULL, 16);
|
||||||
if (repititions < 1)
|
if (repetitions < 1)
|
||||||
{
|
{
|
||||||
i2ctool_printf(i2ctool, g_i2cargrange, argv[0]);
|
i2ctool_printf(i2ctool, g_i2cargrange, argv[0]);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -120,12 +120,12 @@ int i2ccmd_get(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop for the requested number of repititions */
|
/* Loop for the requested number of repetitions */
|
||||||
|
|
||||||
regaddr = i2ctool->regaddr;
|
regaddr = i2ctool->regaddr;
|
||||||
ret = OK;
|
ret = OK;
|
||||||
|
|
||||||
for (i = 0; i < repititions; i++)
|
for (i = 0; i < repetitions; i++)
|
||||||
{
|
{
|
||||||
/* Read from the I2C bus */
|
/* Read from the I2C bus */
|
||||||
|
|
||||||
|
@ -71,11 +71,11 @@ static const struct cmdmap_s g_i2ccmds[] =
|
|||||||
{ "?", i2ccmd_help, "Show help ", NULL },
|
{ "?", i2ccmd_help, "Show help ", NULL },
|
||||||
{ "bus", i2ccmd_bus, "List buses ", NULL },
|
{ "bus", i2ccmd_bus, "List buses ", NULL },
|
||||||
{ "dev", i2ccmd_dev, "List devices ", "[OPTIONS] <first> <last>" },
|
{ "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>]" },
|
{ "dump", i2ccmd_dump, "Dump register ", "[OPTIONS] [<num bytes>]" },
|
||||||
{ "help", i2ccmd_help, "Show help ", NULL },
|
{ "help", i2ccmd_help, "Show help ", NULL },
|
||||||
{ "set", i2ccmd_set, "Write register", "[OPTIONS] <value> [<repititions>]" },
|
{ "set", i2ccmd_set, "Write register", "[OPTIONS] <value> [<repetitions>]" },
|
||||||
{ "verf", i2ccmd_verf, "Verify access ", "[OPTIONS] [<value>] [<repititions>]" },
|
{ "verf", i2ccmd_verf, "Verify access ", "[OPTIONS] [<value>] [<repetitions>]" },
|
||||||
{ NULL, NULL, NULL, NULL }
|
{ 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. "
|
i2ctool_printf(i2ctool, " [-s|n], send/don't send start between command and data. "
|
||||||
"Default: -n Current: %s\n",
|
"Default: -n Current: %s\n",
|
||||||
i2ctool->start ? "-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",
|
"Default: NO Current: %s\n",
|
||||||
i2ctool->autoincr ? "YES" : "NO");
|
i2ctool->autoincr ? "YES" : "NO");
|
||||||
i2ctool_printf(i2ctool, " [-f freq] I2C frequency. "
|
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;
|
FAR char *ptr;
|
||||||
uint8_t regaddr;
|
uint8_t regaddr;
|
||||||
long value;
|
long value;
|
||||||
long repititions;
|
long repetitions;
|
||||||
int nargs;
|
int nargs;
|
||||||
int argndx;
|
int argndx;
|
||||||
int ret;
|
int ret;
|
||||||
@ -120,11 +120,11 @@ int i2ccmd_set(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
|||||||
* count.
|
* count.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
repititions = 1;
|
repetitions = 1;
|
||||||
if (argndx < argc)
|
if (argndx < argc)
|
||||||
{
|
{
|
||||||
repititions = strtol(argv[argndx], NULL, 16);
|
repetitions = strtol(argv[argndx], NULL, 16);
|
||||||
if (repititions < 1)
|
if (repetitions < 1)
|
||||||
{
|
{
|
||||||
i2ctool_printf(i2ctool, g_i2cargrange, argv[0]);
|
i2ctool_printf(i2ctool, g_i2cargrange, argv[0]);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -148,12 +148,12 @@ int i2ccmd_set(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop for the requested number of repititions */
|
/* Loop for the requested number of repetitions */
|
||||||
|
|
||||||
regaddr = i2ctool->regaddr;
|
regaddr = i2ctool->regaddr;
|
||||||
ret = OK;
|
ret = OK;
|
||||||
|
|
||||||
for (i = 0; i < repititions; i++)
|
for (i = 0; i < repetitions; i++)
|
||||||
{
|
{
|
||||||
/* Write to the I2C bus */
|
/* 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;
|
uint8_t regaddr;
|
||||||
bool addrinaddr;
|
bool addrinaddr;
|
||||||
long wrvalue;
|
long wrvalue;
|
||||||
long repititions;
|
long repetitions;
|
||||||
int nargs;
|
int nargs;
|
||||||
int argndx;
|
int argndx;
|
||||||
int ret;
|
int ret;
|
||||||
@ -122,11 +122,11 @@ int i2ccmd_verf(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
|||||||
* count.
|
* count.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
repititions = 1;
|
repetitions = 1;
|
||||||
if (argndx < argc)
|
if (argndx < argc)
|
||||||
{
|
{
|
||||||
repititions = strtol(argv[argndx], NULL, 16);
|
repetitions = strtol(argv[argndx], NULL, 16);
|
||||||
if (repititions < 1)
|
if (repetitions < 1)
|
||||||
{
|
{
|
||||||
i2ctool_printf(i2ctool, g_i2cargrange, argv[0]);
|
i2ctool_printf(i2ctool, g_i2cargrange, argv[0]);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -150,12 +150,12 @@ int i2ccmd_verf(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop for the requested number of repititions */
|
/* Loop for the requested number of repetitions */
|
||||||
|
|
||||||
regaddr = i2ctool->regaddr;
|
regaddr = i2ctool->regaddr;
|
||||||
ret = OK;
|
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
|
/* If we are performing an address-in-address test, then use the register
|
||||||
* address as the value to write.
|
* 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 regaddr; /* [-r regaddr] is the I2C device register address */
|
||||||
uint8_t width; /* [-w width] is the data width (8 or 16) */
|
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 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 */
|
bool hasregindx; /* true with the use of -r */
|
||||||
uint32_t freq; /* [-f freq] I2C frequency */
|
uint32_t freq; /* [-f freq] I2C frequency */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user