complete

Dependencies:   FatFileSystem mbed

Fork of SnakeSnakeGame by Tho Jian Xiang

Committer:
Rexry7878
Date:
Tue Aug 11 05:25:56 2015 +0000
Revision:
2:ac02c7ff905b
Parent:
1:4222a8f9ca88
complete

Who changed what in which revision?

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