Monitor20210726_ver1 add_im920

Dependencies:   mbed SB1602E TextLCD MSCFILESytem FatFileSystemCpp

Committer:
MPPT51
Date:
Mon Jul 26 05:53:49 2021 +0000
Revision:
3:fc42787d68a6
Parent:
1:93775378e5d9
210726_commit

Who changed what in which revision?

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