Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
usb_msc.h File Reference

USB Mass Storage Class public header. More...

Go to the source code of this file.

Data Structures

struct  CBW
 
struct  CSW
 

Macros

#define SCSI_TRANSPARENT_SUBCLASS   0x06
 
#define BULK_ONLY_TRANSPORT_PROTOCOL   0x50
 
#define MSC_REQUEST_GET_MAX_LUN   0xFE
 
#define MSC_REQUEST_RESET   0xFF
 
#define CBW_Signature   0x43425355
 
#define CBW_DIRECTION_DATA_IN   0x80
 
#define CSW_Signature   0x53425355
 
#define CSW_STATUS_CMD_PASSED   0x00
 
#define CSW_STATUS_CMD_FAILED   0x01
 
#define CSW_STATUS_PHASE_ERROR   0x02
 
#define TEST_UNIT_READY   0x00
 
#define REQUEST_SENSE   0x03
 
#define FORMAT_UNIT   0x04
 
#define INQUIRY   0x12
 
#define MODE_SELECT6   0x15
 
#define MODE_SENSE6   0x1A
 
#define START_STOP_UNIT   0x1B
 
#define MEDIA_REMOVAL   0x1E
 
#define READ_FORMAT_CAPACITIES   0x23
 
#define READ_CAPACITY   0x25
 
#define READ10   0x28
 
#define WRITE10   0x2A
 
#define VERIFY10   0x2F
 
#define READ12   0xA8
 
#define WRITE12   0xAA
 
#define MODE_SELECT10   0x55
 
#define MODE_SENSE10   0x5A
 

Detailed Description

USB Mass Storage Class public header.

Header follows the Mass Storage Class Specification (Mass_Storage_Specification_Overview_v1.4_2-19-2010.pdf) and Mass Storage Class Bulk-Only Transport Specification (usbmassbulk_10.pdf). Header is limited to Bulk-Only Transfer protocol.

Macro Definition Documentation

◆ BULK_ONLY_TRANSPORT_PROTOCOL

#define BULK_ONLY_TRANSPORT_PROTOCOL   0x50

◆ CBW_DIRECTION_DATA_IN

#define CBW_DIRECTION_DATA_IN   0x80

MSC Command Block Wrapper Flags

◆ CBW_Signature

#define CBW_Signature   0x43425355

MSC Command Block Wrapper (CBW) Signature

◆ CSW_Signature

#define CSW_Signature   0x53425355

MSC Command Status Wrapper (CBW) Signature

◆ CSW_STATUS_CMD_FAILED

#define CSW_STATUS_CMD_FAILED   0x01

◆ CSW_STATUS_CMD_PASSED

#define CSW_STATUS_CMD_PASSED   0x00

MSC Command Block Status Values

◆ CSW_STATUS_PHASE_ERROR

#define CSW_STATUS_PHASE_ERROR   0x02

◆ FORMAT_UNIT

#define FORMAT_UNIT   0x04

◆ INQUIRY

#define INQUIRY   0x12

◆ MEDIA_REMOVAL

#define MEDIA_REMOVAL   0x1E

◆ MODE_SELECT10

#define MODE_SELECT10   0x55

◆ MODE_SELECT6

#define MODE_SELECT6   0x15

◆ MODE_SENSE10

#define MODE_SENSE10   0x5A

◆ MODE_SENSE6

#define MODE_SENSE6   0x1A

◆ MSC_REQUEST_GET_MAX_LUN

#define MSC_REQUEST_GET_MAX_LUN   0xFE

MSC Request Codes for Bulk-Only Transport

◆ MSC_REQUEST_RESET

#define MSC_REQUEST_RESET   0xFF

◆ READ10

#define READ10   0x28

◆ READ12

#define READ12   0xA8

◆ READ_CAPACITY

#define READ_CAPACITY   0x25

◆ READ_FORMAT_CAPACITIES

#define READ_FORMAT_CAPACITIES   0x23

◆ REQUEST_SENSE

#define REQUEST_SENSE   0x03

◆ SCSI_TRANSPARENT_SUBCLASS

#define SCSI_TRANSPARENT_SUBCLASS   0x06

MSC Subclass and Protocol Codes

◆ START_STOP_UNIT

#define START_STOP_UNIT   0x1B

◆ TEST_UNIT_READY

#define TEST_UNIT_READY   0x00

SCSI transparent command set used by MSC

◆ VERIFY10

#define VERIFY10   0x2F

◆ WRITE10

#define WRITE10   0x2A

◆ WRITE12

#define WRITE12   0xAA