⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bulk_only.lst

📁 基于MCU的U盘源码
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.09   BULK_ONLY                                                             05/11/2005 17:30:28 PAGE 1   


C51 COMPILER V7.09, COMPILATION OF MODULE BULK_ONLY
OBJECT MODULE PLACED IN bulk_only.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE bulk_only.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          ///////////////////////////////////////////////////////////////// 
   2          //
   3          // Copyright (c) 2004 
   4          // All rights reserved
   5          // 
   6          // Author       :       frank_wang     frank_wang@263.net
   7          // Created      :       JUN 23th 2004
   8          // Modified     :
   9          // Revision     :       ARM7+D12,
  10          // Usage        :        USB DISK ,SCSI-2
  11          /////////////////////////////////////////////////////////////////
  12          
  13          //this file to process the request about bulk_only
  14          //#include "..\inc\44blib.h"
  15          #include "bulk_only.h"
  16          #include "def.h"
*** WARNING C318 IN LINE 16 OF bulk_only.c: can't open file 'def.h'
  17          #include "fat16.h"
*** ERROR C129 IN LINE 40 OF FAT16.H: missing ';' before 'struct'
  18          #include "Main.h"
  19          #include "string.h"
  20          
  21          extern EPPFLAGS bEPPflags;
  22          extern unsigned char  EpBuf[];
  23          
  24          long unsigned int dDataResiduce;
  25          U8 bulk_state;          //当前传送状态
  26          U8 *pCurrentBuf;                //数据传送指针
  27          U32     nBufCount;              //传送数据当前位置
  28          
  29          unsigned char MSC_dCBWSignature[]={0x55,0x53,0x42,0x43};
  30          unsigned char MSC_dCSWSignature[]={0x55,0x53,0x42,0x53};
  31          
  32          #define Format_Unit                             0x04
  33          #define Inquiry                                         0x12 
  34          #define Mode_Select                             0x55 
  35          #define Mode_Sense                              0x1A 
  36          #define Medium_Removal                  0x1E
  37          #define Read10                                  0x28 
  38          #define Read12                                  0xA8 
  39          #define Read_Capacity                   0x25 
  40          #define Read_Format_Capacities  0x23 
  41          #define Request_Sense                   0x03 
  42          #define Rezero                                  0x01 
  43          #define Seek10                                  0x2B 
  44          #define Send_Diag                               0x1D 
  45          #define Start_Stop_Unit                         0x1B 
  46          #define Test_Unit_Ready                         0x00 
  47          #define Verify                                  0x2F 
  48          #define Write10                                         0x2A 
  49          #define Write12                                         0xAA 
  50          #define Write_And_Verify                        0x2E 
  51          
  52          
  53          
C51 COMPILER V7.09   BULK_ONLY                                                             05/11/2005 17:30:28 PAGE 2   

  54          
  55          #define SCSI_MSPGCD_TPP         0x1c
  56          #define SCSI_MSPGCD_RETALL              0x3f
  57          
  58          U8 Bulk_Out_Buf[528];
  59          U8 Bulk_In_Buf[528];
  60          
  61          U8 Flash_One_Page[512*32+16*32];
  62          
  63          U16 Transfer_Length;
  64          U32 Logical_Block_Address;
  65          U32 nCurrentPage,nBeginPage;
  66          U32 nCurrentBlock;
  67          unsigned char B_InquiryData[]={
  68                                                                  0x00,   //Direct Access Device
  69                                                                  0x80,   //RMB
  70                                                                  0x00,   //ISO/ECMA/ANSI
  71                                                                  0x01,   //Response Data Format
  72                                                                  0x1f,   //Additional Length
  73                                                                  0x00,   //Reserved
  74                                                                  0x00,   //Reserved
  75                                                                  0x00,   //Reserved
  76                                                                  'u','p','-','t','e','c','h',0,  //Vendor Information
  77                                                                  'U','P','-','N','E','T','A','R','M','3','0','0',0,0,0,0,//Product Identification
  78                                                                  0,0,0,0};       //Product Revision Level n.nn
  79          
  80          unsigned char CapactiyLstHd[]={0x00,0x00,0x00,0x10};
  81          unsigned char bBlockLength[]={0x00,0x02,0x00};          //512 Byte
  82          unsigned char nLastLBAddr[]={0x00,0x01,0xf3,0xff};      //Last  Logical Block Address for 64MB
  83          unsigned char B_Read_Format_capacities[]={0x00,0x00,0x00,0x10,  //capacity list header
  84                                                                                  0x00,0x00,0x04,0x00,    0x01,           0x00,0x02,0x00, //capacity descriptor
  85                                                                          //      Number of Blocks =1024,unformatted media,blocklength = 512Bytes
  86                                                                                  0x00,0x00,0x04,0x00,    0x00,           0x00,0x02,0x00  //Formattable Capacity Descriptors
  87                                                                                  };
  88          
  89          unsigned char B_Read_Canpacity[]={
  90                                                                          0x00,0x01,0xf3,0xff,    //Last  Logical Block Address for 64MB
  91                                                                          0x00,0x00,0x02,0x00     //block length in bytes
  92                                                                          };
  93          
  94          unsigned char B_Mode_Sense_ALL[]={0x00,0x3e,//Mode Data Length
  95                                                                  0x00,   //Medium Type Code
  96                                                                  0,//write enabled
  97                                                                  0,0,0,0,//reserved
  98                                                                  //Read-Write Eroor Recovery Page
  99                                                                  0x01,   //Page Code of Read-Write Error Recovery Page
 100                                                                  0x0a,   //Page Length
 101                                                                  0,              //Error Recovery Parameters
 102                                                                  3,              //Read Retry Count
 103                                                                  0,0,0,0,
 104                                                                  3,              //Write Retry Count
 105                                                                  0,0,0,
 106                                                                  //Flexible Disk Page
 107                                                                  0x05,   //Page Code of Flexible Disk Page
 108                                                                  0x1e,   //Page Length
 109                                                                  0x13,0x88,      //Transfer Rate = 512kbps
 110                                                                  8,      //Number of Heads磁头数
 111                                                                  32,     //Sectors per Track每磁道扇区数
 112                                                                  0x02,0x00,      //Data bytes per Sector每扇区字节数
 113                                                                  0x01,0xf4,      //Number of Cuylinders柱面数
 114                                                                  0,0,0,0,0,0,0,0,0,//Reserved 保留
 115                                                                  1,              //motor On Delay
C51 COMPILER V7.09   BULK_ONLY                                                             05/11/2005 17:30:28 PAGE 3   

 116                                                                  0xff,   //motor Off Delay=Never
 117                                                                  0,0,0,0,0,0,0,//Reserved 保留
 118                                                                  0x01,0x2c,      //Medium Rotation Rate介质旋转速率=300rpm
 119                                                                  0,0,    //Reserved 保留
 120                                                                  //Removable Block Access Capabilities Page
 121                                                                  0x1b,   //Page Code
 122                                                                  0x0a,   //Page Length
 123                                                                  0,//0x80,       //SFLP=1
 124                                                                  0x01,   //TLUN=1
 125                                                                  0,0,0,0,0,0,0,0//Reserved 保留
 126                                                                  };
 127          
 128          unsigned char B_Mode_Sense_TPP[]={0x00,0x0d,//Mode Data Length
 129                                                                  0x00,   //Medium Type Code

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -