KIT Solar Car Project / Mbed 2 deprecated MS_ver2_20200405

Dependencies:   mbed SB1602E MSCFILESytem FatFileSystemCpp TextLCD

Committer:
MPPT51
Date:
Wed Apr 08 01:18:43 2020 +0000
Revision:
0:a6417f504b9d
MonitoringSys_includingToukarui

Who changed what in which revision?

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