TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle
tm_stm32_fatfs.h
1 
37 #ifndef TM_FATFS_H
38 #define TM_FATFS_H 110
39 
40 /* C++ detection */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 
331 #include "stm32fxxx_hal.h"
332 #include "defines.h"
333 #include "attributes.h"
334 #include "tm_stm32_gpio.h"
335 #include "ff.h"
336 #include "diskio.h"
337 #include "string.h"
338 #include "stdlib.h"
339 
353 #ifndef FATFS_TRUNCATE_BUFFER_SIZE
354 #define FATFS_TRUNCATE_BUFFER_SIZE 256
355 #endif
356 
357 /* Memory allocation function */
358 #ifndef LIB_ALLOC_FUNC
359 #define LIB_ALLOC_FUNC malloc
360 #endif
361 
362 /* Memory free function */
363 #ifndef LIB_FREE_FUNC
364 #define LIB_FREE_FUNC free
365 #endif
366 
380 typedef struct {
381  uint32_t Total;
382  uint32_t Free;
384 
388 typedef struct {
389  uint32_t FoldersCount;
390  uint32_t FilesCount;
392 
410 FRESULT TM_FATFS_GetDriveSize(char* str, TM_FATFS_Size_t* SizeStruct);
411 
426 FRESULT TM_FATFS_TruncateBeginning(FIL* fil, uint32_t index);
427 
437 uint8_t TM_FATFS_CheckCardDetectPin(void);
438 
449 FRESULT TM_FATFS_Search(char* Folder, char* tmp_buffer, uint16_t tmp_buffer_size, TM_FATFS_Search_t* FindStructure);
450 
463 uint8_t TM_FATFS_SearchCallback(char* path, uint8_t is_file, TM_FATFS_Search_t* FindStructure);
464 
477 /* C++ detection */
478 #ifdef __cplusplus
479 }
480 #endif
481 
482 #endif
483 
uint32_t FoldersCount
Definition: tm_stm32_fatfs.h:389
uint32_t Total
Definition: tm_stm32_fatfs.h:381
FRESULT TM_FATFS_TruncateBeginning(FIL *fil, uint32_t index)
Truncates beginning of file.
uint32_t FilesCount
Definition: tm_stm32_fatfs.h:390
FATFS size structure.
Definition: tm_stm32_fatfs.h:380
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.
FATFS find structure.
Definition: tm_stm32_fatfs.h:388
uint32_t Free
Definition: tm_stm32_fatfs.h:382
uint8_t TM_FATFS_CheckCardDetectPin(void)
Checks card detect pin (if activated) if card is inserted.
uint8_t TM_FATFS_SearchCallback(char *path, uint8_t is_file, TM_FATFS_Search_t *FindStructure)
Search procedure callback function with filename result.