as

Dependencies:   C12832 CMPS03 FatFileSystemCpp mbed

Committer:
JWitherstone
Date:
Wed May 07 10:15:01 2014 +0000
Revision:
0:6cf24371ad4f
this is compass;

Who changed what in which revision?

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