#include <ctype.h>
#include "conf_explorer.h"
#include "navigation.h"
#include "file.h"
#include "ctrl_access.h"
Macros | |
#define | SIZE_OF_SPLIT_COPY ((1*1024*1024L)/512L) |
Functions | |
void | nav_checkdisk_disable (void) |
This function disables the disk check before each actions on disk. More... | |
void | nav_checkdisk_enable (void) |
This function enables the disk check before each actions on disk. More... | |
bool | nav_copy (uint8_t u8_idnav) |
This function copies the navigator information to another navigator. More... | |
bool | nav_dir_cd (void) |
This function enters in the selected directory in file list. More... | |
bool | nav_dir_gotoparent (void) |
This function goes to the parent directory. More... | |
bool | nav_dir_is_root (void) |
This function check the current directory. More... | |
bool | nav_dir_make (const FS_STRING sz_name) |
This function creates a directory in the directory corresponding at file list. More... | |
bool | nav_dir_name (FS_STRING sz_path, uint8_t u8_size_max) |
This function returns the directory name corresponding at the file list. More... | |
bool | nav_dir_root (void) |
This function initializes the file list on the root directory. More... | |
bool | nav_drive_format (uint8_t u8_fat_type) |
This function formats the current drive (=disk) More... | |
uint8_t | nav_drive_get (void) |
This function returns the selected drive number. More... | |
uint8_t | nav_drive_getname (void) |
This function returns the selected drive letter. More... | |
uint8_t | nav_drive_nb (void) |
This function returns the number of devices available. More... | |
bool | nav_drive_set (uint8_t u8_number) |
This function selects a drive in navigator but don't mount the disk partition. More... | |
void | nav_exit (void) |
This function flush ALL navigations before exit of file system core. More... | |
uint8_t | nav_file_attributget (void) |
This function returns the Attribute of selected file. More... | |
bool | nav_file_attributset (uint8_t u8_attribut) |
This function changes the Attribute of selected file. More... | |
bool | nav_file_checkext (const FS_STRING sz_filterext) |
This function checks the extension of selected file. More... | |
bool | nav_file_copy (void) |
This function updates the COPY navigator with the selected file. More... | |
bool | nav_file_create (const FS_STRING sz_name) |
This function creates a file with NULL size and NULL Attribute. More... | |
bool | nav_file_dateget (FS_STRING sz_date, bool type_date) |
This function returns the date of selected file. More... | |
bool | nav_file_dateset (const FS_STRING sz_date, bool type_date) |
This function changes the date of selected file. More... | |
bool | nav_file_del (bool b_only_empty) |
This function deletes the selected file or directory. More... | |
bool | nav_file_getname (FS_STRING sz_name, uint8_t u8_size_max) |
This function returns the name of selected file. More... | |
bool | nav_file_isdir (void) |
This function returns the type of selected file. More... | |
bool | nav_file_isreadonly (void) |
This function checks the write protection of disk and the Attribute "read only" of selected file. More... | |
uint32_t | nav_file_lgt (void) |
This function returns the size of selected file (unit byte) More... | |
uint16_t | nav_file_lgtsector (void) |
This function returns the size of selected file (unit sector) More... | |
bool | nav_file_name (FS_STRING sz_name, uint8_t u8_size_max, bool b_mode, bool b_match_case) |
This function returns the name of selected file or checks the string with the name of selected file. More... | |
bool | nav_file_paste_start (const FS_STRING sz_name) |
This function pastes the selected file in COPY navigator in the file list of the current navigator. More... | |
uint8_t | nav_file_paste_state (bool b_stop) |
This function executes the copy file. More... | |
bool | nav_file_rename (const FS_STRING sz_name) |
This function renames the selected directory or file. More... | |
bool | nav_filelist_bol (void) |
This function checks the beginning of file list. More... | |
bool | nav_filelist_eol (void) |
This function checks the end of file list. More... | |
bool | nav_filelist_exist (bool b_type) |
This function checks the presence of files or directories in file list. More... | |
bool | nav_filelist_fileisnotopen (void) |
This function checks if no file is open. More... | |
bool | nav_filelist_findname (const FS_STRING sz_name, bool b_match_case) |
This function searches a file name in file list. More... | |
bool | nav_filelist_first (bool b_type) |
This function goes to at the first file or directory in file list. More... | |
uint16_t | nav_filelist_get (void) |
This function returns the position of selected file in file list. More... | |
bool | nav_filelist_goto (uint16_t u16_newpos) |
This function goes at a position in file list. More... | |
bool | nav_filelist_last (bool b_type) |
This function goes to at the last file or directory in file list. More... | |
uint16_t | nav_filelist_nb (bool b_type) |
This function computes the number of files or directories in file list. More... | |
bool | nav_filelist_reset (void) |
This function resets the selection pointer, so "no file selected" in file list. More... | |
bool | nav_filelist_set (uint16_t u16_nb, bool b_direction) |
This function moves the selection pointer in file list. More... | |
bool | nav_filelist_single_disable (void) |
To display in File List the directories AND files. More... | |
bool | nav_filelist_single_enable (bool b_type) |
To display in File List only the files OR directories. More... | |
bool | nav_filelist_validpos (void) |
This function checks if a file is selected. More... | |
uint8_t | nav_get (void) |
This function returns the navigation identifier used. More... | |
bool | nav_getcwd (FS_STRING sz_path, uint8_t u8_size_path, bool b_view_file_select) |
This function returns the full path of the selection. More... | |
Fs_index | nav_getindex (void) |
This function returns a small index on the selected file. More... | |
bool | nav_gotoindex (const Fs_index _MEM_TYPE_SLOW_ *index) |
This function selects a file in the navigator via a file index. More... | |
uint8_t | nav_partition_cluster_size (void) |
This function returns the partition cluster size. More... | |
uint32_t | nav_partition_freespace (void) |
This function returns the partition free space. More... | |
uint8_t | nav_partition_freespace_percent (void) |
This function returns the partition space free in percent. More... | |
bool | nav_partition_label (bool b_action, FS_STRING sz_label) |
This function reads or writes the label of selected partition. More... | |
bool | nav_partition_mount (void) |
This function mounts the selected partition. More... | |
bool | nav_partition_serialnumber (bool b_action, uint8_t _MEM_TYPE_SLOW_ *a_u8_sn) |
This function reads or writes the serial number on the selected partition. More... | |
uint32_t | nav_partition_space (void) |
This function returns partition total space. More... | |
uint8_t | nav_partition_type (void) |
This function gives the partition type. More... | |
void | nav_reset (void) |
This function resets ALL navigations to init file system core. More... | |
bool | nav_select (uint8_t u8_idnav) |
This function selects the navigation to use. More... | |
bool | nav_setcwd (FS_STRING sz_path, bool b_match_case, bool b_create) |
This function selects a disk position via a path. More... | |
void | nav_string_length_disable (void) |
This function deselects the LENGTH string mode for all routines with FS_STRING parameter. More... | |
void | nav_string_length_enable (void) |
This function selects the LENGTH string mode for all routines with FS_STRING parameter. More... | |
Variables | |
_MEM_TYPE_SLOW_ uint8_t | fs_g_u8_nav_selected |
Holds the current navigator selected. More... | |
_MEM_TYPE_SLOW_ uint8_t | g_id_trans_memtomem = ID_STREAM_ERR |
Holds the current ID transfer used by the internal copy-paste routines. More... | |
_MEM_TYPE_SLOW_ Fs_file_segment | g_segment_dest |
_MEM_TYPE_SLOW_ Fs_file_segment | g_segment_src |
#define SIZE_OF_SPLIT_COPY ((1*1024*1024L)/512L) |
Referenced by nav_file_paste_state().
void nav_checkdisk_disable | ( | void | ) |
This function disables the disk check before each actions on disk.
//! By default, between each read/write access a check disk (test unit ready) is sent at device. //! This check can reduce the speed access on specific disk. //!
References g_b_no_check_disk.
void nav_checkdisk_enable | ( | void | ) |
This function enables the disk check before each actions on disk.
//! By default, between each read/write access a check disk (test unit ready) is sent at device. //! This check can reduce the speed access on specific disk. //!
References g_b_no_check_disk.
bool nav_copy | ( | uint8_t | u8_idnav | ) |
This function copies the navigator information to another navigator.
@param u8_idnav navigator identifier where the main navigator will be copied @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! Use this routine to select quickly the same file in another navigator //!
References fat_copy_nav(), and fs_g_u8_nav_selected.
Referenced by nav_file_copy().
bool nav_dir_cd | ( | void | ) |
This function enters in the selected directory in file list.
@return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! After this routine the file list changes and contains the files and directories of the new directory. //! By default no file is selected. //!
References fat_check_mount_select_noopen(), fat_entry_is_dir(), fs_g_nav, fs_g_nav_entry, fs_g_nav_fast, nav_filelist_reset(), Fs_management::u16_entry_pos_sel_dir, Fs_management_fast::u16_entry_pos_sel_file, Fs_management_entry::u32_cluster, and Fs_management::u32_cluster_sel_dir.
Referenced by nav_setcwd().
bool nav_dir_gotoparent | ( | void | ) |
This function goes to the parent directory.
@return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! After, the file list changes and contains the files and directories of the new directory. //! By default, the file selected in file list is the previous (children) directory. //!
References Fs_management::b_mode_nav, Fs_management::b_mode_nav_single, fat_check_mount_noopen(), fat_get_entry_info(), fat_read_dir(), FS_DIR, FS_ERR_FS, FS_ERR_IS_ROOT, FS_FIND_NEXT, fs_g_nav, fs_g_nav_entry, fs_g_nav_fast, fs_g_status, nav_filelist_reset(), nav_filelist_set(), Fs_management_fast::u16_entry_pos_sel_file, Fs_management_entry::u32_cluster, and Fs_management::u32_cluster_sel_dir.
Referenced by nav_dir_name(), nav_getcwd(), and nav_setcwd().
bool nav_dir_is_root | ( | void | ) |
This function check the current directory.
References fat_check_mount_noopen(), fs_g_nav, and Fs_management::u32_cluster_sel_dir.
This function creates a directory in the directory corresponding at file list.
sz_name | directory name (ASCII or UNICODE ) |
Referenced by nav_setcwd().
This function returns the directory name corresponding at the file list.
sz_path | string to store the name (ASCII or UNICODE ) |
u8_size_max | string size (unit ASCII or UNICODE ) |
References Fs_management::b_mode_nav, Fs_management::b_mode_nav_single, fat_check_mount_noopen(), FS_FILE, fs_g_nav, fs_g_nav_entry, fs_g_nav_fast, FS_NAME_GET, g_b_string_length, Is_unicode, nav_dir_gotoparent(), nav_drive_getname(), nav_file_name(), Fs_management::u16_entry_pos_sel_dir, Fs_management_fast::u16_entry_pos_sel_file, Fs_management_entry::u32_cluster, Fs_management::u32_cluster_sel_dir, Fs_management_entry::u32_size, and Fs_management_entry::u8_attr.
bool nav_dir_root | ( | void | ) |
This function initializes the file list on the root directory.
References nav_partition_mount().
Referenced by nav_partition_label(), and nav_setcwd().
bool nav_drive_format | ( | uint8_t | u8_fat_type | ) |
This function formats the current drive (=disk)
@param u8_fat_type Select the format type<br> FS_FORMAT_DEFAULT, The system chooses the better FAT format <br> FS_FORMAT_FAT, The FAT12 or FAT16 is used to format the drive, if possible (disk space <2GB) <br> FS_FORMAT_FAT32, The FAT32 is used to format the drive, if possible (disk space >32MB) <br> FS_FORMAT_NOMBR_FLAG, if you don't want a MRB on the disk then add this flag (e.g. specific partition structure on a CD support) @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! WARNING: This routine can't format a multi-partiton, if the disk contains a multi-partition //! then this one is erased and replaced by a single partition on ALL disk space. //!
uint8_t nav_drive_get | ( | void | ) |
This function returns the selected drive number.
References fs_g_nav, and Fs_management::u8_lun.
uint8_t nav_drive_getname | ( | void | ) |
This function returns the selected drive letter.
References fs_g_nav, and Fs_management::u8_lun.
Referenced by nav_dir_name(), and nav_getcwd().
uint8_t nav_drive_nb | ( | void | ) |
This function returns the number of devices available.
@return number of devices, 0 = NO DEVICE AVAILABLED
//! This value may be dynamic because it depends of memory drivers (e.g. Mass Storage disk on USB host mode) //!
References get_nb_lun().
bool nav_drive_set | ( | uint8_t | u8_number | ) |
This function selects a drive in navigator but don't mount the disk partition.
u8_number | device number (0 to nav_drive_nb()-1 ) |
References fat_check_noopen(), FS_ERR_END_OF_DRIVE, fs_g_nav, fs_g_nav_fast, fs_g_status, FS_TYPE_FAT_UNM, get_nb_lun(), Fs_management::u8_lun, and Fs_management_fast::u8_type_fat.
Referenced by main(), nav_gotoindex(), and nav_setcwd().
void nav_exit | ( | void | ) |
This function flush ALL navigations before exit of file system core.
//! Call this at the program exit or before a USB Device session //!
References fat_cache_flush(), file_close(), FS_NB_NAVIGATOR, and nav_select().
uint8_t nav_file_attributget | ( | void | ) |
This function returns the Attribute of selected file.
References fs_g_nav_entry, and Fs_management_entry::u8_attr.
bool nav_file_attributset | ( | uint8_t | u8_attribut | ) |
This function changes the Attribute of selected file.
u8_attribut | value to write on selected file, see masks "FS_ATTR_" in fs_com.h file. |
This function checks the extension of selected file.
sz_filterext | extension filter (ASCII format, e.g.: "txt" or "txt,d*,wk" ) |
References fat_check_mount_select(), fat_entry_checkext(), and fat_read_dir().
bool nav_file_copy | ( | void | ) |
This function updates the COPY navigator with the selected file.
@return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! If you use the COPY navigator after this routine then the copy information is lost (see FS_NAV_ID_COPYFILE in conf_explorer.h). //!
References FS_ERR_COPY_DIR, fs_g_status, FS_NAV_ID_COPYFILE, nav_copy(), and nav_file_isdir().
This function creates a file with NULL size and NULL Attribute.
@param sz_name file name to create (ASCII or UNICODE ) @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! If you use this routine to create a file, then you must called file_open() to open this new file //!
References Fs_management::b_mode_nav, fat_cache_flush(), fat_create_entry_file_name(), FS_ERR_FILE_EXIST, FS_FILE, fs_g_nav, fs_g_nav_entry, fs_g_status, nav_filelist_findname(), nav_filelist_reset(), Fs_management::u16_pos_sel_file, Fs_management_entry::u32_cluster, Fs_management_entry::u32_size, and Fs_management_entry::u8_attr.
Referenced by main(), nav_file_paste_start(), and nav_setcwd().
This function returns the date of selected file.
type_date | FS_DATE_LAST_WRITE, to get the date of last write access FS_DATE_CREATION, to get the date of file creation |
sz_date | ASCCI string (>17B) to store the information about date "YYYYMMDDHHMMSSMS" = year, month, day, hour, minute, second, millisecond |
References fat_check_mount_select(), fat_get_date(), and fat_read_dir().
This function changes the date of selected file.
type_date | FS_DATE_LAST_WRITE, to get the date of last write access FS_DATE_CREATION, to get the date of file creation |
sz_date | ASCCI string contains the date to write "YYYYMMDDHHMMSSMS" = year, month, day, hour, minute, second, millisecond |
This function deletes the selected file or directory.
b_only_empty | true, delete the directory only if empty false, delete directories and files include in selected directory If the selection is not a directory then this param is ignored. |
Referenced by nav_file_paste_state().
This function returns the name of selected file.
sz_name | string to store the name file (ASCII or UNICODE ) |
u8_size_max | string size (unit ASCII or UNICODE ) |
References FS_NAME_GET, and nav_file_name().
bool nav_file_isdir | ( | void | ) |
This function returns the type of selected file.
References fat_entry_is_dir().
Referenced by nav_file_copy().
bool nav_file_isreadonly | ( | void | ) |
This function checks the write protection of disk and the Attribute "read only" of selected file.
References fat_check_mount_select(), FS_ATTR_READ_ONLY, fs_g_nav, fs_g_nav_entry, mem_wr_protect(), Fs_management_entry::u8_attr, and Fs_management::u8_lun.
uint32_t nav_file_lgt | ( | void | ) |
This function returns the size of selected file (unit byte)
References fs_g_nav_entry, and Fs_management_entry::u32_size.
Referenced by nav_file_paste_state().
uint16_t nav_file_lgtsector | ( | void | ) |
This function returns the size of selected file (unit sector)
References FS_512B_SHIFT_BIT, fs_g_nav_entry, and Fs_management_entry::u32_size.
This function returns the name of selected file or checks the string with the name of selected file.
b_mode | action mode: FS_NAME_GET to get the name of selected file FS_NAME_CHECK to check the name of selected file |
sz_name | if FS_NAME_GET then string to store the file name (ASCII or UNICODE ) if FS_NAME_CHECK then string to match with file name (ASCII or UNICODE), it must be terminated by NULL or '*' value |
b_match_case | false, ignore the case (only used in "FS_NAME_CHECK" action) |
u8_size_max | string size (unit ASCII or UNICODE ), only used in "FS_NAME_GET" action |
References _MEM_TYPE_SLOW_, fat_check_mount_select(), fat_entry_longname(), fat_entry_shortname(), fat_read_dir(), FS_ERR_ENTRY_BAD, fs_g_nav_fast, fs_g_status, FS_NAME_GET, FS_NO_LAST_LFN_ENTRY, FS_SIZE_LFN_ENTRY, g_b_string_length, Is_unicode, and Fs_management_fast::u16_entry_pos_sel_file.
Referenced by nav_dir_name(), nav_file_getname(), nav_filelist_findname(), and nav_getcwd().
This function pastes the selected file in COPY navigator in the file list of the current navigator.
@param sz_name file name of the new file (ASCII or UNICODE ) @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! After this routine, you shall called nav_file_paste_state() to run and way the copy //!
References file_close(), file_open(), FOPEN_MODE_R, FOPEN_MODE_W_PLUS, FS_ERR_COPY_RUNNING, fs_g_status, FS_NAV_ID_COPYFILE, g_id_trans_memtomem, g_segment_src, ID_STREAM_ERR, nav_file_create(), nav_get(), nav_select(), and Fs_file_segment::u16_size.
uint8_t nav_file_paste_state | ( | bool | b_stop | ) |
This function executes the copy file.
b_stop | set true to stop copy action |
References _MEM_TYPE_SLOW_, COPY_BUSY, COPY_FAIL, COPY_FINISH, CTRL_BUSY, CTRL_FAIL, CTRL_GOOD, file_close(), file_eof(), file_read(), file_seek(), file_set_eof(), file_write(), FS_512B, FS_NAV_ID_COPYFILE, FS_SEEK_CUR_RE, FS_SEEK_SET, g_id_trans_memtomem, g_segment_dest, g_segment_src, ID_STREAM_ERR, nav_file_del(), nav_file_lgt(), nav_get(), nav_select(), SIZE_OF_SPLIT_COPY, stream_mem_to_mem(), stream_state(), stream_stop(), Fs_file_segment::u16_size, Fs_file_segment::u32_addr, and Fs_file_segment::u8_lun.
This function renames the selected directory or file.
sz_name | new name (ASCII or UNICODE ) |
bool nav_filelist_bol | ( | void | ) |
This function checks the beginning of file list.
References FS_FIND_NEXT, FS_FIND_PREV, and nav_filelist_set().
bool nav_filelist_eol | ( | void | ) |
This function checks the end of file list.
References Fs_management::b_mode_nav, FS_DIR, FS_FIND_NEXT, FS_FIND_PREV, fs_g_nav, fs_g_nav_fast, FS_NO_SEL, nav_filelist_set(), Fs_management_fast::u16_entry_pos_sel_file, and Fs_management::u16_pos_sel_file.
This function checks the presence of files or directories in file list.
b_type | FS_DIR to check the directory presence FS_FILE to check the file presence |
References FS_FIND_NEXT, fs_g_nav, FS_NO_SEL, nav_filelist_first(), nav_filelist_reset(), nav_filelist_set(), and Fs_management::u16_pos_sel_file.
bool nav_filelist_fileisnotopen | ( | void | ) |
This function checks if no file is open.
References fat_check_noopen().
This function searches a file name in file list.
@param sz_name name to search (UNICODE or ASCII) <br> It must be terminate by NULL or '*' value @param b_match_case false to ignore the case @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! This function starts a search at the next position of the current in file list //!
References FS_FIND_NEXT, FS_NAME_CHECK, nav_file_name(), and nav_filelist_set().
Referenced by nav_file_create(), and nav_setcwd().
This function goes to at the first file or directory in file list.
b_type | FS_DIR to go at the first directory FS_FILE to go at the first file |
References Fs_management::b_mode_nav, FS_ERR_NO_FIND, FS_FIND_NEXT, fs_g_nav, fs_g_status, nav_filelist_reset(), and nav_filelist_set().
Referenced by nav_filelist_exist(), and nav_filelist_last().
uint16_t nav_filelist_get | ( | void | ) |
This function returns the position of selected file in file list.
References fs_g_nav, and Fs_management::u16_pos_sel_file.
Referenced by nav_filelist_goto().
bool nav_filelist_goto | ( | uint16_t | u16_newpos | ) |
This function goes at a position in file list.
u16_newpos | new position to select (0 is the first position) |
References FS_FIND_NEXT, FS_FIND_PREV, FS_NO_SEL, nav_filelist_get(), nav_filelist_reset(), and nav_filelist_set().
This function goes to at the last file or directory in file list.
b_type | FS_DIR to go at the last directory FS_FILE to go at the last file |
References FS_ERR_NO_FIND, FS_FIND_NEXT, fs_g_status, nav_filelist_first(), nav_filelist_nb(), and nav_filelist_set().
uint16_t nav_filelist_nb | ( | bool | b_type | ) |
This function computes the number of files or directories in file list.
b_type | FS_DIR to compute the number of directories FS_FILE to compute the number of files |
References Fs_management::b_mode_nav, FS_FILE, FS_FIND_NEXT, fs_g_nav, FS_NO_SEL, nav_filelist_reset(), nav_filelist_set(), and Fs_management::u16_pos_sel_file.
Referenced by nav_filelist_last().
bool nav_filelist_reset | ( | void | ) |
This function resets the selection pointer, so "no file selected" in file list.
References fat_check_mount_noopen(), and fat_clear_entry_info_and_ptr().
Referenced by nav_dir_cd(), nav_dir_gotoparent(), nav_file_create(), nav_filelist_exist(), nav_filelist_first(), nav_filelist_goto(), nav_filelist_nb(), nav_filelist_single_disable(), nav_filelist_single_enable(), nav_gotoindex(), and nav_setcwd().
This function moves the selection pointer in file list.
@param u16_nb numbers of file to jump before stopping action <br> 0, stop at the first file found <br> 1, stop at the second file found <br> @param b_direction search direction <br> FS_FIND_NEXT, move to next file or directory FS_FIND_PREV, move to previous file or directory @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! Note: if no file is selected then nav_filelist_set( 0 , FS_NEXT ) goes to the first entry of the file list. //!
References Fs_management::b_mode_nav, Fs_management::b_mode_nav_single, fat_check_mount_noopen(), fat_entry_check(), fat_get_entry_info(), fat_read_dir(), FS_DIR, FS_END_FIND, FS_ERR_ENTRY_EMPTY, FS_ERR_FS, FS_ERR_NO_FIND, FS_ERR_OUT_LIST, FS_FILE, FS_FIND_NEXT, fs_g_nav, fs_g_nav_fast, fs_g_status, FS_NO_SEL, Fs_management_fast::u16_entry_pos_sel_file, and Fs_management::u16_pos_sel_file.
Referenced by nav_dir_gotoparent(), nav_filelist_bol(), nav_filelist_eol(), nav_filelist_exist(), nav_filelist_findname(), nav_filelist_first(), nav_filelist_goto(), nav_filelist_last(), nav_filelist_nb(), and nav_gotoindex().
bool nav_filelist_single_disable | ( | void | ) |
To display in File List the directories AND files.
References Fs_management::b_mode_nav_single, fs_g_nav, and nav_filelist_reset().
To display in File List only the files OR directories.
b_type | FS_DIR to display only directories presence FS_FILE to display only files presence |
References Fs_management::b_mode_nav, Fs_management::b_mode_nav_single, fs_g_nav, and nav_filelist_reset().
bool nav_filelist_validpos | ( | void | ) |
This function checks if a file is selected.
References fat_check_mount_select_noopen().
uint8_t nav_get | ( | void | ) |
This function returns the navigation identifier used.
References fs_g_u8_nav_selected.
Referenced by nav_file_paste_start(), and nav_file_paste_state().
This function returns the full path of the selection.
sz_path | string to store the path (ASCII or UNICODE ) |
u8_size_path | string size (unit ASCII or UNICODE ) |
b_view_file_select | true, to include in path the selected file name |
References _MEM_TYPE_SLOW_, fat_check_mount_noopen(), fat_check_select(), FS_ERR_BUFFER_FULL, FS_ERR_IS_ROOT, fs_g_status, FS_NAME_GET, g_b_string_length, Is_unicode, nav_dir_gotoparent(), nav_drive_getname(), nav_file_name(), nav_getindex(), and nav_gotoindex().
Fs_index nav_getindex | ( | void | ) |
This function returns a small index on the selected file.
@return It is a small index structure with information on selected file (disk, partition, dir, file/dir selected)
//! This routine is interesting to save a file position in small variable. //! This pointer allow to reinit a navigator quickly with nav_gotoindex() routine. //!
References fs_g_nav, fs_g_nav_fast, Fs_index::u16_entry_pos_sel_file, Fs_management_fast::u16_entry_pos_sel_file, Fs_index::u32_cluster_sel_dir, Fs_management::u32_cluster_sel_dir, Fs_index::u8_lun, and Fs_management::u8_lun.
Referenced by nav_getcwd(), nav_partition_label(), and nav_setcwd().
bool nav_gotoindex | ( | const Fs_index _MEM_TYPE_SLOW_ * | index | ) |
This function selects a file in the navigator via a file index.
@param index structure with information about file to select (disk, partition, dir, file/dir selected ) @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! This routine allow to reinit a navigator quickly via a file index (disk, partition, dir, file/dir selected ) //! To get a file index, you shall used the routine nav_getindex(). //!
References FS_FIND_NEXT, fs_g_nav, fs_g_nav_fast, nav_drive_set(), nav_filelist_reset(), nav_filelist_set(), nav_partition_mount(), nav_partition_set(), Fs_management_fast::u16_entry_pos_sel_file, and Fs_management::u32_cluster_sel_dir.
Referenced by nav_getcwd(), nav_partition_label(), and nav_setcwd().
uint8_t nav_partition_cluster_size | ( | void | ) |
This function returns the partition cluster size.
References fs_g_nav, and Fs_management::u8_BPB_SecPerClus.
uint32_t nav_partition_freespace | ( | void | ) |
This function returns the partition free space.
@return number of free sectors @return 0 in case of error or full partition
//! You shall mounted the partition before call this routine //!
References fat_check_device(), fat_getfreespace(), fs_g_nav_fast, FS_TYPE_FAT_UNM, and Fs_management_fast::u8_type_fat.
uint8_t nav_partition_freespace_percent | ( | void | ) |
This function returns the partition space free in percent.
@return percent of free space (0% to 100%) @return 0% in case of error or full partition
//! To speed up the compute, the result have an error delta of 1% //!
References fat_check_device(), fat_getfreespace_percent(), fs_g_nav_fast, FS_TYPE_FAT_UNM, and Fs_management_fast::u8_type_fat.
This function reads or writes the label of selected partition.
b_action | to select the action FS_LABEL_READ to read label FS_LABEL_WRITE to write label |
sz_label | pointer on a ASCII string (11 chars + NULL terminator =12 bytes) if FS_LABEL_READ, then the string is used to store label if FS_LABEL_WRITE, then the string is used to give the new label |
References _MEM_TYPE_SLOW_, fat_entry_label(), fat_read_dir(), FS_ERR_ENTRY_EMPTY, fs_g_nav_fast, fs_g_status, FS_LABEL_READ, FS_LABEL_WRITE, nav_dir_root(), nav_getindex(), nav_gotoindex(), and Fs_management_fast::u16_entry_pos_sel_file.
bool nav_partition_mount | ( | void | ) |
This function mounts the selected partition.
@return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! If the FS_MULTI_PARTITION option is disabled //! then the mount routine selects the first partition supported by file system. <br> //! After mount, the file list contains files and directories of ROOT directory //!
References fat_check_noopen(), fat_clear_entry_info_and_ptr(), fat_mount(), fs_g_nav, fs_g_nav_fast, FS_TYPE_FAT_UNM, Fs_management::u32_cluster_sel_dir, and Fs_management_fast::u8_type_fat.
Referenced by main(), nav_dir_root(), nav_gotoindex(), nav_partition_type(), and nav_setcwd().
bool nav_partition_serialnumber | ( | bool | b_action, |
uint8_t _MEM_TYPE_SLOW_ * | a_u8_sn | ||
) |
This function reads or writes the serial number on the selected partition.
b_action | to select the action FS_SN_READ to read serial number FS_SN_WRITE to write serial number |
a_u8_sn | pointer on an array (4 bytes) if FS_SN_READ, then the array is used to store the serial number if FS_SN_WRITE, then the array is used to give the new serial number |
References fat_check_mount(), and fat_serialnumber().
uint32_t nav_partition_space | ( | void | ) |
This function returns partition total space.
@return number of sectors @return 0, in case of error
//! You shall mounted the partition before call this routine //!
References fat_check_device(), fs_g_nav, fs_g_nav_fast, FS_TYPE_FAT_UNM, Fs_management::u32_CountofCluster, Fs_management::u8_BPB_SecPerClus, and Fs_management_fast::u8_type_fat.
uint8_t nav_partition_type | ( | void | ) |
This function gives the partition type.
References fat_check_device(), fs_g_nav_fast, FS_TYPE_FAT_UNM, nav_partition_mount(), and Fs_management_fast::u8_type_fat.
void nav_reset | ( | void | ) |
This function resets ALL navigations to init file system core.
//! Call this at the program startup or before a new session (e.g. USB Device exit) //!
References Fs_management::b_mode_nav_single, fat_cache_clusterlist_reset(), fat_cache_reset(), Fat_file_close, fs_g_nav, fs_g_nav_fast, fs_g_u8_nav_selected, FS_NB_NAVIGATOR, FS_TYPE_FAT_UNM, g_b_no_check_disk, g_b_string_length, g_b_unicode, nav_select(), Fs_management::u8_lun, and Fs_management_fast::u8_type_fat.
Referenced by main().
bool nav_select | ( | uint8_t | u8_idnav | ) |
This function selects the navigation to use.
u8_idnav | navigator identifier to select (0 to FS_NB_NAVIGATOR-1) |
References fat_invert_nav(), FS_ERR_BAD_NAV, fs_g_status, fs_g_u8_nav_selected, and FS_NB_NAVIGATOR.
Referenced by nav_exit(), nav_file_paste_start(), nav_file_paste_state(), and nav_reset().
This function selects a disk position via a path.
@param sz_path path string (ASCII or UNICODE ) @param b_match_case false to ignore the case @param b_create true, if path does not exist then create it <br> false, no create path <br> @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! The syntax "./../../file_name" is supported. //! With syntax "./dir_parent/directory_name" the file list corresponding at "dir_parent" and "directory_name" is selected. //! With syntax "./dir_parent/directory_name/" the file list corresponding at "directory_name" and no file is selected. //!
References _MEM_TYPE_SLOW_, fat_check_noopen(), fat_entry_is_dir(), Is_unicode, nav_dir_cd(), nav_dir_gotoparent(), nav_dir_make(), nav_dir_root(), nav_drive_set(), nav_file_create(), nav_filelist_findname(), nav_filelist_reset(), nav_getindex(), nav_gotoindex(), and nav_partition_mount().
void nav_string_length_disable | ( | void | ) |
This function deselects the LENGTH string mode for all routines with FS_STRING parameter.
//! In LENGTH string mode when you call a routine with FS_STRING parameter //! only the size (16bits, unit ASCII or UNICODE) is returned in the first 16bits of string array. //!
References g_b_string_length.
void nav_string_length_enable | ( | void | ) |
This function selects the LENGTH string mode for all routines with FS_STRING parameter.
//! In LENGTH string mode when you call a routine with FS_STRING parameter //! only the size (16bits, unit ASCII or UNICODE) is returned in the first 16bits of string array. //!
References g_b_string_length.
_MEM_TYPE_SLOW_ uint8_t fs_g_u8_nav_selected |
Holds the current navigator selected.
Referenced by nav_copy(), nav_get(), nav_reset(), and nav_select().
_MEM_TYPE_SLOW_ uint8_t g_id_trans_memtomem = ID_STREAM_ERR |
Holds the current ID transfer used by the internal copy-paste routines.
Referenced by nav_file_paste_start(), and nav_file_paste_state().
_MEM_TYPE_SLOW_ Fs_file_segment g_segment_dest |
Referenced by nav_file_paste_state().
_MEM_TYPE_SLOW_ Fs_file_segment g_segment_src |
Referenced by nav_file_paste_start(), and nav_file_paste_state().