usb_function_msd.h

Microchip USB Device Library

USB Device Library Help
usb_function_msd.h

USB MSD Function Driver File 

This file contains functions, macros, definitions, variables, datatypes, etc. that are required for use of the MSD function driver. This file should be included in projects that use the MSD function driver. 

This file is located in the "<Install Directory>\Microchip\USB\MSD Device Driver" directory. 

When including this file in a new project, this file can either be referenced from the directory in which it was installed or copied directly into the user application folder. If the first method is chosen to keep the file located in the folder in which it is installed then include paths need to be added so that the library and the application both know where to reference each others files. If the application folder is located in the same folder as the Microchip folder (like the current demo folders), then the following include paths need to be added to the application's project: 

..\Include 

..\..\Include 

..\..\Microchip\Include 

..\..\<Application Folder> 

..\..\..\<Application Folder> 

If a different directory structure is used, modify the paths as required. An example using absolute paths instead of relative paths would be the following: 

C:\Microchip Solutions\Microchip\Include 

C:\Microchip Solutions\My Demo Application

Functions
 
Name 
Description 
 
This function runs the MSD class state machines and all of its sub-systems. This function should be called periodically once the device is in the configured state in order to keep the MSD state machine going. 
 
This routine handles MSD specific request that happen on EP0. This function should be called from the USBCBCheckOtherReq() call back function whenever implementing an MSD device. 
 
This routine initializes the MSD class packet handles, prepares to receive a MSD packet, and initializes the MSD state machine. This function should be called once after the device is enumerated. 
Macros
 
Name 
Description 
 
MSD_DATA_IN is when the device is sending data (returned by MSDTasks()) 
 
MSD_DATA_OUT is when the device is receiving data (returned by MSDTasks()) 
 
MSD_SEND_CSW is when the device is waiting to send the CSW (returned by MSDTasks()) 
 
MSD_WAIT is when the MSD state machine is idle (returned by MSDTasks()) 
Structures
 
Name 
Description 
 
LUN_FUNCTIONS is a structure of function pointers that tells the stack where to find each of the physical layer functions it is looking for. This structure needs to be defined for any project for PIC24F or PIC32. 
Microchip MCHPFSUSB v2.3 - Sept 20, 2008
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.