spi_flash_sfud.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * File : spi_flash_sfud.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2016, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2016-09-28 armink first version.
  23. */
  24. #ifndef _SPI_FLASH_SFUD_H_
  25. #define _SPI_FLASH_SFUD_H_
  26. #include <rtthread.h>
  27. #include "./sfud/inc/sfud.h"
  28. /**
  29. * Probe SPI flash by SFUD(Serial Flash Universal Driver) driver library and though SPI device.
  30. *
  31. * @param spi_flash_dev_name the name which will create SPI flash device
  32. * @param spi_dev_name using SPI device name
  33. *
  34. * @return probed SPI flash device, probe failed will return RT_NULL
  35. */
  36. rt_spi_flash_device_t rt_sfud_flash_probe(const char *spi_flash_dev_name, const char *spi_dev_name);
  37. /**
  38. * Delete SPI flash device
  39. *
  40. * @param spi_flash_dev SPI flash device
  41. *
  42. * @return the operation status, RT_EOK on successful
  43. */
  44. rt_err_t rt_sfud_flash_delete(rt_spi_flash_device_t spi_flash_dev);
  45. #endif /* _SPI_FLASH_SFUD_H_ */