spi_flash_sfud.h 1.2 KB
Newer Older
1
/*
2
 * Copyright (c) 2006-2018, RT-Thread Development Team
3
 *
4
 * SPDX-License-Identifier: Apache-2.0
5 6 7 8 9 10 11 12 13 14
 *
 * Change Logs:
 * Date           Author       Notes
 * 2016-09-28     armink       first version.
 */

#ifndef _SPI_FLASH_SFUD_H_
#define _SPI_FLASH_SFUD_H_

#include <rtthread.h>
armink_ztl's avatar
armink_ztl 已提交
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 23
 * @param spi_flash_dev_name the name which will create SPI flash device
 * @param spi_dev_name using SPI device name
24
 *
25
 * @return probed SPI flash device, probe failed will return RT_NULL
26
 */
27 28 29 30 31 32 33 34 35 36
rt_spi_flash_device_t rt_sfud_flash_probe(const char *spi_flash_dev_name, const char *spi_dev_name);

/**
 * Delete SPI flash device
 *
 * @param spi_flash_dev SPI flash device
 *
 * @return the operation status, RT_EOK on successful
 */
rt_err_t rt_sfud_flash_delete(rt_spi_flash_device_t spi_flash_dev);
37

38 39 40 41 42 43 44 45 46
/**
 * Find sfud flash device
 *
 * @param spi_dev_name using SPI device name
 *
 * @return sfud flash device if success, otherwise return RT_NULL
 */
sfud_flash_t rt_sfud_flash_find(const char *spi_dev_name);

47
#endif /* _SPI_FLASH_SFUD_H_ */