fal_flash_init.c 593 B

12345678910111213141516171819202122232425262728
  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. * 2018-12-29 flybreak first implementation
  9. */
  10. #include <rtthread.h>
  11. #include <fal.h>
  12. #include <easyflash.h>
  13. #define FAL_FS_PART_NAME "fs"
  14. #define FAL_DOWNLOAD_PART_NAME "download"
  15. int rt_fal_flash_init(void)
  16. {
  17. fal_init();
  18. easyflash_init();
  19. fal_blk_device_create(FAL_FS_PART_NAME);
  20. fal_char_device_create(FAL_DOWNLOAD_PART_NAME);
  21. return 0;
  22. }
  23. INIT_DEVICE_EXPORT(rt_fal_flash_init);