Dependents:   sample_collection_for_starboard_orange starboard_orange_samples

Committer:
chris
Date:
Wed Jun 13 10:52:22 2012 +0000
Revision:
1:29e541664957
Parent:
0:f4e330489777
I was asked to commit this, but i dont know why

Who changed what in which revision?

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