Renesas USB Device
USB Host Mass Storage Class Driver(HMSC)
R01AN0513EJ0110 Rev.1.10
Page 35 of 55
Aug 10, 2011
7.4 HMSDD
Functions
Table 7.2 lists the functions of HMSDD.
Table 7.2 HMSDD Functions
Function Name
Description
1 R_usb_hmsc_StrgTaskOpen()
Starts
HMSDD.
2 R_usb_hmsc_StrgDriveSearch()
Reads
partition information and searches for drive.
3 usb_hmsc_SmpDevNextDriveSearch()
Searches for new drive number.
4
usb_hmsc_SmpDevReadSectorSize()
Reads sector size from device.
5 usb_hmsc_SmpDevReadPartition()
Reads PBR device from device.
6 usb_hmsc_SmpDevCheckBootRecord()
Determines if data is partition information or not.
7
usb_hmsc_SmpFsiDriveClear()
Clears drive information.
8 R_usb_hmsc_StrgDriveOpen()
Mounts
drive.
9 R_usb_hmsc_StrgDriveClose()
Unmounts
drive.
10 R_usb_hmsc_StrgReadSector()
Reads
data.
11 R_usb_hmsc_StrgWriteSector()
Writes
data.
12 R_usb_hmsc_StrgUserCommand()
Issues
storage
command.
13 usb_hmsc_SmpTotalDrive()
Checks
drive
count.
14 usb_hmsc_SmpDrive2Unit()
Changes drive number to unit number.
15 usb_hmsc_SmpDrive2Part()
Changes drive number to partition number.
16 usb_hmsc_SmpDrive2Addr()
Changes drive number to device address.
17 usb_hmsc_SmpCheckAddr()
Returns the device address of the drive
(or an error if the drive is unused).
18 usb_hmsc_SmpDrive2Msgnum()
Changes drive number to device number.
20 R_usb_hmsc_StrgTaskClose()
Closes
HMSDD.
21 usb_hmsc_StrgDriveTask()
HMSDD
Task
7.5
Logical Unit Number
If a device does not respond to a GetMaxUnit request and the unit count is undetermined, the device operates with a
unit count setting of 0. HMSCD creates USB packets according to the BOT specification. The CBWCB field (storage
command) of the data packet is created according to the SCSI specification. The LUN field settings in the bCBWLUN
field of the CBW packet and in the storage command are listed in table 7.3.
Table 7.3 LUN Field Settings
bCBWLUN Field
LUN Field in Command
usb_ghmsc_MaxLUN = 0
0
0
usb_ghmsc_MaxLUN = other than 0
Unit number
0
7.6 Changing
Logical Block Addresses
Under the BOT specification, information is read and written according to logical block addresses. The data size is
specified as the number of bytes of information that are read or written.
The logical block address is calculated from the sector number and offset sector number. The transfer size is calculated
from the sector count and sector size.
Logical block address = logical sector offset sector number
Transfer size = sector count * sector size
Summary of Contents for R8A66597
Page 56: ......