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