fatfs_vfs.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* Copyright (C) 2016 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _FATFS_VFS_H_
  13. #define _FATFS_VFS_H_
  14. #include "osi_compiler.h"
  15. OSI_EXTERN_C_BEGIN
  16. struct blockDevice;
  17. /**
  18. * \brief mount FAT to VFS
  19. *
  20. * \param base_path mount point in VFS
  21. * \param bdev block device instance
  22. * \return
  23. * - 0 on success
  24. * - -1 on fail
  25. */
  26. int fatfs_vfs_mount(const char *base_path, struct blockDevice *bdev);
  27. /**
  28. * \brief format FAT on block device
  29. *
  30. * \param bdev block device instance
  31. * \return
  32. * - 0 on success
  33. * - -1 on fail
  34. */
  35. int fatfs_vfs_mkfs(struct blockDevice *bdev);
  36. /**
  37. * \brief set fat volume label
  38. *
  39. * The maximum length of volume label is 12 characters.
  40. *
  41. * \param mount mount point of fat file system
  42. * \param label volume label to be set
  43. * \return
  44. * - 0 on success
  45. * - -1 on fail
  46. */
  47. int fatfs_vfs_set_volume(const char *mount, const char *label);
  48. /**
  49. * \brief get fat volume label and serial number
  50. *
  51. * Both of \p label and \p sn can be NULL.
  52. *
  53. * \param mount mount point of fat file system
  54. * \param label volume label of the file sytem
  55. * \param sn serial number of the file system
  56. * \return
  57. * - 0 on success
  58. * - -1 on fail
  59. */
  60. int fatfs_vfs_get_volume(const char *mount, char *label, uint32_t *sn);
  61. OSI_EXTERN_C_END
  62. #endif