Renesas USB Device
USB Host Mass Storage Class Driver(HMSC)
R01AN0513EJ0110 Rev.1.10
Page 19 of 55
Aug 10, 2011
Table 3.14 usb_hmsc_SetElsCbw()
Name
Initialize CBW Parameters for Other Commands
Call format
void usb_hmsc_SetElsCbw(uint8_t *data, uint32_t trans_byte, uint16_t side)
uint8_t
*data
Command data address
uint32_t
trans_byte
Transfer data size
Arguments
uint16_t side
Drive
number
Return values
void
Description
Generates the CBW for commands other than READ10 and WRITE10.
Set the command field before calling the function and the fields other than the following
either before or after calling the function.
dCBWTag, dCBWDTL, bmCBWFlags.CBWdir, bmCBWFlags.reserved7,
bCBWLUN.bCBWLUN, bCBWLUN.reserved4, bCBWCBLength.reserved3
Notes
Updates usb_ghmsc_Cbw in the global area.
The command data is generated with a fixed length of 12 bytes.
Table 3.15 usb_hmsc_CbwTagCount()
Name
Update Tag Information
Call format
void usb_hmsc_CbwTagCount(uint16_t msgnum)
Arguments uint16_t
msgnum Driver
number
Return values
void
Description
Updates usb_ghmsc_CbwTagNo in the global area.
Notes
When usb_ghmsc_CbwTagNo = 0, the value is incremented by 1.
Table 3.16 usb_hmsc_CheckCsw()
Name Check
CSW
Call format
uint16_t usb_hmsc_CheckCsw(uint16_t drvnum)
Arguments uint16_t
drvnum Drive
number
Return values
uint16_t
USBC_HMSC_OK
CSW-OK
received
USBC_HMSC_CSW_ERR
CSW-NG (fail) received
USBC_HMSC_CSW_PHASE_ERR Phase
error
Description
Checks the following contents in the in the received CSW.
a) dCSWSignature in received CSW
Notes
In case of a phase error, MassStorageReset is executed.
Table 3.17 R_usb hmsc_SetDevSts()
Name
Set HMSCD Operation State
Call format
uint16_t R_usb_hmsc_SetDevSts(uint16_t data)
Arguments uint16_t
data
Operation
State
Return values
uint16_t
USBC_DONE
Normal end
Description Updates
the
HMSCD
operation state to the value specified by the argument.
Notes
Updates usb_ghmsc_AttSts in the global area.
Table 3.18 R_usb_hmsc_GetDevSts()
Name
Check HMSCD Operation State
Call format
uint16_t R_usb_hmsc_GetDevSts(void)
Arguments void
Return values
uint16_t
USBC_HMSC_DEV_DET Detach
USBC_HMSC_DEV_ATT Attach
Description Returns
the
HMSCD operation state.
Notes
Summary of Contents for R8A66597
Page 56: ......