Dependencies:   mbed

Committer:
slowness
Date:
Fri Aug 26 12:19:16 2011 +0000
Revision:
0:4359b47b3d7c

        

Who changed what in which revision?

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