Sertel USB Log

Fork of MSCFileSystem by Chris Styles

Committer:
chris
Date:
Tue Apr 05 23:36:08 2011 +0000
Revision:
0:3e7d2baed4b4

        

Who changed what in which revision?

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