![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
USB Host Lite downloaded from NXP web site. Untested! Compiled, dropped on MBED, booted up, and get the console message that it is initializing the stack. I however do not have the ability to connect a USB Memory device to test it.
MassStorage/usbhost_ms.h@0:0826fcc5d020, 2010-01-13 (annotated)
- Committer:
- mshoemaker
- Date:
- Wed Jan 13 01:29:30 2010 +0000
- Revision:
- 0:0826fcc5d020
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mshoemaker | 0:0826fcc5d020 | 1 | /* |
mshoemaker | 0:0826fcc5d020 | 2 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 3 | * NXP USB Host Stack |
mshoemaker | 0:0826fcc5d020 | 4 | * |
mshoemaker | 0:0826fcc5d020 | 5 | * (c) Copyright 2008, NXP SemiConductors |
mshoemaker | 0:0826fcc5d020 | 6 | * (c) Copyright 2008, OnChip Technologies LLC |
mshoemaker | 0:0826fcc5d020 | 7 | * All Rights Reserved |
mshoemaker | 0:0826fcc5d020 | 8 | * |
mshoemaker | 0:0826fcc5d020 | 9 | * www.nxp.com |
mshoemaker | 0:0826fcc5d020 | 10 | * www.onchiptech.com |
mshoemaker | 0:0826fcc5d020 | 11 | * |
mshoemaker | 0:0826fcc5d020 | 12 | * File : usbhost_ms.h |
mshoemaker | 0:0826fcc5d020 | 13 | * Programmer(s) : Ravikanth.P |
mshoemaker | 0:0826fcc5d020 | 14 | * Version : |
mshoemaker | 0:0826fcc5d020 | 15 | * |
mshoemaker | 0:0826fcc5d020 | 16 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 17 | */ |
mshoemaker | 0:0826fcc5d020 | 18 | |
mshoemaker | 0:0826fcc5d020 | 19 | #ifndef USBHOST_MS_H |
mshoemaker | 0:0826fcc5d020 | 20 | #define USBHOST_MS_H |
mshoemaker | 0:0826fcc5d020 | 21 | |
mshoemaker | 0:0826fcc5d020 | 22 | /* |
mshoemaker | 0:0826fcc5d020 | 23 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 24 | * INCLUDE HEADER FILES |
mshoemaker | 0:0826fcc5d020 | 25 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 26 | */ |
mshoemaker | 0:0826fcc5d020 | 27 | |
mshoemaker | 0:0826fcc5d020 | 28 | #include "usbhost_inc.h" |
mshoemaker | 0:0826fcc5d020 | 29 | |
mshoemaker | 0:0826fcc5d020 | 30 | /* |
mshoemaker | 0:0826fcc5d020 | 31 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 32 | * MASS STORAGE SPECIFIC DEFINITIONS |
mshoemaker | 0:0826fcc5d020 | 33 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 34 | */ |
mshoemaker | 0:0826fcc5d020 | 35 | |
mshoemaker | 0:0826fcc5d020 | 36 | #define MS_GET_MAX_LUN_REQ 0xFE |
mshoemaker | 0:0826fcc5d020 | 37 | #define MASS_STORAGE_CLASS 0x08 |
mshoemaker | 0:0826fcc5d020 | 38 | #define MASS_STORAGE_SUBCLASS_SCSI 0x06 |
mshoemaker | 0:0826fcc5d020 | 39 | #define MASS_STORAGE_PROTOCOL_BO 0x50 |
mshoemaker | 0:0826fcc5d020 | 40 | |
mshoemaker | 0:0826fcc5d020 | 41 | #define INQUIRY_LENGTH 36 |
mshoemaker | 0:0826fcc5d020 | 42 | /* |
mshoemaker | 0:0826fcc5d020 | 43 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 44 | * SCSI SPECIFIC DEFINITIONS |
mshoemaker | 0:0826fcc5d020 | 45 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 46 | */ |
mshoemaker | 0:0826fcc5d020 | 47 | |
mshoemaker | 0:0826fcc5d020 | 48 | #define CBW_SIGNATURE 0x43425355 |
mshoemaker | 0:0826fcc5d020 | 49 | #define CSW_SIGNATURE 0x53425355 |
mshoemaker | 0:0826fcc5d020 | 50 | #define CBW_SIZE 31 |
mshoemaker | 0:0826fcc5d020 | 51 | #define CSW_SIZE 13 |
mshoemaker | 0:0826fcc5d020 | 52 | #define CSW_CMD_PASSED 0x00 |
mshoemaker | 0:0826fcc5d020 | 53 | #define SCSI_CMD_REQUEST_SENSE 0x03 |
mshoemaker | 0:0826fcc5d020 | 54 | #define SCSI_CMD_TEST_UNIT_READY 0x00 |
mshoemaker | 0:0826fcc5d020 | 55 | #define SCSI_CMD_INQUIRY 0x12 |
mshoemaker | 0:0826fcc5d020 | 56 | #define SCSI_CMD_READ_10 0x28 |
mshoemaker | 0:0826fcc5d020 | 57 | #define SCSI_CMD_READ_CAPACITY 0x25 |
mshoemaker | 0:0826fcc5d020 | 58 | #define SCSI_CMD_WRITE_10 0x2A |
mshoemaker | 0:0826fcc5d020 | 59 | |
mshoemaker | 0:0826fcc5d020 | 60 | /* |
mshoemaker | 0:0826fcc5d020 | 61 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 62 | * TYPE DEFINITIONS |
mshoemaker | 0:0826fcc5d020 | 63 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 64 | */ |
mshoemaker | 0:0826fcc5d020 | 65 | |
mshoemaker | 0:0826fcc5d020 | 66 | typedef enum ms_data_dir { |
mshoemaker | 0:0826fcc5d020 | 67 | |
mshoemaker | 0:0826fcc5d020 | 68 | MS_DATA_DIR_IN = 0x80, |
mshoemaker | 0:0826fcc5d020 | 69 | MS_DATA_DIR_OUT = 0x00, |
mshoemaker | 0:0826fcc5d020 | 70 | MS_DATA_DIR_NONE = 0x01 |
mshoemaker | 0:0826fcc5d020 | 71 | |
mshoemaker | 0:0826fcc5d020 | 72 | } MS_DATA_DIR; |
mshoemaker | 0:0826fcc5d020 | 73 | |
mshoemaker | 0:0826fcc5d020 | 74 | /* |
mshoemaker | 0:0826fcc5d020 | 75 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 76 | * FUNCTION PROTOTYPES |
mshoemaker | 0:0826fcc5d020 | 77 | ************************************************************************************************************** |
mshoemaker | 0:0826fcc5d020 | 78 | */ |
mshoemaker | 0:0826fcc5d020 | 79 | |
mshoemaker | 0:0826fcc5d020 | 80 | USB_INT32S MS_BulkRecv ( USB_INT32U block_number, |
mshoemaker | 0:0826fcc5d020 | 81 | USB_INT16U num_blocks, |
mshoemaker | 0:0826fcc5d020 | 82 | volatile USB_INT08U *user_buffer); |
mshoemaker | 0:0826fcc5d020 | 83 | |
mshoemaker | 0:0826fcc5d020 | 84 | USB_INT32S MS_BulkSend ( USB_INT32U block_number, |
mshoemaker | 0:0826fcc5d020 | 85 | USB_INT16U num_blocks, |
mshoemaker | 0:0826fcc5d020 | 86 | volatile USB_INT08U *user_buffer); |
mshoemaker | 0:0826fcc5d020 | 87 | USB_INT32S MS_ParseConfiguration(void); |
mshoemaker | 0:0826fcc5d020 | 88 | USB_INT32S MS_TestUnitReady (void); |
mshoemaker | 0:0826fcc5d020 | 89 | USB_INT32S MS_ReadCapacity (USB_INT32U *numBlks, USB_INT32U *blkSize); |
mshoemaker | 0:0826fcc5d020 | 90 | USB_INT32S MS_GetMaxLUN (void); |
mshoemaker | 0:0826fcc5d020 | 91 | USB_INT32S MS_GetSenseInfo (void); |
mshoemaker | 0:0826fcc5d020 | 92 | USB_INT32S MS_Init (USB_INT32U *blkSize, USB_INT32U *numBlks, USB_INT08U *inquiryResult); |
mshoemaker | 0:0826fcc5d020 | 93 | USB_INT32S MS_Inquire (USB_INT08U *response); |
mshoemaker | 0:0826fcc5d020 | 94 | |
mshoemaker | 0:0826fcc5d020 | 95 | void Fill_MSCommand ( USB_INT32U block_number, |
mshoemaker | 0:0826fcc5d020 | 96 | USB_INT32U block_size, |
mshoemaker | 0:0826fcc5d020 | 97 | USB_INT16U num_blocks, |
mshoemaker | 0:0826fcc5d020 | 98 | MS_DATA_DIR direction, |
mshoemaker | 0:0826fcc5d020 | 99 | USB_INT08U scsi_cmd, |
mshoemaker | 0:0826fcc5d020 | 100 | USB_INT08U scsi_cmd_len); |
mshoemaker | 0:0826fcc5d020 | 101 | #endif |