|
| 1 | +menu "SPI Test" |
| 2 | + |
| 3 | +config RT_UTEST_SPI_LOOPBACK |
| 4 | + bool "SPI MOSI/MISO Loopback Test" |
| 5 | + select RT_USING_SPI |
| 6 | + default n |
| 7 | + help |
| 8 | + This test validates full-duplex loopback data with sendrecv8, |
| 9 | + transfer and transfer_message over length and clock matrices. |
| 10 | + The hardware transfer mode, such as polling, interrupt or DMA, is |
| 11 | + selected by the BSP SPI driver configuration. |
| 12 | + |
| 13 | +if RT_UTEST_SPI_LOOPBACK |
| 14 | + |
| 15 | +config RT_UTEST_SPI_LOOPBACK_BUS_NAME |
| 16 | + string "SPI bus name for loopback test" |
| 17 | + default "spi2" |
| 18 | + |
| 19 | +config RT_UTEST_SPI_LOOPBACK_DEV_NAME |
| 20 | + string "Temporary SPI device name for loopback test" |
| 21 | + default "spi_loop" |
| 22 | + |
| 23 | +config RT_UTEST_SPI_LOOPBACK_DATA_SIZE |
| 24 | + int "SPI loopback maximum test data size" |
| 25 | + range 1 65535 |
| 26 | + default 512 |
| 27 | + |
| 28 | +config RT_UTEST_SPI_LOOPBACK_MAX_HZ |
| 29 | + int "SPI loopback maximum clock frequency (Hz)" |
| 30 | + range 1 100000000 |
| 31 | + default 10000000 |
| 32 | + help |
| 33 | + The test automatically builds the clock matrix from standard SPI |
| 34 | + frequencies up to this value, and always includes this maximum value. |
| 35 | + |
| 36 | +config RT_UTEST_SPI_LOOPBACK_API_SMOKE |
| 37 | + bool "Enable SPI TX-only/RX-only API smoke test" |
| 38 | + default n |
| 39 | + help |
| 40 | + Enable this to smoke-test TX-only and RX-only transfer APIs by return |
| 41 | + length. These transfers do not validate MOSI/MISO loopback data and |
| 42 | + may be unsupported or unstable on some BSP SPI controllers. |
| 43 | + |
| 44 | +config RT_UTEST_SPI_LOOPBACK_TIMEOUT |
| 45 | + int "SPI loopback test timeout (s)" |
| 46 | + range 1 3600 |
| 47 | + default 60 |
| 48 | + |
| 49 | +endif |
| 50 | + |
| 51 | +config RT_UTEST_SPI_FLASH |
| 52 | + bool "SPI Flash SFUD Read/Write Test" |
| 53 | + select RT_USING_SPI |
| 54 | + select RT_USING_SFUD |
| 55 | + select RT_SFUD_USING_SFDP |
| 56 | + select RT_SFUD_USING_FLASH_INFO_TABLE |
| 57 | + select RT_USING_HEAP |
| 58 | + default n |
| 59 | + |
| 60 | +if RT_UTEST_SPI_FLASH |
| 61 | + |
| 62 | +config RT_UTEST_SPI_FLASH_SPI_DEV_NAME |
| 63 | + string "SPI device name for SFUD flash" |
| 64 | + default "spi20" |
| 65 | + help |
| 66 | + The SPI device that connects to the flash, such as spi20. If it does |
| 67 | + not exist yet, the test attaches it to the configured SPI bus and CS pin. |
| 68 | + |
| 69 | +config RT_UTEST_SPI_FLASH_BUS_NAME |
| 70 | + string "SPI bus name for flash device attach" |
| 71 | + default "spi2" |
| 72 | + help |
| 73 | + The SPI bus used when the test needs to attach the SPI flash device. |
| 74 | + |
| 75 | +config RT_UTEST_SPI_FLASH_CS_PIN |
| 76 | + int "SPI flash CS pin index" |
| 77 | + range -1 32767 |
| 78 | + default -1 |
| 79 | + help |
| 80 | + Use the RT-Thread pin index used by the BSP, such as a GET_PIN() value |
| 81 | + on STM32. -1 means PIN_NONE. |
| 82 | + |
| 83 | +config RT_UTEST_SPI_FLASH_DEV_NAME |
| 84 | + string "SFUD flash model/device name" |
| 85 | + default "W25Q64" |
| 86 | + help |
| 87 | + This is the SFUD flash device name used to find or register the flash, |
| 88 | + and is usually set to the board flash model name, such as W25Q64 or |
| 89 | + W25Q128. SFUD still verifies the actual chip by JEDEC ID and SFDP or |
| 90 | + its flash information table when probing. |
| 91 | + |
| 92 | +config RT_UTEST_SPI_FLASH_TEST_OFFSET |
| 93 | + hex "SPI flash test offset" |
| 94 | + default 0x0 |
| 95 | + |
| 96 | +config RT_UTEST_SPI_FLASH_TEST_SIZE |
| 97 | + int "SPI flash test data size" |
| 98 | + range 1 4096 |
| 99 | + default 256 |
| 100 | + |
| 101 | +endif |
| 102 | + |
| 103 | +endmenu |
0 commit comments