This module covers basic implementation of the USB Mass Storage Class that has been defined in the following specification documents:
You can use this module to create many instances of the Mass Storage Class. Every instance of the class can handle up to 16 disks. Every disk has a unique LUN (Logical Unit Number) associated with it. Access to every LUN is provided by the block device API. The following figure shows basic flow of data between USB Mass Storage, the block device, and drivers:
The block device can be one of the two types:
USB Mass Storage Class provides a unified block device event handler. This event handler must be assigned to every block device. The following is an example of correct block device initialization for an empty block device:
To create an instance of the USB Mass Storage Class, use the APP_USBD_MSC_GLOBAL_DEF macro. The following example shows correct initialization of a Mass Storage Class instance that handles two block devices as separate logical units:
The following example shows how to register an instance of the Mass Storage Class:
The host uses Mass Storage Class Bulk Only Transport to communicate with the device. The figure shows how a single command is executed: