Import Library

Committer:
carlos_nascimento08
Date:
Sun Jul 22 20:46:05 2012 +0000
Revision:
0:10643735c105
USBHostFile
;

Who changed what in which revision?

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