Where can I find guidance about how to use the function in FS Library? I'm trying to use these functions in rl_fs_lib.h (from MDK-Middleware 7.11.1) but don't know how to pass the pointer properly
extern int32_t fat_handle_get(fsFAT_Volume *vol); extern fsStatus fat_init (fsFAT_Volume *vol); extern fsStatus fat_uninit (fsFAT_Volume *vol); extern fsStatus fat_mount (fsFAT_Volume *vol); extern fsStatus fat_unmount (fsFAT_Volume *vol); extern fsStatus fat_open (int32_t handle, const char *name, int32_t openmode); extern fsStatus fat_close (int32_t handle); extern int32_t fat_read (int32_t handle, uint8_t *buf, uint32_t len); extern int32_t fat_write (int32_t handle, const uint8_t *buf, uint32_t len); extern fsStatus fat_flush (int32_t handle); extern int32_t fat_flen (int32_t handle); extern fsStatus fat_seek (int32_t handle, uint32_t pos);
and also I'm trying to partition a TF card into several volumes and drive them seperately by change the DrvLet string in the code below:
typedef struct _fsFAT_Volume { uint32_t DrvLet; /* 4-byte encoded drive letter string */ FS_MUTEX Mutex; /* Volume mutex */ FAT_DRV *Drv; /* Registered FAT Device Driver */ uint32_t Status; /* Volume Status */ uint32_t *CaBuf; /* Cache Buffer (FAT + Data) */ uint32_t CaSize; /* Cache Buffer size */ uint32_t free_clus_cnt; /* FAT32: Number of free clusters */ uint32_t free_clus; /* FAT32: First free cluster */ uint32_t cdir_clus; /* Current directory cluster */ NCACHE *ncache; /* Name cache memory */ FSJOUR *fsj; /* File System Journal */ FATINFO cfg; /* FAT Volume configuration */ FCACHE fat; /* FAT table cache control */ DCACHE ca; /* Data cache control */ uint16_t RsvdS; /* Reserved sectors used by journal */ uint8_t Reserved[2]; /* Reserved for future use */ } fsFAT_Volume;
Does someone have insight about what function can be used to assign values to this DrvLet?
I believe you want be using the higher level functions, like finit() (which assigns drive letter) and fmount(), instead of the lower level functions (I think those are proprietary, but I can't remember for sure). Here is a link to a page with an example: www.keil.com/.../group__system__routines.html