Samir Bouaziz / FileSystem_POPS

Dependencies:   FatFileSystemCpp USBHostLite

Dependents:   m3PI_TP_POPS_II2015v0 m3PI_TP_POPS_II2015v0 ourproject m3PI_TP_SETI ... more

Committer:
WiredHome
Date:
Thu Oct 10 23:56:41 2013 +0000
Revision:
0:7304356c0790
File System interface for USB.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WiredHome 0:7304356c0790 1 /*
WiredHome 0:7304356c0790 2 **************************************************************************************************************
WiredHome 0:7304356c0790 3 * NXP USB Host Stack
WiredHome 0:7304356c0790 4 *
WiredHome 0:7304356c0790 5 * (c) Copyright 2008, NXP SemiConductors
WiredHome 0:7304356c0790 6 * (c) Copyright 2008, OnChip Technologies LLC
WiredHome 0:7304356c0790 7 * All Rights Reserved
WiredHome 0:7304356c0790 8 *
WiredHome 0:7304356c0790 9 * www.nxp.com
WiredHome 0:7304356c0790 10 * www.onchiptech.com
WiredHome 0:7304356c0790 11 *
WiredHome 0:7304356c0790 12 * File : usbhost_ms.h
WiredHome 0:7304356c0790 13 * Programmer(s) : Ravikanth.P
WiredHome 0:7304356c0790 14 * Version :
WiredHome 0:7304356c0790 15 *
WiredHome 0:7304356c0790 16 **************************************************************************************************************
WiredHome 0:7304356c0790 17 */
WiredHome 0:7304356c0790 18
WiredHome 0:7304356c0790 19 #ifndef USBHOST_MS_H
WiredHome 0:7304356c0790 20 #define USBHOST_MS_H
WiredHome 0:7304356c0790 21
WiredHome 0:7304356c0790 22 /*
WiredHome 0:7304356c0790 23 **************************************************************************************************************
WiredHome 0:7304356c0790 24 * INCLUDE HEADER FILES
WiredHome 0:7304356c0790 25 **************************************************************************************************************
WiredHome 0:7304356c0790 26 */
WiredHome 0:7304356c0790 27
WiredHome 0:7304356c0790 28 #include "usbhost_inc.h"
WiredHome 0:7304356c0790 29
WiredHome 0:7304356c0790 30 /*
WiredHome 0:7304356c0790 31 **************************************************************************************************************
WiredHome 0:7304356c0790 32 * MASS STORAGE SPECIFIC DEFINITIONS
WiredHome 0:7304356c0790 33 **************************************************************************************************************
WiredHome 0:7304356c0790 34 */
WiredHome 0:7304356c0790 35
WiredHome 0:7304356c0790 36 #define MS_GET_MAX_LUN_REQ 0xFE
WiredHome 0:7304356c0790 37 #define MASS_STORAGE_CLASS 0x08
WiredHome 0:7304356c0790 38 #define MASS_STORAGE_SUBCLASS_SCSI 0x06
WiredHome 0:7304356c0790 39 #define MASS_STORAGE_PROTOCOL_BO 0x50
WiredHome 0:7304356c0790 40
WiredHome 0:7304356c0790 41 #define INQUIRY_LENGTH 36
WiredHome 0:7304356c0790 42 /*
WiredHome 0:7304356c0790 43 **************************************************************************************************************
WiredHome 0:7304356c0790 44 * SCSI SPECIFIC DEFINITIONS
WiredHome 0:7304356c0790 45 **************************************************************************************************************
WiredHome 0:7304356c0790 46 */
WiredHome 0:7304356c0790 47
WiredHome 0:7304356c0790 48 #define CBW_SIGNATURE 0x43425355
WiredHome 0:7304356c0790 49 #define CSW_SIGNATURE 0x53425355
WiredHome 0:7304356c0790 50 #define CBW_SIZE 31
WiredHome 0:7304356c0790 51 #define CSW_SIZE 13
WiredHome 0:7304356c0790 52 #define CSW_CMD_PASSED 0x00
WiredHome 0:7304356c0790 53 #define SCSI_CMD_REQUEST_SENSE 0x03
WiredHome 0:7304356c0790 54 #define SCSI_CMD_TEST_UNIT_READY 0x00
WiredHome 0:7304356c0790 55 #define SCSI_CMD_INQUIRY 0x12
WiredHome 0:7304356c0790 56 #define SCSI_CMD_READ_10 0x28
WiredHome 0:7304356c0790 57 #define SCSI_CMD_READ_CAPACITY 0x25
WiredHome 0:7304356c0790 58 #define SCSI_CMD_WRITE_10 0x2A
WiredHome 0:7304356c0790 59
WiredHome 0:7304356c0790 60 /*
WiredHome 0:7304356c0790 61 **************************************************************************************************************
WiredHome 0:7304356c0790 62 * TYPE DEFINITIONS
WiredHome 0:7304356c0790 63 **************************************************************************************************************
WiredHome 0:7304356c0790 64 */
WiredHome 0:7304356c0790 65
WiredHome 0:7304356c0790 66 typedef enum ms_data_dir {
WiredHome 0:7304356c0790 67
WiredHome 0:7304356c0790 68 MS_DATA_DIR_IN = 0x80,
WiredHome 0:7304356c0790 69 MS_DATA_DIR_OUT = 0x00,
WiredHome 0:7304356c0790 70 MS_DATA_DIR_NONE = 0x01
WiredHome 0:7304356c0790 71
WiredHome 0:7304356c0790 72 } MS_DATA_DIR;
WiredHome 0:7304356c0790 73
WiredHome 0:7304356c0790 74 /*
WiredHome 0:7304356c0790 75 **************************************************************************************************************
WiredHome 0:7304356c0790 76 * FUNCTION PROTOTYPES
WiredHome 0:7304356c0790 77 **************************************************************************************************************
WiredHome 0:7304356c0790 78 */
WiredHome 0:7304356c0790 79
WiredHome 0:7304356c0790 80 USB_INT32S MS_BulkRecv ( USB_INT32U block_number,
WiredHome 0:7304356c0790 81 USB_INT16U num_blocks,
WiredHome 0:7304356c0790 82 volatile USB_INT08U *user_buffer);
WiredHome 0:7304356c0790 83
WiredHome 0:7304356c0790 84 USB_INT32S MS_BulkSend ( USB_INT32U block_number,
WiredHome 0:7304356c0790 85 USB_INT16U num_blocks,
WiredHome 0:7304356c0790 86 volatile USB_INT08U *user_buffer);
WiredHome 0:7304356c0790 87 USB_INT32S MS_ParseConfiguration(void);
WiredHome 0:7304356c0790 88 USB_INT32S MS_TestUnitReady (void);
WiredHome 0:7304356c0790 89 USB_INT32S MS_ReadCapacity (USB_INT32U *numBlks, USB_INT32U *blkSize);
WiredHome 0:7304356c0790 90 USB_INT32S MS_GetMaxLUN (void);
WiredHome 0:7304356c0790 91 USB_INT32S MS_GetSenseInfo (void);
WiredHome 0:7304356c0790 92 USB_INT32S MS_Init (USB_INT32U *blkSize, USB_INT32U *numBlks, USB_INT08U *inquiryResult);
WiredHome 0:7304356c0790 93 USB_INT32S MS_Inquire (USB_INT08U *response);
WiredHome 0:7304356c0790 94
WiredHome 0:7304356c0790 95 void Fill_MSCommand ( USB_INT32U block_number,
WiredHome 0:7304356c0790 96 USB_INT32U block_size,
WiredHome 0:7304356c0790 97 USB_INT16U num_blocks,
WiredHome 0:7304356c0790 98 MS_DATA_DIR direction,
WiredHome 0:7304356c0790 99 USB_INT08U scsi_cmd,
WiredHome 0:7304356c0790 100 USB_INT08U scsi_cmd_len);
WiredHome 0:7304356c0790 101 #endif