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

📄 mass_stg.lst

📁 基于c8051F320的优盘制作代码及原理图
💻 LST
📖 第 1 页 / 共 5 页
字号:
 202          //////////////////////////////////////////////////////////////////////////////////////////////          
 203          code    Config_Descriptor       config_descriptor = 
 204          {
 205                  0x09,                   //Descriptor Length
 206                  0x02,                   //Descriptor type
 207                  0x3C00,                 //config + interface + 6*endpoint
 208                  0x01,                   //Number of interface
 209                  0x01,                   //config value for Set_config and Get_config            
 210                  0x00,                   //index of Config Descriptor
 211                  0x80,                   //Device is Self Powered, don't surpport Remote Wakeup
 212                  0xFA                    //Maximum Bus Current is 500mA
 213          
 214          };      
 215          //////////////////////////////////////////////////////////////////////////////////////////////
 216          code    Interface_Descriptor    interface_descriptor =
 217          {
 218                  0x09,                   //Length
 219                  0x04,                   //Type
 220                  0x00,                   //interface Number
 221                  0x00,                   //default value
 222                  0x02,                   //Endpoint Number
 223                  0x08,                   //interface Class
 224                  0x06,                   //Interface Sub Class
 225                  0x50,                   //Use Mass Storage Bulk Only Transfer 
 226                  0x00                    //Index of the Descriptor
 227          
 228          };
 229          //////////////////////////////////////////////////////////////////////////////////////////////
 230          code    Endpoint_Descriptor             endpointIN1_descriptor = 
 231          {
 232                  0x07,                   //Length
 233                  0x05,                   //Type
 234                  0x81,                   //Endpoint      Address
 235                  0x02,                   //Endpoint Surpport Bulk Transfer
 236                  0x4000,                 //Max Packet Size
 237                  0x00                    //not Related
 238          
 239          };
 240          ///////////////////////////////////////////////////////////////////////////////////////////////
 241          code    Endpoint_Descriptor             endpointOUT1_descriptor = 
C51 COMPILER V7.06   MASS_STG                                                              10/19/2007 15:26:26 PAGE 5   

 242          {
 243                  0x07,                   //Length
 244                  0x05,                   //Type
 245                  0x01,                   //Endpoint      Address
 246                  0x02,                   //Endpoint Surpport Bulk Transfer
 247                  0x4000,                 //Max Packet Size
 248                  0x00                    //not Related
 249          
 250          };
 251          //////////////////////////////////////////////////////////////////////////////////////////////
 252          code    Endpoint_Descriptor             endpointIN2_descriptor = 
 253          {
 254                  0x07,                   //Length
 255                  0x05,                   //Type
 256                  0x82,                   //Endpoint      Address
 257                  0x02,                   //Endpoint Surpport Bulk Transfer
 258                  0x4000,                 //Max Packet Size
 259                  0x00                    //not Related
 260          
 261          };
 262          /////////////////////////////////////////////////////////////////////////////////////////////
 263          code    Endpoint_Descriptor             endpointOUT2_descriptor = 
 264          {
 265                  0x07,                   //Length
 266                  0x05,                   //Type
 267                  0x02,                   //Endpoint      Address
 268                  0x02,                   //Endpoint Surpport Bulk Transfer
 269                  0x4000,                 //Max Packet Size
 270                  0x00                    //not Related
 271          
 272          };
 273          
 274          ////////////////////////////////////////////////////////////////////////////////////////////
 275          code    Endpoint_Descriptor             endpointIN3_descriptor = 
 276          {
 277                  0x07,                   //Length
 278                  0x05,                   //Type
 279                  0x83,                   //Endpoint      Address
 280                  0x02,                   //Endpoint Surpport Bulk Transfer
 281                  0x4000,                 //Max Packet Size
 282                  0x00                    //not Related
 283          
 284          };
 285          
 286          ///////////////////////////////////////////////////////////////////////////////////////////
 287          code    Endpoint_Descriptor             endpointOUT3_descriptor = 
 288          {
 289                  0x07,                   //Length
 290                  0x05,                   //Type
 291                  0x03,                   //Endpoint      Address
 292                  0x02,                   //Endpoint Surpport Bulk Transfer
 293                  0x4000,                 //Max Packet Size
 294                  0x00                    //not Related
 295          
 296          };
 297          /////////////////////////////////////////////////////////////////////////////////////////
 298          code    Config_Long             config_long = 
 299          {
 300          //Configure Descriptor
 301                  {
 302                  0x09,                   //Descriptor Length
 303                  0x02,                   //Descriptor type
C51 COMPILER V7.06   MASS_STG                                                              10/19/2007 15:26:26 PAGE 6   

 304                  0x2000,                 //config + interface + 6*endpoint
 305                  0x01,                   //Number of interface
 306                  0x01,                   //config value for Set_config and Get_config            
 307                  0x00,                   //index of Config Descriptor
 308                  0x80,                   //Device is Self Powered, don't surpport Remote Wakeup
 309                  0xFA                    //Maximum Bus Current is 500mA
 310          
 311                  },      
 312          
 313          //Interface Descriptor
 314                  {
 315                  0x09,                   //Length
 316                  0x04,                   //Type
 317                  0x00,                   //interface Number
 318                  0x00,                   //default value
 319                  0x02,                   //Endpoint Number
 320                  0x08,                   //interface Class
 321                  0x06,                   //Interface Sub Class
 322                  0x50,                   //Use Mass Storage Bulk Only Transfer 
 323                  0x00                    //Index of the Descriptor
 324          
 325                  },
 326          
 327          //Six Endpoint1-3 Descriptor
 328          {
 329          //Endpoint 1 IN description     
 330                  {
 331                  0x07,                   //Length
 332                  0x05,                   //Type
 333                  0x81,                   //Endpoint      Address
 334                  0x02,                   //Endpoint Surpport Bulk Transfer
 335                  0x4000,                 //Max Packet Size
 336                  0x00                    //not Related
 337          
 338                  },
 339          //Endpoint 1 OUT Description
 340                  {
 341                  0x07,                   //Length
 342                  0x05,                   //Type
 343                  0x01,                   //Endpoint      Address
 344                  0x02,                   //Endpoint Surpport Bulk Transfer
 345                  0x4000,                 //Max Packet Size
 346                  0x00                    //not Related
 347          
 348                  },
 349          
 350          //Endpoint 2 IN Description
 351          /*      {
 352                  0x07,                   //Length
 353                  0x05,                   //Type
 354                  0x82,                   //Endpoint      Address
 355                  0x02,                   //Endpoint Surpport Bulk Transfer
 356                  0x4000,                 //Max Packet Size
 357                  0x00                    //not Related
 358          
 359                  },
 360          //Endpoint 2 OUT Description
 361                  {
 362                  0x07,                   //Length
 363                  0x05,                   //Type
 364                  0x02,                   //Endpoint      Address
 365                  0x02,                   //Endpoint Surpport Bulk Transfer
C51 COMPILER V7.06   MASS_STG                                                              10/19/2007 15:26:26 PAGE 7   

 366                  0x4000,                 //Max Packet Size
 367                  0x00                    //not Related
 368          
 369                  },
 370          //Endpoint 3 IN Description
 371                  {
 372                  0x07,                   //Length
 373                  0x05,                   //Type
 374                  0x81,                   //Endpoint      Address
 375                  0x02,                   //Endpoint Surpport Bulk Transfer
 376                  0x4000,                 //Max Packet Size
 377                  0x00                    //not Related
 378          
 379                  },
 380          
 381          //Endpoint 3 OUT Description
 382                  {
 383                  0x07,                   //Length
 384                  0x05,                   //Type
 385                  0x01,                   //Endpoint      Address
 386                  0x02,                   //Endpoint Surpport Bulk Transfer
 387                  0x4000,                 //Max Packet Size
 388                  0x00                    //not Related
 389          
 390                  },*/
 391          
 392          
 393          }
 394          
 395          };
 396          /*****************************************************************************************
 397          Global Variables Define Area
 398          ******************************************************************************************/
 399          xdata   Flags   flags;                                                  //Bulk in and Bulk out endPoint interrupt flags
 400          CSW             *pCS;
 401          bit             csw;
 402          xdata   uchar           buf[512];
 403          
 404          /****************************************************************************************
 405          MAIN ROUTINE FOR USB TRANSFER
 406          *****************************************************************************************/
 407          void    main(void)
 408          {
 409   1      //variables define      area
 410   1      
 411   1              Oscillator_Init();

⌨️ 快捷键说明

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