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

📄 bulk_only.lst

📁 用89C51SND1C实现的USB存储器的代码,包括USB通信和FLASH的读写操作.
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V6.23a  BULK_ONLY                                                             06/02/2003 09:51:31 PAGE 1   


C51 COMPILER V6.23a, COMPILATION OF MODULE BULK_ONLY
OBJECT MODULE PLACED IN bulk_only.OBJ
COMPILER INVOKED BY: E:\Program Files\keil\C51\BIN\C51.EXE bulk_only.c LARGE BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          //this file to process the request about bulk_only
   2          #include <string.h>
   3          
   4          #include "bulk_only.h"
   5          
   6          #include "main.h"
   7          #include "uart.h"
   8          #include "flash.h"
   9          
  10          //extern unsigned char  EpBuf[];
  11          
  12          long unsigned int dDataResiduce=0;
  13          unsigned char bulk_state=0;             //当前传送状态
  14          unsigned char *pCurrentBuf;             //数据传送指针
  15          long int nBufCount=0;           //传送数据当前位置
  16          
  17          
  18          unsigned char MSC_dCBWSignature[]={0x55,0x53,0x42,0x43};
  19          unsigned char MSC_dCSWSignature[]={0x55,0x53,0x42,0x53};
  20          
  21          #define Format_Unit                             0x04
  22          #define Inquiry                                         0x12 
  23          #define Mode_Select                             0x55 
  24          #define Mode_Sense                              0x1A 
  25          #define Medium_Removal                  0x1E
  26          #define Read10                                  0x28 
  27          #define Read12                                  0xA8 
  28          #define Read_Capacity                   0x25 
  29          #define Read_Format_Capacities  0x23 
  30          #define Request_Sense                   0x03 
  31          #define Rezero                                  0x01 
  32          #define Seek10                                  0x2B 
  33          #define Send_Diag                               0x1D 
  34          #define Start_Stop_Unit                         0x1B 
  35          #define Test_Unit_Ready                         0x00 
  36          #define Verify                                  0x2F 
  37          #define Write10                                         0x2A 
  38          #define Write12                                         0xAA 
  39          #define Write_And_Verify                        0x2E 
  40          
  41          
  42          
  43          #define Root_Cluster 0
  44          
  45          #define SCSI_MSPGCD_TPP         0x1c
  46          #define SCSI_MSPGCD_RETALL              0x3f
  47          
  48          unsigned char Bulk_Out_Buf[64];
  49          unsigned char Page_Buf[512];
  50          
  51          
  52          short int Transfer_Length;
  53          long int Logical_Block_Address;
  54          long int nCurrentPage,nBeginPage;
  55          long int nCurrentBlock;
C51 COMPILER V6.23a  BULK_ONLY                                                             06/02/2003 09:51:31 PAGE 2   

  56          code unsigned char B_InquiryData[]={
  57                                                                  0x00,   //Direct Access Device
  58                                                                  0x80,   //RMB
  59                                                                  0x00,   //ISO/ECMA/ANSI
  60                                                                  0x01,   //Response Data Format
  61                                                                  0x1f,   //Additional Length
  62                                                                  0x00,   //Reserved
  63                                                                  0x00,   //Reserved
  64                                                                  0x00,   //Reserved
  65                                                                  'U','P','-','T','E','C','H',' ',        //Vendor Information
  66                                                                  'M','P','3',' ','P','l','a','y','e','r',' ','V','1','.','0','0',//Product Identification
  67                                                                  0,1,0,0};       //Product Revision Level n.nn
  68          
  69          code unsigned char CapactiyLstHd[]={0x00,0x00,0x00,0x10};
  70          code unsigned char bBlockLength[]={0x00,0x02,0x00};             //512 Byte
  71          code unsigned char nLastLBAddr[]={0x00,0x01,0xf3,0xff}; //Last  Logical Block Address for 64MB
  72          code unsigned char B_Read_Format_capacities[]={0x00,0x00,0x00,0x10,     //capacity list header
  73                                                                                  0x00,0x00,0x04,0x00,    0x01,           0x00,0x02,0x00, //capacity descriptor
  74                                                                          //      Number of Blocks =1024,unformatted media,blocklength = 512Bytes
  75                                                                                  0x00,0x00,0x04,0x00,    0x00,           0x00,0x02,0x00  //Formattable Capacity Descriptors
  76                                                                                  };
  77          
  78          code unsigned char B_Read_Capacity[]={
  79                                                                          0x00,0x01,0xf30,0xff,   //Last  Logical Block Address for 64MB
  80                                                                          0x00,0x00,0x02,0x00     //block length in bytes
  81                                                                          };
  82          
  83                                                                          /*
  84          code unsigned char B_Mode_Sense_ALL[]={0x00,0x3e,//Mode Data Length
  85                                                                  0x00,   //Medium Type Code
  86                                                                  0,//write enabled
  87                                                                  0,0,0,0,//reserved
  88                                                                  //Read-Write Eroor Recovery Page
  89                                                                  0x01,   //Page Code of Read-Write Error Recovery Page
  90                                                                  0x0a,   //Page Length
  91                                                                  0,              //Error Recovery Parameters
  92                                                                  3,              //Read Retry Count
  93                                                                  0,0,0,0,
  94                                                                  3,              //Write Retry Count
  95                                                                  0,0,0,
  96                                                                  //Flexible Disk Page
  97                                                                  0x05,   //Page Code of Flexible Disk Page
  98                                                                  0x1e,   //Page Length
  99                                                                  0x13,0x88,      //Transfer Rate = 512kbps
 100                                                                  0,      //Number of Heads磁头数
 101                                                                  0,      //Sectors per Track每磁道扇区数
 102                                                                  0x02,0x00,      //Data bytes per Sector每扇区字节数
 103                                                                  0x00,0x00,      //Number of Cuylinders柱面数
 104                                                                  0,0,0,0,0,0,0,0,0,//Reserved 保留
 105                                                                  1,              //motor On Delay
 106                                                                  0xff,   //motor Off Delay=Never
 107                                                                  0,0,0,0,0,0,0,//Reserved 保留
 108                                                                  0x00,0x00,      //Medium Rotation Rate介质旋转速率=300rpm
 109                                                                  0,0,    //Reserved 保留
 110                                                                  //Removable Block Access Capabilities Page
 111                                                                  0x1b,   //Page Code
 112                                                                  0x0a,   //Page Length
 113                                                                  0,//0x80,       //SFLP=1
 114                                                                  0x01,   //TLUN=1

⌨️ 快捷键说明

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