Library Functions.
More...
Library Functions.
| uint8_t TM_FATFS_CheckCardDetectPin |
( |
void |
| ) |
|
Checks card detect pin (if activated) if card is inserted.
- Note
- Pin must be set low in order to get card inserted, otherwise card is not inserted
-
Card detect pin must be activated in order to get this functionality to work
- Parameters
-
- Return values
-
| Card | detected status:
- 0: Card is not inserted
- > 0: Card is inserted
|
| FRESULT TM_FATFS_Search |
( |
char * |
Folder, |
|
|
char * |
tmp_buffer, |
|
|
uint16_t |
tmp_buffer_size, |
|
|
TM_FATFS_Search_t * |
FindStructure |
|
) |
| |
Searches on SD card for files and folders.
- Note
- It will search recursive till the end of everything or if tmp_buffer is full
- Parameters
-
| *Folder | Folder start location where search will be performed |
| *tmp_buffer | Pointer to empty buffer where temporary data for filepath will be stored. It's size must be larger than bigest filepath on FATFS. Set this parameter to NULL and function will use LIB_ALLOC_FUNC() to allocate memory for tmp buffer of size
|
| tmp_buffer_size | Number of bytes reserver for tmp_buffer so we won't overlaps buffer |
| *FindStructure | Pointer to TM_FATFS_Search_t structure |
- Return values
-
| Member | of FRESULT enumeration |
| uint8_t TM_FATFS_SearchCallback |
( |
char * |
path, |
|
|
uint8_t |
is_file, |
|
|
TM_FATFS_Search_t * |
FindStructure |
|
) |
| |
Search procedure callback function with filename result.
- Parameters
-
| *path | Full path and file/folder name from search operation |
| is_file | Is item a file or directory:
- 0: Item is folder
- > 0: Item is file
|
| Pointer | to TM_FATFS_Search_t structure which was passed to TM_FATFS_Search with updated data |
- Return values
-
| Search | status:
- 0: Stop search operation
- > 0: Continue with search
|
- Note
- With __weak parameter to prevent link errors if not defined by user
| FRESULT TM_FATFS_TruncateBeginning |
( |
FIL * |
fil, |
|
|
uint32_t |
index |
|
) |
| |
Truncates beginning of file.
Example:
- You have a file, its content is: "abcdefghijklmnoprstuvwxyz",
- You want to truncate first 5 bytes,
- Call TM_FATFS_TruncateBeginning(&opened_file, 5);
- You will get new file data: "fghijklmnoprstuvwxyz"
- Parameters
-
| *fil | Pointer to already opened file |
| index | Number of characters that will be truncated from beginning |
- Note
- If index is more than file size, everything will be truncated, but file will not be deleted
- Return values
-
| Member | of FRESULT enumeration |