English
Language : 

SH7216 Datasheet, PDF (16/32 Pages) Renesas Technology Corp – USB Mass Storage Class
SH7216 Group
USB Function Module: USB Mass Storage Class
5.3 File Structure
This sample program consists of nine source files and eleven header files. The overall file structure is shown in table 8.
Each function is arranged in one file by transfer method or function type.
Table 8 File Structure
File Name
Startup.c
UsbMain.c
DoRequest.c
DoRequestBOT_StorageClass.c
DoControl.c
DoBulk.c
DoBOTMSClass.c
DoSCSICommand.c
sct.src
CatBOTTypedef.h
CatProType.h
CatSCSITypedef.h
CatTypedef.h
SetBOTInfo.h
SetMacro.h
SetSCSIInfo.h
SetSystemSwitch.h
SetUsbInfo.h
SysMemMap.h
iodefine.h
Principle Role
USB function default settings
Judging the causes of interrupts
Sending and receiving packets
Processing setup commands issued by the host
Processing USB Mass Storage Class (Bulk-Only Transport) class
commands
Executing control transfer
Executing bulk transport
Executing USB Mass Storage Class (Bulk-Only Transport) transport
Analyzing and processing SCSI commands
Transferring initial values of variables from the ROM to the RAM
Defining structures used for Bulk-Only Transport
Prototype declarations
Defining structures used for SCSI, and defining macro to configure FAT
information
Defining the basic structures used in USB firmware
Default settings of variables needed to support Bulk-Only Transport
Defining macros
Default settings of variables needed to support SCSI commands
System operation settings
Default settings of variables used in USB firmware
Defining memory map addresses
Defining SH7216 registers
5.4 Purposes of Functions
Table 9 to 16 shows functions contained in each file and their purposes.
• Startup.c
When a power-on reset or manual reset is carried out, the SetPowerOnSection of the Startup.c file is called. At this
point, the SH7216 default settings are entered and the RAM area used for bulk transport is cleared.
Table 9 Startup.c
File in which
Stored
Startup.c
Function Name
SetPowerOnSection
InitSDRAM
_INITSCT
InitMemory
InitSystem
Set_EPInfoR
Purpose
Initializes module and memory, and shifts to the main loop
Makes initial settings for the SDRAM mounted on the SH7216 CPU
board
Copies variables that have default settings to the RAM work area
Clears the RAM area used in bulk communication
Pull-up control of the USB bus
Writes endpoint information
REJ06B0897-0100/Rev.1.00
July 2009
Page 16 of 32