English
Language : 

AN282 Datasheet, PDF (13/22 Pages) Silicon Laboratories – USB MASS STORAGE DEVICE REFERENCE DESIGN PROGRAMMERS GUIDE
AN282
The MSD Class Command Interpreter calls the SCSI Command Interpreter whenever a valid and meaningful CBW
is received from the host. After processing the command, the SCSI Command Interpreter is responsible for setting
Scsi_Status and Status_Residue to appropriate values.
Scsi_Status can be set to one of three values: Passed (0), Failed (1), or Phase Error (2).
Scsi_Residue indicates how many bytes of data have not been processed.
4.6. Embedded File System Interface
This firmware component is unique compared to the other blocks because this is the only one that is solely used by
the Application Firmware when the device is in 'Embedded System Mode', and not at all when it is in 'Mass Storage
Device Mode'. This component provides the Application Firmware with an API to the FAT16 file system. This
interface is commonly referred to as a "Stream I/O interface" because of the use of functions like fopen, fread, and
fclose. Note that Long File Names (LFNs) are not supported by this API functions. Abbreviated LFNs (abcdef~1.txt
etc) can be used in place of LFNs. The API functions are described in the section below.
4.6.1. FileSys_Init
Description:
Initializes variables that are used for navigation over directories.
Supported Devices:
Module:
Prototype:
Parameters:
Return Value:
C8051F340/1/2/3/4/5/6/7
F34x_MSD_File_System.c
void FileSys_Init (void)
None.
None.
4.6.2. write_current_dir
Description:
Sends the current working directory path via the UART.
Supported Devices:
Module:
Prototype:
Parameters:
C8051F340/1/2/3/4/5/6/7
F34x_MSD_File_System.c
void write_current_dir (void)
None.
Return Value:
None.
4.6.3. chngdir
Description:
Changes the current working directory.
Supported Devices:
Module:
Prototype:
Parameters:
C8051F340/1/2/3/4/5/6/7
F34x_MSD_File_System.c
BYTE chngdir (char* dirname)
1. dirname-Pointer to a memory location that contains the directory name.
Return Value:
0, if the directory does not exist.
1, if the directory change was successful.
Rev. 0.1
13