|
| 1 | +.. zephyr:code-sample:: spis-wakeup |
| 2 | + :name: SPIS wake up |
| 3 | + :relevant-api: spi_interface |
| 4 | + |
| 5 | + Reduce current consumption by handling the wake line while using an SPIS. |
| 6 | + |
| 7 | +Overview |
| 8 | +******** |
| 9 | + |
| 10 | +Sample showing how to use the additional wake line in nrf-spis driver. The application, configured |
| 11 | +as a SPIS, is put to sleep while waiting for an SPI transmission. An external device (other core in |
| 12 | +this sample) working as a SPIM and also handling the wake line wakes the application up just before |
| 13 | +the transmission starts. To simulate two separate devices the Nordic Semiconductor nRF54H20 DK has |
| 14 | +been used and SPIS / SPIM drivers are controlled by two independent cores: |
| 15 | + |
| 16 | +- nrf54h20dk/nrf54h20/cpuapp works as a SPIS controller device |
| 17 | +- nrf54h20dk/nrf54h20/cpurad works as a SPIM controller device |
| 18 | + |
| 19 | + |
| 20 | +Requirements |
| 21 | +************ |
| 22 | + |
| 23 | +This sample can be run on multicore SoCs like nRF54H20 and requires additional wiring as below. |
| 24 | + |
| 25 | +Wiring |
| 26 | +****** |
| 27 | + |
| 28 | +Wires (jumpers) for connecting SPIS and SPIM devices are needed: |
| 29 | + |
| 30 | +- SPIS WAKE <-> WAKE SPIM |
| 31 | +- SPIS CS <-----> CS SPIM |
| 32 | +- SPIS SCK <---> SCK SPIM |
| 33 | +- SPIS MOSI <-> MOSI SPIM |
| 34 | +- SPIS MISO <-> MISO SPIM |
| 35 | + |
| 36 | +Building and Running |
| 37 | +******************** |
| 38 | + |
| 39 | +The code can be found in :zephyr_file:`samples/boards/nordic/spis_wakeup`. |
| 40 | + |
| 41 | +To build and flash the application: |
| 42 | + |
| 43 | +.. zephyr-app-commands:: |
| 44 | + :zephyr-app: samples/boards/nordic/spis_wakeup |
| 45 | + :board: nrf54h20dk/nrf54h20/cpuapp |
| 46 | + :goals: build flash |
| 47 | + :compact: |
| 48 | + |
| 49 | +Sample Output |
| 50 | +============= |
| 51 | + |
| 52 | +nrf54h20/cpuapp: |
| 53 | + |
| 54 | +.. code-block:: console |
| 55 | +
|
| 56 | + [00:00:00.272,217] <inf> spi_wakeup: Hello world from [email protected]/nrf54h20/cpuapp |
| 57 | + [00:00:00.272,241] <inf> spi_wakeup: SPIS: waiting for SPI transfer; going to sleep... |
| 58 | + [00:00:02.274,192] <inf> spi_wakeup: SPIS: woken up by nrf54h20/cpurad |
| 59 | + [00:00:02.274,215] <inf> spi_wakeup: SPIS: will be active for 500ms after transfer |
| 60 | +
|
| 61 | +nrf54h20/cpurad: |
| 62 | + |
| 63 | +.. code-block:: console |
| 64 | +
|
| 65 | + [00:00:00.272,195] <inf> spi_wakeup: Hello world from [email protected]/nrf54h20/cpurad |
| 66 | + [00:00:00.272,219] <inf> spi_wakeup: SPIM: going to sleep for 1.5s... |
| 67 | + [00:00:01.772,352] <inf> spi_wakeup: SPIM: will be active for 500ms before transfer |
| 68 | + [00:00:02.273,456] <inf> spi_wakeup: SPIM: transferring the CONFIG_BOARD_QUALIFIERS: 'nrf54h20/cpurad' |
| 69 | +
|
| 70 | +References |
| 71 | +********** |
| 72 | + |
| 73 | +:zephyr_file:`dts/bindings/spi/nordic,nrf-spi-common.yaml` |
0 commit comments