Skip to content

Commit aa455ad

Browse files
committed
Doc: Fix broken SPI Tool documentation
1 parent f05c85e commit aa455ad

File tree

1 file changed

+14
-12
lines changed
  • Documentation/applications/system/spi

1 file changed

+14
-12
lines changed

Documentation/applications/system/spi/index.rst

+14-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
``spi`` SPI Tool
33
================
44

5-
The I2C tool provides a way to debug SPI related problems. This README file will
5+
The SPI Tool provides a way to debug SPI related problems. This README file will
66
provide usage information for the SPI tools.
77

88
Contents
@@ -29,10 +29,10 @@ Contents
2929
* ``set``
3030
* ``verf``
3131

32-
- I2C Build Configuration
32+
- SPI Build Configuration
3333

3434
* NuttX Configuration Requirements
35-
* I2C Tool Configuration Options
35+
* SPI Tool Configuration Options
3636

3737
System Requirements
3838
-------------------
@@ -71,7 +71,7 @@ or::
7171

7272
nsh> spi ?
7373

74-
Here is an example of the help output. I shows the general form of the command
74+
Here is an example of the help output. It shows the general form of the command
7575
line, the various SPI commands supported with their unique command line options,
7676
and a more detailed summary of the command SPI command options::
7777

@@ -95,8 +95,8 @@ and a more detailed summary of the command SPI command options::
9595
**Notes**:
9696

9797
- An environment variable like $PATH may be used for any argument.
98-
- Arguments are _sticky_. For example, once the SPI address is specified, that
99-
address will be re-used until it is changed.
98+
- Arguments are _sticky_. For example, once the SPI bus is specified, that
99+
bus will be re-used until it is changed.
100100

101101
**Warning**:
102102

@@ -117,7 +117,7 @@ SPI operation. Those arguments vary from command to command as described below.
117117
However, there is also a core set of common ``OPTIONS`` supported by all commands.
118118
So perhaps a better representation of the general SPI command would be::
119119

120-
i2c <cmd> [OPTIONS] [arguments]
120+
spi <cmd> [OPTIONS] [arguments]
121121

122122
Where ``[OPTIONS]`` represents the common options and and arguments represent the
123123
operation-specific arguments.
@@ -146,7 +146,7 @@ Environment Variables
146146
variables. Environment variables must be preceded with the special character
147147
``$``. For example, ``PWD`` is the variable that holds the current working directory
148148
and so ``$PWD`` could be used as a command line argument. The use of environment
149-
variables on the I2C tools command is really only useful if you wish to write
149+
variables on the SPI tools command is really only useful if you wish to write
150150
NSH scripts to execute a longer, more complex series of SPI commands.
151151

152152
Common Option Summary
@@ -187,7 +187,7 @@ Common Option Summary
187187

188188
Various SPI devices support different data widths. This option is untested.
189189

190-
- ``[-f freq]`` I2C frequency. Default: ``4000000`` Current: ``4000000``
190+
- ``[-f freq]`` SPI frequency. Default: ``4000000`` Current: ``4000000``
191191

192192
The ``[-f freq]`` sets the frequency of the SPI device. The default is very
193193
conservative.
@@ -212,7 +212,9 @@ Exchange data: ``exch [OPTIONS] <Optional TX Data>``
212212
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
213213

214214
This command triggers an SPI transfer, returning the data back from the far end.
215-
As an example (with MOSI looped back to MISO)::
215+
216+
As an example you can exchange (send and receive) 4 bytes (-x 4) on SPI2 (-b 2) using the command below with the ``loopback`` approach.
217+
This approach requires that you connect the MOSI pin directly to the MISO pin (NOTE: SCLK and CS are not directly involved, but you still can see the clock and chip select waveforms if you decide to use an oscilloscope or more properly a logic analyzer to analyze these pins)::
216218

217219
nsh> spi exch -b 2 -x 4 aabbccdd
218220

@@ -221,7 +223,7 @@ As an example (with MOSI looped back to MISO)::
221223
Note that the ``TX Data`` are always specified in hex, and are always two digits
222224
each, case insensitive.
223225

224-
I2C Build Configuration
226+
SPI Build Configuration
225227
-----------------------
226228

227229
NuttX Configuration Requirements
@@ -241,7 +243,7 @@ The SPI tools requires the following in your NuttX configuration:
241243
CONFIG_SPI_DRIVER=y
242244

243245
The SPI tool will then use the SPI character driver to access the SPI bus.
244-
These devices will reside at ``/dev/spiN`` where ``N`` is the I2C bus number.
246+
These devices will reside at ``/dev/spiN`` where ``N`` is the SPI bus number.
245247

246248
**Note**: The SPI driver ``ioctl`` interface is defined in
247249
``include/nuttx/spi/spi.h``.

0 commit comments

Comments
 (0)