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