xref: /nrf52832-nimble/rt-thread/components/drivers/spi/spi_flash_sfud.h (revision 104654410c56c573564690304ae786df310c91fc)
1 /*
2  * Copyright (c) 2006-2018, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2016-09-28     armink       first version.
9  */
10 
11 #ifndef _SPI_FLASH_SFUD_H_
12 #define _SPI_FLASH_SFUD_H_
13 
14 #include <rtthread.h>
15 #include <rtdevice.h>
16 #include "./sfud/inc/sfud.h"
17 #include "spi_flash.h"
18 
19 /**
20  * Probe SPI flash by SFUD(Serial Flash Universal Driver) driver library and though SPI device.
21  *
22  * @param spi_flash_dev_name the name which will create SPI flash device
23  * @param spi_dev_name using SPI device name
24  *
25  * @return probed SPI flash device, probe failed will return RT_NULL
26  */
27 rt_spi_flash_device_t rt_sfud_flash_probe(const char *spi_flash_dev_name, const char *spi_dev_name);
28 
29 /**
30  * Delete SPI flash device
31  *
32  * @param spi_flash_dev SPI flash device
33  *
34  * @return the operation status, RT_EOK on successful
35  */
36 rt_err_t rt_sfud_flash_delete(rt_spi_flash_device_t spi_flash_dev);
37 
38 /**
39  * Find sfud flash device
40  *
41  * @param spi_dev_name using SPI device name
42  *
43  * @return sfud flash device if success, otherwise return RT_NULL
44  */
45 sfud_flash_t rt_sfud_flash_find(const char *spi_dev_name);
46 
47 #endif /* _SPI_FLASH_SFUD_H_ */
48