Atmel Software Framework

fat.c File Reference
#include "conf_explorer.h"
#include "fs_com.h"
#include "fat.h"
#include <LIB_MEM>
#include <LIB_CTRLACCESS>

Macros

#define _fat_c_
 

Functions

bool fat_cache_flush (void)
 This function flushes the sector cache on the memory if necessary. More...
 
bool fat_cache_read_sector (bool b_load)
 This function loads a memory sector in internal cache sector. More...
 
void fat_cache_reset (void)
 This function resets the sector cache. More...
 
bool fat_check_device (void)
 This function checks device state. More...
 
bool fat_check_eof_name (uint16_t character)
 Check end of name. More...
 
bool fat_check_is_file (void)
 This function checks if the selected file entry is a file and not a directory. More...
 
bool fat_check_mount (void)
 This function checks if the partition is mounted. More...
 
bool fat_check_mount_noopen (void)
 This function checks if the partition is mounted and no file is opened. More...
 
bool fat_check_mount_select (void)
 This function checks if the partition is mounted and if a file is selected. More...
 
bool fat_check_mount_select_noopen (void)
 This function checks if the partition is mounted and if no file is opened and a file is selected. More...
 
bool fat_check_mount_select_open (void)
 This function checks if the partition is mounted and if a file is opened. More...
 
bool fat_check_noopen (void)
 This function checks if a file is not opened on current navigator. More...
 
bool fat_check_open (void)
 This function checks if a file is opened on current navigator. More...
 
bool fat_check_select (void)
 This function checks if a file is selected on current navigator. More...
 
void fat_clear_entry_info_and_ptr (void)
 This function resets the selection pointers. More...
 
bool fat_cluster_list (uint8_t opt_action, bool b_for_file)
 This function gets or clears a cluster list. More...
 
bool fat_entry_check (bool b_type)
 This function checks the entry. More...
 
bool fat_entry_checkext (FS_STRING sz_filter)
 This function checks the file extension. More...
 
bool fat_entry_is_dir (void)
 This function checks if the entry file is a directory. More...
 
bool fat_entry_longname (FS_STRING sz_name, uint8_t u8_size_max, bool b_mode, bool b_match_case)
 This function returns or compares the long name entry. More...
 
bool fat_entry_shortname (FS_STRING sz_name, uint8_t u8_size_max, bool b_mode)
 This function returns or compares the short name entry. More...
 
void fat_get_entry_info (void)
 This function reads information about selected file. More...
 
uint8_t fat_get_nbpartition (void)
 This function returns the number of partition on current drive. More...
 
PTR_CACHE fat_get_ptr_entry (void)
 This function returns a cache pointer on the current entry. More...
 
bool fat_read_dir (void)
 This function fill the internal cache with a sector from current directory. More...
 
bool fat_read_file (uint8_t mode)
 This function gets or clears a cluster list at the current position in the selected file. More...
 
Internal functions to manage cluster list caches
void fat_cache_clusterlist_update_start (bool b_for_file)
 This function initializes a cache in cluster list caches. More...
 
void fat_cache_clusterlist_update_finish (void)
 This function updates a cache of cluster list caches. More...
 
bool fat_cache_clusterlist_update_read (bool b_for_file)
 This function searches a cluster list in cluster list caches. More...
 
void fat_cache_clusterlist_update_select (void)
 This function signals that a cache is used. More...
 
void fat_cache_clusterlist_reset (void)
 This function resets the cluster list caches. More...
 

Variables

Variables to manage cluster list caches
_MEM_TYPE_SLOW_
Fs_clusterlist_cache 
fs_g_cache_clusterlist [FS_NB_CACHE_CLUSLIST *2]
 
_MEM_TYPE_SLOW_ uint8_t fs_g_u8_current_cache
 

Position of the current cluster in the FAT <br>

Global variable used to take time with routines fat_cluster_readnext() and fat_cluster_val()

_MEM_TYPE_FAST_ uint16_t fs_g_u16_pos_fat
 
bool fat_cluster_val (bool b_mode)
 This function returns or modifies a cluster value in FAT. More...
 
bool fat_cluster_readnext (void)
 This function is optimized to read a continue cluster list on FAT16 and FAT32. More...
 
uint8_t fat_checkcluster (void)
 This function checks the cluster value. More...
 

#define _fat_c_

bool fat_cache_clusterlist_update_read ( bool  b_for_file)

This function searches a cluster list in cluster list caches.

Parameters
b_for_fileIf true then it is a file cluster list else a directory cluster list
Returns
true cluster list found and global variable fs_g_seg updated
false no found in cluster list caches

References fat_cache_clusterlist_update_select(), fat_cache_clusterlist_update_start(), fs_g_cache_clusterlist, fs_g_cluster, fs_g_nav, fs_g_seg, fs_g_u8_current_cache, FS_NB_CACHE_CLUSLIST, Fs_segment::u32_addr, Fs_clusterlist_cache::u32_addr, Fs_management::u32_offset_data, st_fs_cluster::u32_pos, Fs_management::u32_ptr_fat, Fs_clusterlist_cache::u32_size, Fs_segment::u32_size_or_pos, Fs_clusterlist_cache::u32_start, Fs_management::u8_BPB_SecPerClus, Fs_management::u8_lun, and Fs_clusterlist_cache::u8_lun.

Referenced by fat_cluster_list().

void fat_cache_clusterlist_update_select ( void  )
void fat_cache_clusterlist_update_start ( bool  b_for_file)

_MEM_TYPE_FAST_ uint16_t fs_g_u16_pos_fat

Referenced by fat_cluster_val().