These are the examples provided for [[/users/frank26080115/libraries/LPC1700CMSIS_Lib/]] Note, the entire "program" is not compilable!

Committer:
frank26080115
Date:
Sun Mar 20 05:38:56 2011 +0000
Revision:
0:bf7b9fba3924

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frank26080115 0:bf7b9fba3924 1 /*----------------------------------------------------------------------------
frank26080115 0:bf7b9fba3924 2 * U S B - K e r n e l
frank26080115 0:bf7b9fba3924 3 *----------------------------------------------------------------------------
frank26080115 0:bf7b9fba3924 4 * Name: MSC.H
frank26080115 0:bf7b9fba3924 5 * Purpose: USB Mass Storage Class Definitions
frank26080115 0:bf7b9fba3924 6 * Version: V1.10
frank26080115 0:bf7b9fba3924 7 *----------------------------------------------------------------------------
frank26080115 0:bf7b9fba3924 8 * This software is supplied "AS IS" without any warranties, express,
frank26080115 0:bf7b9fba3924 9 * implied or statutory, including but not limited to the implied
frank26080115 0:bf7b9fba3924 10 * warranties of fitness for purpose, satisfactory quality and
frank26080115 0:bf7b9fba3924 11 * noninfringement. Keil extends you a royalty-free right to reproduce
frank26080115 0:bf7b9fba3924 12 * and distribute executable files created using this software for use
frank26080115 0:bf7b9fba3924 13 * on NXP Semiconductors LPC family microcontroller devices only. Nothing
frank26080115 0:bf7b9fba3924 14 * else gives you the right to use this software.
frank26080115 0:bf7b9fba3924 15 *
frank26080115 0:bf7b9fba3924 16 * Copyright (c) 2005-2009 Keil Software.
frank26080115 0:bf7b9fba3924 17 *---------------------------------------------------------------------------*/
frank26080115 0:bf7b9fba3924 18
frank26080115 0:bf7b9fba3924 19 #ifndef __MSC_H__
frank26080115 0:bf7b9fba3924 20 #define __MSC_H__
frank26080115 0:bf7b9fba3924 21
frank26080115 0:bf7b9fba3924 22
frank26080115 0:bf7b9fba3924 23 #if defined ( __GNUC__ )
frank26080115 0:bf7b9fba3924 24 #define __packed __attribute__((__packed__))
frank26080115 0:bf7b9fba3924 25 #endif
frank26080115 0:bf7b9fba3924 26
frank26080115 0:bf7b9fba3924 27
frank26080115 0:bf7b9fba3924 28 /* MSC Subclass Codes */
frank26080115 0:bf7b9fba3924 29 #define MSC_SUBCLASS_RBC 0x01
frank26080115 0:bf7b9fba3924 30 #define MSC_SUBCLASS_SFF8020I_MMC2 0x02
frank26080115 0:bf7b9fba3924 31 #define MSC_SUBCLASS_QIC157 0x03
frank26080115 0:bf7b9fba3924 32 #define MSC_SUBCLASS_UFI 0x04
frank26080115 0:bf7b9fba3924 33 #define MSC_SUBCLASS_SFF8070I 0x05
frank26080115 0:bf7b9fba3924 34 #define MSC_SUBCLASS_SCSI 0x06
frank26080115 0:bf7b9fba3924 35
frank26080115 0:bf7b9fba3924 36 /* MSC Protocol Codes */
frank26080115 0:bf7b9fba3924 37 #define MSC_PROTOCOL_CBI_INT 0x00
frank26080115 0:bf7b9fba3924 38 #define MSC_PROTOCOL_CBI_NOINT 0x01
frank26080115 0:bf7b9fba3924 39 #define MSC_PROTOCOL_BULK_ONLY 0x50
frank26080115 0:bf7b9fba3924 40
frank26080115 0:bf7b9fba3924 41
frank26080115 0:bf7b9fba3924 42 /* MSC Request Codes */
frank26080115 0:bf7b9fba3924 43 #define MSC_REQUEST_RESET 0xFF
frank26080115 0:bf7b9fba3924 44 #define MSC_REQUEST_GET_MAX_LUN 0xFE
frank26080115 0:bf7b9fba3924 45
frank26080115 0:bf7b9fba3924 46
frank26080115 0:bf7b9fba3924 47 /* MSC Bulk-only Stage */
frank26080115 0:bf7b9fba3924 48 #define MSC_BS_CBW 0 /* Command Block Wrapper */
frank26080115 0:bf7b9fba3924 49 #define MSC_BS_DATA_OUT 1 /* Data Out Phase */
frank26080115 0:bf7b9fba3924 50 #define MSC_BS_DATA_IN 2 /* Data In Phase */
frank26080115 0:bf7b9fba3924 51 #define MSC_BS_DATA_IN_LAST 3 /* Data In Last Phase */
frank26080115 0:bf7b9fba3924 52 #define MSC_BS_DATA_IN_LAST_STALL 4 /* Data In Last Phase with Stall */
frank26080115 0:bf7b9fba3924 53 #define MSC_BS_CSW 5 /* Command Status Wrapper */
frank26080115 0:bf7b9fba3924 54 #define MSC_BS_ERROR 6 /* Error */
frank26080115 0:bf7b9fba3924 55
frank26080115 0:bf7b9fba3924 56
frank26080115 0:bf7b9fba3924 57 /* Bulk-only Command Block Wrapper */
frank26080115 0:bf7b9fba3924 58 #if defined ( __CC_ARM )
frank26080115 0:bf7b9fba3924 59 typedef __packed struct _MSC_CBW {
frank26080115 0:bf7b9fba3924 60 #elif defined ( __GNUC__ )
frank26080115 0:bf7b9fba3924 61 typedef struct __packed _MSC_CBW {
frank26080115 0:bf7b9fba3924 62 #elif defined ( __IAR_SYSTEMS_ICC__ )
frank26080115 0:bf7b9fba3924 63 typedef __packed struct _MSC_CBW {
frank26080115 0:bf7b9fba3924 64 #endif
frank26080115 0:bf7b9fba3924 65 uint32_t dSignature;
frank26080115 0:bf7b9fba3924 66 uint32_t dTag;
frank26080115 0:bf7b9fba3924 67 uint32_t dDataLength;
frank26080115 0:bf7b9fba3924 68 uint8_t bmFlags;
frank26080115 0:bf7b9fba3924 69 uint8_t bLUN;
frank26080115 0:bf7b9fba3924 70 uint8_t bCBLength;
frank26080115 0:bf7b9fba3924 71 uint8_t CB[16];
frank26080115 0:bf7b9fba3924 72 } MSC_CBW;
frank26080115 0:bf7b9fba3924 73
frank26080115 0:bf7b9fba3924 74 /* Bulk-only Command Status Wrapper */
frank26080115 0:bf7b9fba3924 75 #if defined ( __CC_ARM )
frank26080115 0:bf7b9fba3924 76 typedef __packed struct _MSC_CSW {
frank26080115 0:bf7b9fba3924 77 #elif defined ( __GNUC__ )
frank26080115 0:bf7b9fba3924 78 typedef struct __packed _MSC_CSW {
frank26080115 0:bf7b9fba3924 79 #elif defined ( __IAR_SYSTEMS_ICC__ )
frank26080115 0:bf7b9fba3924 80 typedef __packed struct _MSC_CSW {
frank26080115 0:bf7b9fba3924 81 #endif
frank26080115 0:bf7b9fba3924 82 uint32_t dSignature;
frank26080115 0:bf7b9fba3924 83 uint32_t dTag;
frank26080115 0:bf7b9fba3924 84 uint32_t dDataResidue;
frank26080115 0:bf7b9fba3924 85 uint8_t bStatus;
frank26080115 0:bf7b9fba3924 86 } MSC_CSW;
frank26080115 0:bf7b9fba3924 87
frank26080115 0:bf7b9fba3924 88 #define MSC_CBW_Signature 0x43425355
frank26080115 0:bf7b9fba3924 89 #define MSC_CSW_Signature 0x53425355
frank26080115 0:bf7b9fba3924 90
frank26080115 0:bf7b9fba3924 91
frank26080115 0:bf7b9fba3924 92 /* CSW Status Definitions */
frank26080115 0:bf7b9fba3924 93 #define CSW_CMD_PASSED 0x00
frank26080115 0:bf7b9fba3924 94 #define CSW_CMD_FAILED 0x01
frank26080115 0:bf7b9fba3924 95 #define CSW_PHASE_ERROR 0x02
frank26080115 0:bf7b9fba3924 96
frank26080115 0:bf7b9fba3924 97
frank26080115 0:bf7b9fba3924 98 /* SCSI Commands */
frank26080115 0:bf7b9fba3924 99 #define SCSI_TEST_UNIT_READY 0x00
frank26080115 0:bf7b9fba3924 100 #define SCSI_REQUEST_SENSE 0x03
frank26080115 0:bf7b9fba3924 101 #define SCSI_FORMAT_UNIT 0x04
frank26080115 0:bf7b9fba3924 102 #define SCSI_INQUIRY 0x12
frank26080115 0:bf7b9fba3924 103 #define SCSI_MODE_SELECT6 0x15
frank26080115 0:bf7b9fba3924 104 #define SCSI_MODE_SENSE6 0x1A
frank26080115 0:bf7b9fba3924 105 #define SCSI_START_STOP_UNIT 0x1B
frank26080115 0:bf7b9fba3924 106 #define SCSI_MEDIA_REMOVAL 0x1E
frank26080115 0:bf7b9fba3924 107 #define SCSI_READ_FORMAT_CAPACITIES 0x23
frank26080115 0:bf7b9fba3924 108 #define SCSI_READ_CAPACITY 0x25
frank26080115 0:bf7b9fba3924 109 #define SCSI_READ10 0x28
frank26080115 0:bf7b9fba3924 110 #define SCSI_WRITE10 0x2A
frank26080115 0:bf7b9fba3924 111 #define SCSI_VERIFY10 0x2F
frank26080115 0:bf7b9fba3924 112 #define SCSI_MODE_SELECT10 0x55
frank26080115 0:bf7b9fba3924 113 #define SCSI_MODE_SENSE10 0x5A
frank26080115 0:bf7b9fba3924 114
frank26080115 0:bf7b9fba3924 115
frank26080115 0:bf7b9fba3924 116 #endif /* __MSC_H__ */