ASF docs
3.1.3
Some important library documentation
|
#include <ctype.h>
#include "conf_explorer.h"
#include "navigation.h"
#include "file.h"
#include <LIB_CTRLACCESS>
Go to the source code of this file.
Macros | |
#define | SIZE_OF_SPLIT_COPY ((1*1024*1024L)/512L) |
Functions | |
void | nav_string_unicode (void) |
This function selects the UNICODE mode for all routines with FS_STRING parameter. | |
void | nav_string_ascii (void) |
This function selects the ASCII mode for all routines with FS_STRING parameter. | |
void | nav_string_length_enable (void) |
This function selects the LENGTH string mode for all routines with FS_STRING parameter. | |
void | nav_string_length_disable (void) |
This function deselects the LENGTH string mode for all routines with FS_STRING parameter. | |
void | nav_checkdisk_disable (void) |
This function disables the disk check before each actions on disk. | |
void | nav_checkdisk_enable (void) |
This function enables the disk check before each actions on disk. | |
void | nav_reset (void) |
This function resets ALL navigations to init file system core. | |
void | nav_exit (void) |
This function flush ALL navigations before exit of file system core. | |
bool | nav_select (uint8_t u8_idnav) |
This function selects the navigation to use. | |
uint8_t | nav_get (void) |
This function returns the navigation identifier used. | |
bool | nav_copy (uint8_t u8_idnav) |
This function copys the navigator information to another navigator. | |
uint8_t | nav_drive_nb (void) |
This function returns the number of devices availabled. | |
bool | nav_drive_set (uint8_t u8_number) |
This function selects a drive in navigator but don't mount the disk partition. | |
uint8_t | nav_drive_get (void) |
This function returns the selected drive number. | |
uint8_t | nav_drive_getname (void) |
This function returns the selected drive letter. | |
uint8_t | nav_partition_nb (void) |
This function returns the number of partitions present on drive. | |
bool | nav_partition_set (uint8_t partition_number) |
This function selects a partition on drive. | |
bool | nav_partition_mount (void) |
This function mounts the selected partition. | |
uint8_t | nav_partition_type (void) |
This function gives the partition type. | |
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. | |
bool | nav_partition_label (bool b_action, FS_STRING sz_label) |
This function reads or writes the label of selected partition. | |
uint32_t | nav_partition_space (void) |
This function returns partition total space. | |
uint8_t | nav_partition_cluster_size (void) |
This function returns the partition cluster size. | |
uint32_t | nav_partition_freespace (void) |
This function returns the partition free space. | |
uint8_t | nav_partition_freespace_percent (void) |
This function returns the partition space free in percent. | |
bool | nav_filelist_single_enable (bool b_type) |
To display in File List only the files OR directories. | |
bool | nav_filelist_single_disable (void) |
To display in File List the directories AND files. | |
bool | nav_filelist_reset (void) |
This function resets the selection pointer, so "no file selected" in file list. | |
bool | nav_filelist_validpos (void) |
This function checks if a file is selected. | |
bool | nav_filelist_fileisnotopen (void) |
This function checks if no file is open. | |
bool | nav_filelist_set (uint16_t u16_nb, bool b_direction) |
This function moves the selection pointer in file list. | |
uint16_t | nav_filelist_get (void) |
This function returns the position of selected file in file list. | |
bool | nav_filelist_goto (uint16_t u16_newpos) |
This function goes at a position in file list. | |
bool | nav_filelist_findname (const FS_STRING sz_name, bool b_match_case) |
This function searchs a file name in file list. | |
bool | nav_filelist_eol (void) |
This function checks the end of file list. | |
bool | nav_filelist_bol (void) |
This function checks the beginning of file list. | |
bool | nav_filelist_exist (bool b_type) |
This function checks the presence of files or directories in file list. | |
uint16_t | nav_filelist_nb (bool b_type) |
This function computes the number of files or directories in file list. | |
bool | nav_filelist_first (bool b_type) |
This function goes to at the first file or directory in file list. | |
bool | nav_filelist_last (bool b_type) |
This function goes to at the last file or directory in file list. | |
Fs_index | nav_getindex (void) |
This function returns a small index on the selected file. | |
bool | nav_gotoindex (const Fs_index _MEM_TYPE_SLOW_ *index) |
This function selects a file in the navigator via a file index. | |
bool | nav_dir_root (void) |
This function initializes the file list on the root directory. | |
bool | nav_dir_is_root (void) |
This function check the current directory. | |
bool | nav_dir_cd (void) |
This function enters in the selected directory in file list. | |
bool | nav_dir_gotoparent (void) |
This function goes to the parent directory. | |
bool | nav_dir_name (FS_STRING sz_path, uint8_t u8_size_max) |
This function returns the directory name corresponding at the file list. | |
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. | |
bool | nav_setcwd (FS_STRING sz_path, bool b_match_case, bool b_create) |
This function selects a disk position via a path. | |
bool | nav_file_getname (FS_STRING sz_name, uint8_t u8_size_max) |
This function returns the name of selected file. | |
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. | |
uint32_t | nav_file_lgt (void) |
This function returns the size of selected file (unit byte) | |
uint16_t | nav_file_lgtsector (void) |
This function returns the size of selected file (unit sector) | |
bool | nav_file_isreadonly (void) |
This function checks the write protection of disk and the attribut "read only" of selected file. | |
bool | nav_file_isdir (void) |
This function returns the type of selected file. | |
bool | nav_file_checkext (const FS_STRING sz_filterext) |
This function checks the extension of selected file. | |
bool | nav_file_dateget (FS_STRING sz_date, bool type_date) |
This function returns the date of selected file. | |
uint8_t | nav_file_attributget (void) |
This function returns the attribut of selected file. |
#define SIZE_OF_SPLIT_COPY ((1*1024*1024L)/512L) |
Definition at line 75 of file navigation.c.
void nav_checkdisk_disable | ( | void | ) |
//! By default, between each read/write access a check disk (test unit ready) is sended at device. //! This check can reduce the speed access on specific disk. //!
Definition at line 140 of file navigation.c.
void nav_checkdisk_enable | ( | void | ) |
//! By default, between each read/write access a check disk (test unit ready) is sended at device. //! This check can reduce the speed access on specific disk. //!
Definition at line 152 of file navigation.c.
bool nav_copy | ( | uint8_t | u8_idnav | ) |
u8_idnav | navigator identifier where the main navigator will be copied |
//! Use this routine to select quickly the same file in another navigator //!
Definition at line 284 of file navigation.c.
bool nav_dir_cd | ( | void | ) |
//! After this routine the file list changes and contains the files and directories of the new directory. //! By default no file is selected. //!
Definition at line 1192 of file navigation.c.
bool nav_dir_gotoparent | ( | void | ) |
//! 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. //!
Definition at line 1222 of file navigation.c.
bool nav_dir_is_root | ( | void | ) |
Definition at line 1173 of file navigation.c.
bool nav_dir_name | ( | FS_STRING | sz_path, |
uint8_t | u8_size_max | ||
) |
sz_path | string to store the name (ASCII or UNICODE ) |
u8_size_max | string size (unit ASCII or UNICODE ) |
Definition at line 1270 of file navigation.c.
bool nav_dir_root | ( | void | ) |
Definition at line 1162 of file navigation.c.
uint8_t nav_drive_get | ( | void | ) |
Definition at line 356 of file navigation.c.
uint8_t nav_drive_getname | ( | void | ) |
Definition at line 373 of file navigation.c.
uint8_t nav_drive_nb | ( | void | ) |
//! This value may be dynamic because it depends of memory drivers (e.g. Mass Storage disk on USB host mode) //!
Definition at line 314 of file navigation.c.
bool nav_drive_set | ( | uint8_t | u8_number | ) |
u8_number | device number (0 to nav_drive_nb()-1 ) |
Definition at line 327 of file navigation.c.
void nav_exit | ( | void | ) |
//! Call this at the program exit or before a USB Device session //!
Definition at line 214 of file navigation.c.
uint8_t nav_file_attributget | ( | void | ) |
Definition at line 1951 of file navigation.c.
bool nav_file_checkext | ( | const FS_STRING | sz_filterext | ) |
sz_filterext | extension filter (ASCII format, e.g.: "txt" or "txt,d*,wk" ) |
Definition at line 1908 of file navigation.c.
bool nav_file_dateget | ( | FS_STRING | sz_date, |
bool | type_date | ||
) |
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, seconde, miliseconde |
Definition at line 1934 of file navigation.c.
bool nav_file_getname | ( | FS_STRING | sz_name, |
uint8_t | u8_size_max | ||
) |
sz_name | string to store the name file (ASCII or UNICODE ) |
u8_size_max | string size (unit ASCII or UNICODE ) |
Definition at line 1751 of file navigation.c.
bool nav_file_isdir | ( | void | ) |
Definition at line 1895 of file navigation.c.
bool nav_file_isreadonly | ( | void | ) |
Definition at line 1880 of file navigation.c.
uint32_t nav_file_lgt | ( | void | ) |
Definition at line 1859 of file navigation.c.
uint16_t nav_file_lgtsector | ( | void | ) |
Definition at line 1869 of file navigation.c.
bool nav_file_name | ( | FS_STRING | sz_name, |
uint8_t | u8_size_max, | ||
bool | b_mode, | ||
bool | b_match_case | ||
) |
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 |
Definition at line 1772 of file navigation.c.
bool nav_filelist_bol | ( | void | ) |
Definition at line 950 of file navigation.c.
bool nav_filelist_eol | ( | void | ) |
Definition at line 926 of file navigation.c.
bool nav_filelist_exist | ( | bool | b_type | ) |
b_type | FS_DIR to check the directory presence FS_FILE to check the file presence |
Definition at line 968 of file navigation.c.
bool nav_filelist_fileisnotopen | ( | void | ) |
Definition at line 706 of file navigation.c.
bool nav_filelist_findname | ( | const FS_STRING | sz_name, |
bool | b_match_case | ||
) |
sz_name | name to search (UNICODE or ASCII) It must be terminate by NULL or '*' value |
b_match_case | false to ignore the case |
//! This function starts a search at the next position of the current in file list //!
Definition at line 909 of file navigation.c.
bool nav_filelist_first | ( | bool | b_type | ) |
b_type | FS_DIR to go at the first directory FS_FILE to go at the first file |
Definition at line 1037 of file navigation.c.
uint16_t nav_filelist_get | ( | void | ) |
Definition at line 849 of file navigation.c.
bool nav_filelist_goto | ( | uint16_t | u16_newpos | ) |
u16_newpos | new position to select (0 is the first position) |
Definition at line 862 of file navigation.c.
bool nav_filelist_last | ( | bool | b_type | ) |
b_type | FS_DIR to go at the last directory FS_FILE to go at the last file |
Definition at line 1061 of file navigation.c.
uint16_t nav_filelist_nb | ( | bool | b_type | ) |
b_type | FS_DIR to compute the number of directories FS_FILE to compute the number of files |
Definition at line 994 of file navigation.c.
bool nav_filelist_reset | ( | void | ) |
Definition at line 679 of file navigation.c.
bool nav_filelist_set | ( | uint16_t | u16_nb, |
bool | b_direction | ||
) |
u16_nb | numbers of file to jump before stopping action 0, stop at the first file found 1, stop at the second file found |
b_direction | search direction FS_FIND_NEXT, move to next file or directory FS_FIND_PREV, move to previous file or directory |
//! Note: if no file is selected then nav_filelist_set( 0 , FS_NEXT ) goes to the first entry of the file list. //!
Definition at line 729 of file navigation.c.
bool nav_filelist_single_disable | ( | void | ) |
Definition at line 667 of file navigation.c.
bool nav_filelist_single_enable | ( | bool | b_type | ) |
b_type | FS_DIR to display only directories presence FS_FILE to dispaly only files presence |
Definition at line 651 of file navigation.c.
bool nav_filelist_validpos | ( | void | ) |
Definition at line 695 of file navigation.c.
uint8_t nav_get | ( | void | ) |
Definition at line 263 of file navigation.c.
bool nav_getcwd | ( | FS_STRING | sz_path, |
uint8_t | u8_size_path, | ||
bool | b_view_file_select | ||
) |
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 |
Definition at line 1414 of file navigation.c.
Fs_index nav_getindex | ( | void | ) |
//! This routine is interresting to save a file position in small variable. //! This pointer allow to reinit a navigator quickly with nav_gotoindex() routine. //!
Definition at line 1096 of file navigation.c.
bool nav_gotoindex | ( | const Fs_index _MEM_TYPE_SLOW_ * | index | ) |
index | structure with information about file to select (disk, partition, dir, file/dir selected ) |
//! 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(). //!
Definition at line 1123 of file navigation.c.
uint8_t nav_partition_cluster_size | ( | void | ) |
Definition at line 598 of file navigation.c.
uint32_t nav_partition_freespace | ( | void | ) |
//! You shall mounted the partition before call this routine //!
Definition at line 612 of file navigation.c.
uint8_t nav_partition_freespace_percent | ( | void | ) |
//! To speed up the compute, the resultat have an error delta of 1% //!
Definition at line 630 of file navigation.c.
bool nav_partition_label | ( | bool | b_action, |
FS_STRING | sz_label | ||
) |
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 |
Definition at line 532 of file navigation.c.
bool nav_partition_mount | ( | void | ) |
//! 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 //!
Definition at line 464 of file navigation.c.
uint8_t nav_partition_nb | ( | void | ) |
Definition at line 424 of file navigation.c.
bool nav_partition_serialnumber | ( | bool | b_action, |
uint8_t _MEM_TYPE_SLOW_ * | a_u8_sn | ||
) |
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 |
Definition at line 511 of file navigation.c.
bool nav_partition_set | ( | uint8_t | partition_number | ) |
partition_number | partition number (0 to 3) |
Definition at line 437 of file navigation.c.
uint32_t nav_partition_space | ( | void | ) |
//! You shall mounted the partition before call this routine //!
Definition at line 585 of file navigation.c.
uint8_t nav_partition_type | ( | void | ) |
Definition at line 488 of file navigation.c.
void nav_reset | ( | void | ) |
//! Call this at the program startup or before a new session (e.g. USB Device exit) //!
Definition at line 168 of file navigation.c.
bool nav_select | ( | uint8_t | u8_idnav | ) |
u8_idnav | navigator identifier to select (0 to FS_NB_NAVIGATOR-1) |
Definition at line 240 of file navigation.c.
bool nav_setcwd | ( | FS_STRING | sz_path, |
bool | b_match_case, | ||
bool | b_create | ||
) |
sz_path | path string (ASCII or UNICODE ) |
b_match_case | false to ignore the case |
b_create | true, if path does not exist then create it false, no create path |
//! The syntact "./../../file_name" is supported. //! With syntact "./dir_parent/directory_name" the file list corresponding at "dir_parent" and "directory_name" is selected. //! With syntact "./dir_parent/directory_name/" the file list corresponding at "directory_name" and no file is selected. //!
Definition at line 1581 of file navigation.c.
void nav_string_ascii | ( | void | ) |
//! If you have enabled the FS_ASCII AND FS_UNICODE define //! then FS_STRING parameter can be a ASCII or UNICODE string. //!
Definition at line 101 of file navigation.c.
void nav_string_length_disable | ( | void | ) |
//! 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. //!
Definition at line 125 of file navigation.c.
void nav_string_length_enable | ( | void | ) |
//! 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. //!
Definition at line 114 of file navigation.c.
void nav_string_unicode | ( | void | ) |
//! If you have enabled the FS_ASCII AND FS_UNICODE define //! then FS_STRING parameter can be a ASCII or UNICODE string. //!
Definition at line 90 of file navigation.c.