Atmel Software Framework

navigation.c File Reference
#include <ctype.h>
#include "conf_explorer.h"
#include "navigation.h"
#include "file.h"
#include <LIB_CTRLACCESS>

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_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...
 
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_checkext (const FS_STRING sz_filterext)
 This function checks the extension of selected file. More...
 
bool nav_file_dateget (FS_STRING sz_date, bool type_date)
 This function returns the date of selected file. 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_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...
 
uint8_t nav_partition_nb (void)
 This function returns the number of partitions present on drive. 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...
 
bool nav_partition_set (uint8_t partition_number)
 This function selects a partition on drive. 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_ascii (void)
 This function selects the ASCII mode for all routines with FS_STRING parameter. 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...
 
void nav_string_unicode (void)
 This function selects the UNICODE mode for all routines with FS_STRING parameter. More...
 

#define SIZE_OF_SPLIT_COPY   ((1*1024*1024L)/512L)

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.

Referenced by input(), reader_txt_get_line(), and wav_file_get_data().

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.

Referenced by input(), reader_txt_get_line(), and wav_file_get_data().

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.

Referenced by ai_usb_ms_specific_audio_nav_playlist_play_link(), ai_usb_ms_support_info_image(), pl_main_open(), and pl_main_readline().

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 ai_usb_ms_nav_dir_cd(), host_mass_storage_task_copy_tree(), nav_filterflat_cd(), nav_filterflat_next(), nav_filterflat_previous(), nav_filterlist_cd(), nav_flat_cd(), nav_flat_next(), nav_flat_previous(), nav_setcwd(), navauto_mov_explorer_enterdir(), navauto_mov_explorer_is_dir(), navauto_mov_explorer_select_limit_dir_cur_folder(), and ushell_cmd_sync().

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 host_mass_storage_task_copy_tree(), nav_dir_name(), nav_filterflat_gotoparent(), nav_filterflat_reset(), nav_flat_gotoparent(), nav_flat_next(), nav_flat_previous(), nav_flat_reset(), nav_getcwd(), nav_setcwd(), navauto_mov_explorer_updir(), navauto_open(), ushell_cmd_gotoparent(), and ushell_cmd_sync().

bool nav_dir_is_root ( void  )

This function check the current directory.

Returns
false the current directory selected is not the root directory
true the current directory selected is the root directory

References fat_check_mount_noopen(), fs_g_nav, and Fs_management::u32_cluster_sel_dir.

bool nav_dir_name ( FS_STRING  sz_path,
uint8_t  u8_size_max 
)

This function returns the directory name corresponding at the file list.

Parameters
sz_pathstring to store the name (ASCII or UNICODE )
u8_size_maxstring size (unit ASCII or UNICODE )
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

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(), status, 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.

Referenced by ai_usb_ms_nav_dir_name(), ai_usb_ms_specific_audio_nav_get_folder_name(), main(), prv_ls(), and ushell_cmd_ls().

bool nav_dir_root ( void  )

This function initializes the file list on the root directory.

Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

References nav_partition_mount().

Referenced by ai_usb_ms_nav_dir_root(), ai_usb_ms_nav_getplayfile(), nav_filterlist_root(), nav_flat_root(), nav_partition_label(), nav_setcwd(), and navauto_mov_explorer_reset().

uint8_t nav_drive_get ( void  )

This function returns the selected drive number.

Returns
0 to nav_drive_nb()-1
0xFF in case of no drive selected

References fs_g_nav, Fs_management::u8_lun, and Fs_management::u8_partition.

Referenced by ai_usb_ms_nav_drive_get(), e_fscmds_format(), main(), navauto_mov_ok_loop(), prv_ls(), ushell_cmd_ls(), ushell_cmd_perform(), and ushell_cmd_space().

uint8_t nav_drive_getname ( void  )

This function returns the selected drive letter.

Returns
'A','B',...
'X', in case of no drive selected

References fs_g_nav, Fs_management::u8_lun, and Fs_management::u8_partition.

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().

Referenced by ai_usb_ms_nav_drive_nb(), e_fscmds_format(), e_fscmds_mount(), e_fscmds_shell_disk(), main(), navauto_mov_ok_loop(), prv_df(), ushell_cmd_free_space(), ushell_cmd_mount(), and ushell_cmd_nb_drive().

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().

Referenced by ushell_task().

uint8_t nav_file_attributget ( void  )

This function returns the Attribute of selected file.

Returns
Attribute of selected file, see masks "FS_ATTR_" in fs_com.h file.

References fs_g_nav_entry, and Fs_management_entry::u8_attr.

bool nav_file_dateget ( FS_STRING  sz_date,
bool  type_date 
)

This function returns the date of selected file.

Parameters
type_dateFS_DATE_LAST_WRITE, to get the date of last write access
FS_DATE_CREATION, to get the date of file creation
sz_dateASCCI string (>17B) to store the information about date
"YYYYMMDDHHMMSSMS" = year, month, day, hour, minute, second, millisecond
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

References fat_check_mount_select(), fat_get_date(), and fat_read_dir().

bool nav_file_getname ( FS_STRING  sz_name,
uint8_t  u8_size_max 
)

This function returns the name of selected file.

Parameters
sz_namestring to store the name file (ASCII or UNICODE )
u8_size_maxstring size (unit ASCII or UNICODE )
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

References FS_NAME_GET, and nav_file_name().

Referenced by ai_usb_ms_audio_nav_getname(), and ai_usb_ms_nav_file_name().

bool nav_file_isreadonly ( void  )

This function checks the write protection of disk and the Attribute "read only" of selected file.

Returns
false, it is possible to modify the selected file
true, in other case

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.

Referenced by pl_main_open().

uint32_t nav_file_lgt ( void  )

This function returns the size of selected file (unit byte)

Returns
Size of selected file (unit byte)

References fs_g_nav_entry, and Fs_management_entry::u32_size.

Referenced by fsaccess_file_get_size(), main(), play_mp3(), prv_ls(), and ushell_cmd_ls().

uint16_t nav_file_lgtsector ( void  )

This function returns the size of selected file (unit sector)

Returns
Size of selected file (unit 512B)

References FS_512B_SHIFT_BIT, fs_g_nav_entry, and Fs_management_entry::u32_size.

Referenced by main(), and prv_cp().

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.

Parameters
b_modeaction mode:
FS_NAME_GET to get the name of selected file
FS_NAME_CHECK to check the name of selected file
sz_nameif 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_casefalse, ignore the case (only used in "FS_NAME_CHECK" action)
u8_size_maxstring size (unit ASCII or UNICODE ), only used in "FS_NAME_GET" action
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

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 host_mass_storage_task_copy_tree(), main(), nav_dir_name(), nav_file_getname(), nav_filelist_findname(), nav_filterflat_findname(), nav_filterlist_findname(), nav_flat_findname(), nav_getcwd(), pl_main_close(), prv_cp(), prv_ls(), prv_NameExists(), ushell_cmd_copy(), ushell_cmd_ls(), and ushell_cmd_sync().

bool nav_filelist_bol ( void  )

This function checks the beginning of file list.

Returns
false, it is not the beginning of file list
true, in case of the file selected is the first file, or in case of error

References FS_FIND_NEXT, FS_FIND_PREV, and nav_filelist_set().

bool nav_filelist_eol ( void  )

This function checks the end of file list.

Returns
false, NO end of file list
true, in case of end of list or error

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.

bool nav_filelist_exist ( bool  b_type)

This function checks the presence of files or directories in file list.

Parameters
b_typeFS_DIR to check the directory presence
FS_FILE to check the file presence
Returns
true, in case of a file or a directory exists
false, in case of no file or no directory exists, or error

References FS_FIND_NEXT, fs_g_nav, FS_NO_SEL, nav_filelist_first(), nav_filelist_reset(), nav_filelist_set(), status, and Fs_management::u16_pos_sel_file.

bool nav_filelist_fileisnotopen ( void  )

This function checks if no file is open.

Returns
true if no file is open
false if a file is open

References fat_check_noopen().

Referenced by nav_flat_fileisnotopen().

bool nav_filelist_findname ( const FS_STRING  sz_name,
bool  b_match_case 
)

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 host_mass_storage_task_copy_tree(), and nav_setcwd().

bool nav_filelist_first ( bool  b_type)

This function goes to at the first file or directory in file list.

Parameters
b_typeFS_DIR to go at the first directory
FS_FILE to go at the first file
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

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 e_fscmds_rm_all(), main(), nav_filelist_exist(), nav_filelist_last(), navauto_mov_explorer_select_limit_dir_cur_folder(), navauto_mov_explorer_select_limit_file_cur_folder(), prv_ls(), and prv_NameExists().

uint16_t nav_filelist_get ( void  )

This function returns the position of selected file in file list.

Returns
position of selected file (0 is the first position)
FS_NO_SEL, in case of no file selected

References fs_g_nav, and Fs_management::u16_pos_sel_file.

Referenced by ai_usb_ms_audio_ctrl_resume(), nav_filelist_goto(), nav_filterlist_next(), nav_filterlist_previous(), nav_flat_get(), nav_flat_next(), and nav_flat_previous().

bool nav_filelist_goto ( uint16_t  u16_newpos)

This function goes at a position in file list.

Parameters
u16_newposnew position to select (0 is the first position)
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

References FS_FIND_NEXT, FS_FIND_PREV, FS_NO_SEL, nav_filelist_get(), nav_filelist_reset(), and nav_filelist_set().

Referenced by nav_filterlist_next(), and nav_filterlist_previous().

bool nav_filelist_last ( bool  b_type)

This function goes to at the last file or directory in file list.

Parameters
b_typeFS_DIR to go at the last directory
FS_FILE to go at the last file
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

References FS_ERR_NO_FIND, FS_FIND_NEXT, fs_g_status, nav_filelist_first(), nav_filelist_nb(), and nav_filelist_set().

Referenced by navauto_mov_explorer_select_limit_dir_cur_folder(), and navauto_mov_explorer_select_limit_file_cur_folder().

uint16_t nav_filelist_nb ( bool  b_type)

This function computes the number of files or directories in file list.

Parameters
b_typeFS_DIR to compute the number of directories
FS_FILE to compute the number of files
Returns
number of files or directories in file list

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 main(), nav_filelist_last(), navauto_mov_explorer(), prv_ls(), and prv_NameExists().

bool nav_filelist_set ( uint16_t  u16_nb,
bool  b_direction 
)

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 e_fscmds_rm_all(), host_mass_storage_task_copy_tree(), main(), 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(), nav_filterlist_nb_ex(), nav_filterlist_next(), nav_filterlist_previous(), nav_flat_next(), nav_flat_previous(), nav_gotoindex(), navauto_mov_explorer_is_dir(), navauto_mov_explorer_is_file(), navauto_mov_explorer_select_limit_file_cur_folder(), navauto_open(), prv_ls(), prv_NameExists(), ushell_cmd_ls(), and ushell_cmd_sync().

bool nav_filelist_single_disable ( void  )

To display in File List the directories AND files.

Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

References Fs_management::b_mode_nav_single, fs_g_nav, and nav_filelist_reset().

Referenced by nav_filterlist_nb_ex().

bool nav_filelist_single_enable ( bool  b_type)

To display in File List only the files OR directories.

Parameters
b_typeFS_DIR to display only directories presence
FS_FILE to display only files presence
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

References Fs_management::b_mode_nav, Fs_management::b_mode_nav_single, fs_g_nav, and nav_filelist_reset().

Referenced by nav_filterlist_nb_ex().

bool nav_filelist_validpos ( void  )

This function checks if a file is selected.

Returns
true if a file is selected
false if no file is selected

References fat_check_mount_select_noopen().

Referenced by nav_flat_validpos(), navauto_mov_explorer_rec(), navauto_mov_playlist(), navauto_open(), and pl_sel_isvalid().

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.

Parameters
sz_pathstring to store the path (ASCII or UNICODE )
u8_size_pathstring size (unit ASCII or UNICODE )
b_view_file_selecttrue, to include in path the selected file name
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

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, index, Is_unicode, nav_dir_gotoparent(), nav_drive_getname(), nav_file_name(), nav_getindex(), nav_gotoindex(), and status.

Referenced by e_fscmds_shell_pwd().

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 ai_usb_ms_audio_context_restore(), ai_usb_ms_audio_ctrl_resume(), ai_usb_ms_audio_nav_file_info_duration(), ai_usb_ms_audio_nav_file_info_track(), ai_usb_ms_audio_nav_file_info_version(), ai_usb_ms_audio_nav_file_info_year(), ai_usb_ms_audio_nav_playfile(), ai_usb_ms_song_read_info(), e_fscmds_rm(), e_fscmds_shell_goto(), e_fscmds_shell_mv(), e_fscmds_touch(), main(), nav_filterflat_gotoparent(), nav_flat_gotoparent(), nav_getcwd(), nav_partition_label(), nav_setcwd(), navauto_open(), pl_main_close(), pl_main_save(), pl_rem_dead(), prv_append(), prv_cat(), prv_cp(), prv_df(), ushell_cmd_copy(), ushell_cmd_free_space(), ushell_cmd_mount(), ushell_cmd_perform(), ushell_cmd_rm(), ushell_cmd_sync(), and ushell_task().

uint8_t nav_partition_cluster_size ( void  )

This function returns the partition cluster size.

Returns
cluster size (unit sector)

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.

Referenced by ai_usb_ms_nav_drive_free_space(), main(), prv_df(), and ushell_cmd_free_space().

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.

Referenced by ushell_cmd_free_space().

bool nav_partition_label ( bool  b_action,
FS_STRING  sz_label 
)

This function reads or writes the label of selected partition.

Parameters
b_actionto select the action
FS_LABEL_READ to read label
FS_LABEL_WRITE to write label
sz_labelpointer 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
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

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, index, nav_dir_root(), nav_getindex(), nav_gotoindex(), NULL, status, 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 ai_usb_ms_nav_drive_mount(), b_mmi_mkdir_aLOG(), b_mmi_mkdir_bLOG(), e_fscmds_format(), e_fscmds_mount(), host_mass_storage_task_copy_tree(), main(), nav_dir_root(), nav_filterlist_gotoindex(), nav_filterlist_mount(), nav_flat_mount(), nav_gotoindex(), nav_partition_type(), nav_setcwd(), navauto_mov_ok_loop(), prv_df(), ushell_cmd_free_space(), ushell_cmd_mount(), ushell_cmd_perform_alloc(), and v_com1shell_mount_local_drive().

uint8_t nav_partition_nb ( void  )

This function returns the number of partitions present on drive.

Returns
u8_number number of partitions
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.

Parameters
b_actionto select the action
FS_SN_READ to read serial number
FS_SN_WRITE to write serial number
a_u8_snpointer 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
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

References fat_check_mount(), and fat_serialnumber().

bool nav_partition_set ( uint8_t  partition_number)

This function selects a partition on drive.

Parameters
partition_numberpartition number (0 to 3)
Returns
false in case of error, see global value "fs_g_status" for more detail
true otherwise

References fat_check_noopen(), fs_g_nav, fs_g_nav_fast, FS_TYPE_FAT_UNM, Fs_management::u8_partition, and Fs_management_fast::u8_type_fat.

Referenced by nav_filterlist_gotoindex(), and nav_gotoindex().

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.

Referenced by ai_usb_ms_nav_drive_total_space(), main(), prv_cp(), prv_df(), ushell_cmd_free_space(), and ushell_cmd_space().

uint8_t nav_partition_type ( void  )

This function gives the partition type.

Returns
partition type: FS_TYPE_FAT_12, FS_TYPE_FAT_16, FS_TYPE_FAT_32
FS_TYPE_FAT_UNM, in case of error or unknown format

References fat_check_device(), fs_g_nav_fast, FS_TYPE_FAT_UNM, nav_partition_mount(), and Fs_management_fast::u8_type_fat.

Referenced by main(), and ushell_cmd_ls().

bool nav_select ( uint8_t  u8_idnav)

This function selects the navigation to use.

Parameters
u8_idnavnavigator identifier to select (0 to FS_NB_NAVIGATOR-1)
Returns
false if ID navigator don't exist
true otherwise

References fat_invert_nav, FS_ERR_BAD_NAV, fs_g_status, and FS_NB_NAVIGATOR.

Referenced by ai_usb_ms_audio_context_restore(), ai_usb_ms_audio_context_save(), ai_usb_ms_audio_ctrl_resume(), ai_usb_ms_audio_ctrl_status(), ai_usb_ms_audio_nav_eof_occur(), ai_usb_ms_audio_nav_expmode_get(), ai_usb_ms_audio_nav_expmode_set(), ai_usb_ms_audio_nav_file_info_duration(), ai_usb_ms_audio_nav_file_info_image(), ai_usb_ms_audio_nav_file_info_track(), ai_usb_ms_audio_nav_file_info_type(), ai_usb_ms_audio_nav_file_info_version(), ai_usb_ms_audio_nav_file_info_year(), ai_usb_ms_audio_nav_getname(), ai_usb_ms_audio_nav_getpos(), ai_usb_ms_audio_nav_mov(), ai_usb_ms_audio_nav_nb(), ai_usb_ms_audio_nav_playfile(), ai_usb_ms_audio_nav_setpos(), ai_usb_ms_audio_nav_shuffle_get(), ai_usb_ms_audio_nav_shuffle_set(), ai_usb_ms_init_drive(), ai_usb_ms_nav_dir_cd(), ai_usb_ms_nav_dir_gotoparent(), ai_usb_ms_nav_dir_name(), ai_usb_ms_nav_dir_nb(), ai_usb_ms_nav_dir_root(), ai_usb_ms_nav_drive_free_space(), ai_usb_ms_nav_drive_get(), ai_usb_ms_nav_drive_mount(), ai_usb_ms_nav_drive_nb(), ai_usb_ms_nav_drive_total_space(), ai_usb_ms_nav_file_goto(), ai_usb_ms_nav_file_info_album(), ai_usb_ms_nav_file_info_artist(), ai_usb_ms_nav_file_info_duration(), ai_usb_ms_nav_file_info_genre(), ai_usb_ms_nav_file_info_image(), ai_usb_ms_nav_file_info_title(), ai_usb_ms_nav_file_info_track(), ai_usb_ms_nav_file_info_type(), ai_usb_ms_nav_file_info_version(), ai_usb_ms_nav_file_info_year(), ai_usb_ms_nav_file_isdir(), ai_usb_ms_nav_file_name(), ai_usb_ms_nav_file_nb(), ai_usb_ms_nav_file_next(), ai_usb_ms_nav_file_pos(), ai_usb_ms_nav_file_previous(), ai_usb_ms_nav_getplayfile(), ai_usb_ms_nav_playlist_nb(), ai_usb_ms_song_read_info(), ai_usb_ms_specific_audio_nav_get_folder_name(), ai_usb_ms_specific_audio_nav_playlist_play_link(), ai_usb_ms_specific_nav_get_next_playlist_pos(), ai_usb_ms_specific_nav_getplaylistfile(), ai_usb_ms_specific_restore_navigator_ex(), ai_usb_ms_specific_save_navigator_ex(), ai_usb_ms_support_info_image(), b_mmi_mkdir_aLOG(), b_mmi_mkdir_bLOG(), close(), e_fscmds_cd(), e_fscmds_format(), e_fscmds_mount(), e_fscmds_rm(), e_fscmds_rm_all(), e_fscmds_shell_fat(), e_fscmds_shell_goto(), e_fscmds_shell_mark(), e_fscmds_shell_mkdir(), e_fscmds_shell_mv(), e_fscmds_shell_pwd(), e_fscmds_touch(), fsaccess_file_get_size(), fsaccess_IsDirPresent(), host_mass_storage_task_copy_tree(), nav_exit(), nav_reset(), open(), output(), pl_main_close(), pl_main_open(), pl_main_readline(), pl_main_save(), pl_nav_readentry(), pl_nav_setpos(), pl_rem_dead(), pl_rem_sel(), pl_rem_sel_all(), play_mp3(), play_wav(), portTASK_FUNCTION(), prv_append(), prv_cat(), prv_cp(), prv_df(), prv_ls(), read(), ushell_cmd_perform(), ushell_cmd_sync(), ushell_task(), v_com1shell_mount_local_drive(), wav_file_get_data(), and write().

bool nav_setcwd ( FS_STRING  sz_path,
bool  b_match_case,
bool  b_create 
)

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(), index, 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().

Referenced by e_fscmds_cd(), e_fscmds_rm(), e_fscmds_shell_mv(), e_fscmds_touch(), fsaccess_IsDirPresent(), main(), open(), pl_main_readline(), prv_append(), prv_cat(), prv_cp(), ushell_cmd_append_file(), ushell_cmd_cat(), ushell_cmd_cd(), ushell_cmd_copy(), ushell_cmd_rename(), ushell_cmd_rm(), and ushell_cmd_sync().

void nav_string_ascii ( void  )

This function selects the ASCII mode for all routines with FS_STRING parameter.

//! If you have enabled the FS_ASCII AND FS_UNICODE define
//! then FS_STRING parameter can be a ASCII or UNICODE string.
//! 

References g_b_unicode.

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.

Referenced by ai_usb_ms_read_string(), pl_main_close(), reader_id3_duration(), reader_id3_track(), and reader_id3_year().

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.

Referenced by ai_usb_ms_read_string(), and pl_main_close().

void nav_string_unicode ( void  )

This function selects the UNICODE mode for all routines with FS_STRING parameter.

//! If you have enabled the FS_ASCII AND FS_UNICODE define
//! then FS_STRING parameter can be a ASCII or UNICODE string.
//!