This is a lib to use ChaNFS lib with USB mass storages like USB Sticks .. Long file names work

Dependencies:  

Dependents:   WeatherStation

Committer:
NeoBelerophon
Date:
Tue Feb 01 22:14:30 2011 +0000
Revision:
0:f0133ccac168
Initial commit

Who changed what in which revision?

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