SH7286 Group
USB Function Module: USB Mass Storage Class
R01AN0063EJ0100 Rev. 1.00
Page 18 of 32
Oct. 22, 2010
5.4
Functionality of Functions
Table 9 to Table 16 list functions stored in each file and those functionalities.
•
main.c
Upon power-on reset, resetprg.c CPU initialization program is executed to call main function in main.c. It initializes
the SH7286, and clears the RAM area to use in Bulk transfer.
Table 9 main.c
File Name
Function Name
Description
main.c main
Initializes the module and memory, pulls up the USB bus, and
transitions to main loop
•
UsbMain.c
Usb.Main.c detects the interrupt sources mainly by the USB interrupt flag register, and calls functions according to
the interrupt type. It also transmits/receives packets between the host controller and function module.
Table 10 Usb.Main.c
File Name
Function Name
Description
BranchOfInt
Detects the interrupt sources of the bus reset and endpoint 0,
and calls the function according to the interrupt
GetPacket
Writes data to RAM transferred from the host controller
GetPacket4
Writes data transferred from the host controller to RAM in
longwords (Ring buffer supported, not used in the USB Mass
Storage Class)
GetPacket4S
Writes data transferred from the host controller to RAM in
longwords (Ring buffer not supported, high-speed)
PutPacket
Writes data to USB module transferred to the host controller
PutPacket4
Writes data to the USB module in longwords to transfer to the
host controller (Ring buffer supported, not used in the USB
Mass Storage Class)
PutPacket4S
Writes data to the USB module in longwords to transfer to the
host controller (Ring buffer not supported, high-speed)
SetControlOutContents
Overwrites the existing data with the data transferred from the
host
SetUsbModule
Configures the USB module
ActBusReset
Clears FIFOs when receiving the bus reset
ActBusVcc
Handles USB cable attachment interrupt (This function is not
used in this sample application)
ConvRealn
Reads the specified bytes of data from the specified address
UsbMain.c
ConvReflexn
Reads the specified bytes of data from the specified address in
reverse