diff --git a/system/i2c/README.md b/system/i2c/README.md index a1f921ec8..0d005664c 100644 --- a/system/i2c/README.md +++ b/system/i2c/README.md @@ -69,10 +69,10 @@ Where is one of: Show help : ? List buses : bus List devices : dev [OPTIONS] - Read register : get [OPTIONS] [] + Read register : get [OPTIONS] [] Show help : help - Write register: set [OPTIONS] [] - Verify access : verf [OPTIONS] [] + Write register: set [OPTIONS] [] + Verify access : verf [OPTIONS] [] Where common _sticky_ OPTIONS include: [-a addr] is the I2C device address (hex). Default: 03 Current: 03 @@ -80,7 +80,7 @@ Where 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 `` argument can be supplied to repeat the read +An optional `` 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 `` argument can be supplied to repeat the write +An optional `` 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] []` +### Verify access: `verf [OPTIONS] []` 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 `` argument can be supplied to repeat the verify +An optional `` 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 diff --git a/system/i2c/i2c_get.c b/system/i2c/i2c_get.c index b844436ed..ffa606d79 100644 --- a/system/i2c/i2c_get.c +++ b/system/i2c/i2c_get.c @@ -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 */ diff --git a/system/i2c/i2c_main.c b/system/i2c/i2c_main.c index f5457ad88..a4196b073 100644 --- a/system/i2c/i2c_main.c +++ b/system/i2c/i2c_main.c @@ -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] " }, - { "get", i2ccmd_get, "Read register ", "[OPTIONS] []" }, + { "get", i2ccmd_get, "Read register ", "[OPTIONS] []" }, { "dump", i2ccmd_dump, "Dump register ", "[OPTIONS] []" }, { "help", i2ccmd_help, "Show help ", NULL }, - { "set", i2ccmd_set, "Write register", "[OPTIONS] []" }, - { "verf", i2ccmd_verf, "Verify access ", "[OPTIONS] [] []" }, + { "set", i2ccmd_set, "Write register", "[OPTIONS] []" }, + { "verf", i2ccmd_verf, "Verify access ", "[OPTIONS] [] []" }, { 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. " diff --git a/system/i2c/i2c_set.c b/system/i2c/i2c_set.c index 918ccce32..14621c7c5 100644 --- a/system/i2c/i2c_set.c +++ b/system/i2c/i2c_set.c @@ -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 */ diff --git a/system/i2c/i2c_verf.c b/system/i2c/i2c_verf.c index ac3e1aa1f..1b4c603e0 100644 --- a/system/i2c/i2c_verf.c +++ b/system/i2c/i2c_verf.c @@ -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. diff --git a/system/i2c/i2ctool.h b/system/i2c/i2ctool.h index b90113573..a7760e7e3 100644 --- a/system/i2c/i2ctool.h +++ b/system/i2c/i2ctool.h @@ -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 */