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