Lines Matching refs:flash_dev
20 int single_sector_test(const struct device *flash_dev) in single_sector_test() argument
38 rc = flash_erase(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, in single_sector_test()
49 rc = flash_write(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, expected, len); in single_sector_test()
56 rc = flash_read(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, buf, len); in single_sector_test()
82 int multi_sector_test(const struct device *flash_dev) in multi_sector_test() argument
102 rc = flash_erase(flash_dev, SPI_FLASH_TEST_REGION_OFFSET, SPI_FLASH_SECTOR_SIZE * 2); in multi_sector_test()
111 rc = flash_read(flash_dev, offs, buf, len); in multi_sector_test()
132 rc = flash_write(flash_dev, offs, expected, len); in multi_sector_test()
139 rc = flash_read(flash_dev, offs, buf, len); in multi_sector_test()
169 const struct device *flash_dev = DEVICE_DT_GET(DT_ALIAS(flash0)); in main() local
171 if (!device_is_ready(flash_dev)) { in main()
172 printk("%s: device not ready.\n", flash_dev->name); in main()
176 printf("\n%s SPI flash testing\n", flash_dev->name); in main()
179 if (single_sector_test(flash_dev)) { in main()
183 if (multi_sector_test(flash_dev)) { in main()