V

Dependencies:   mbed FatFileSystemCpp TextLCD

Committer:
bertonieto
Date:
Mon Aug 12 21:54:14 2019 +0000
Revision:
2:73cbcff90232
Export new

Who changed what in which revision?

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