From d291ed0afda16ef99065d9fa68cb7ade14f4a8fb Mon Sep 17 00:00:00 2001 From: Felipe Moura Date: Thu, 24 Oct 2024 09:52:07 -0300 Subject: [PATCH] Writing documentation related to SPI slave. Fix build issues --- .../examples/spislv_test/index.rst | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/applications/examples/spislv_test/index.rst diff --git a/Documentation/applications/examples/spislv_test/index.rst b/Documentation/applications/examples/spislv_test/index.rst new file mode 100644 index 00000000000..8474d62989e --- /dev/null +++ b/Documentation/applications/examples/spislv_test/index.rst @@ -0,0 +1,42 @@ +``spislv`` SPI slave example +============================ + +A simple example for the device functioning as an SPI slave. +This example can be used to validate communication with another device +operating as an SPI master. If the spitool is used on the other device, +and the following command is sent: + +``spi exch -x 4 deadbeef`` + +The expected response in device running spislv_test app is: + +.. code-block:: bash + + Slave: 4 Bytes reads + Value in hex form from /dev/spislv2: de ad be ef + Slave: Writing value back to /dev/spislv2 + + +This test requires the device to be configured in SPI slave mode.(your +specific spi slave hardware settings might require additional settings). + +Specific configuration options for this example include: +Configs inside <> are the options that you need to find, It are arch de- +pendent and might be different for your board. + +- ```` – Enables SPI peripheral support + in System Type->Peripheral Support. + +- ```` – Configures SPI peripheral in System Type->SPI + configuration. Set here the right pins to be used for SPI communication. + +- ``CONFIG_SPI`` – In the SPI driver support, enable SPI Slave support. + +- ``CONFIG_SPI_SLAVE`` – Enables SPI Slave support. + +- ``SPI_SLAVE_DRIVER`` – Enables SPI Slave character driver. + +- ```` – Return to this option and enable SPI Slave mode. + + +