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

📄 test.i

📁 51环境下的FAT及FAT32文件系统源码
💻 I
📖 第 1 页 / 共 2 页
字号:
#line 1 "test.c" /0  #line 1 "common.h" /0  #line 1 "C:\KEIL\C51\INC\REG51.H" /0       sfr P0   = 0x80; sfr P1   = 0x90; sfr P2   = 0xA0; sfr P3   = 0xB0; sfr PSW  = 0xD0; sfr ACC  = 0xE0; sfr B    = 0xF0; sfr SP   = 0x81; sfr DPL  = 0x82; sfr DPH  = 0x83; sfr PCON = 0x87; sfr TCON = 0x88; sfr TMOD = 0x89; sfr TL0  = 0x8A; sfr TL1  = 0x8B; sfr TH0  = 0x8C; sfr TH1  = 0x8D; sfr IE   = 0xA8; sfr IP   = 0xB8; sfr SCON = 0x98; sfr SBUF = 0x99;     sbit CY   = 0xD7; sbit AC   = 0xD6; sbit F0   = 0xD5; sbit RS1  = 0xD4; sbit RS0  = 0xD3; sbit OV   = 0xD2; sbit P    = 0xD0;   sbit TF1  = 0x8F; sbit TR1  = 0x8E; sbit TF0  = 0x8D; sbit TR0  = 0x8C; sbit IE1  = 0x8B; sbit IT1  = 0x8A; sbit IE0  = 0x89; sbit IT0  = 0x88;   sbit EA   = 0xAF; sbit ES   = 0xAC; sbit ET1  = 0xAB; sbit EX1  = 0xAA; sbit ET0  = 0xA9; sbit EX0  = 0xA8;   sbit PS   = 0xBC; sbit PT1  = 0xBB; sbit PX1  = 0xBA; sbit PT0  = 0xB9; sbit PX0  = 0xB8;   sbit RD   = 0xB7; sbit WR   = 0xB6; sbit T1   = 0xB5; sbit T0   = 0xB4; sbit INT1 = 0xB3; sbit INT0 = 0xB2; sbit TXD  = 0xB1; sbit RXD  = 0xB0;   sbit SM0  = 0x9F; sbit SM1  = 0x9E; sbit SM2  = 0x9D; sbit REN  = 0x9C; sbit TB8  = 0x9B; sbit RB8  = 0x9A; sbit TI   = 0x99; sbit RI   = 0x98;  #line 1 "common.h" /0   #line 1 "C:\KEIL\C51\INC\ABSACC.H" /0                 #line 24 "C:\KEIL\C51\INC\ABSACC.H" /1         #line 29 "C:\KEIL\C51\INC\ABSACC.H" /0       #line 2 "common.h" /0                  typedef unsigned char       UINT8; typedef unsigned short      UINT16; typedef unsigned long       UINT32;  typedef union { struct  { UINT8    Type; UINT8    Index; } Descriptor;  struct  { UINT8 tx0;    UINT8 tx1;    UINT8 endp;    UINT8 c0;     } chars;  struct  { UINT8 c3;    UINT8 c2;    UINT8 c1;    UINT8 c0;     } chars0;  struct { UINT16 i1;      UINT16 i0;      } ints;  UINT32 u0;  } FLEXI_INT32;  typedef union  { struct  { UINT8 c1;     UINT8 c0;     } chars;  UINT16 i0; } FLEXI_INT16, *pFLEXI_INT16;  typedef struct _XXG_FLAGS { unsigned char bTimer        :1; unsigned char bIN_ISR		:1; unsigned char bCOM_ERR		:1; unsigned char bTimeout		:1; unsigned char bData1		:1; unsigned char bUartInDone	:1; unsigned char bMassDevice	:1; unsigned char bToggle       :1;  unsigned char SLAVE_IS_ATTACHED	:1; unsigned char SLAVE_REMOVED	:1; unsigned char SLAVE_FOUND	:1;	  unsigned char SLAVE_ENUMERATED	:1;	  unsigned char SLAVE_ONLINE	:1; unsigned char SLAVE_STALLED     :1; unsigned char TIMEOUT_ERR	:1; 	  unsigned char DATA_STOP		:1;	  } XXGFLAGS;  typedef struct { unsigned int sector; unsigned char offset; } DIR_IDX, *pDIR_IDX;                                    sfr P4 = 0xA1;  sfr P0_DDR = 0xA2; sfr P1_DDR = 0xA3; sfr P2_DDR = 0xA4; sfr P3_DDR = 0xA5; sfr P4_DDR = 0xA6;  sfr P_PU = 0xA7; sfr P_PD = 0xA9;  sfr WDT = 0xAA;  sfr SPI_DATA= 0x91; sfr SPI_CTL0= 0x92; sfr SPI_CTL1= 0x93; sfr SPI_STA0= 0x94;  sfr SD_CTL0= 0x95; sfr SD_STA0= 0x96; sfr SD_STA1= 0x97;                                                      #line 205 "common.h" /1     #line 208 "common.h" /0      unsigned short WordSwap(unsigned short input); void DelayMs(unsigned int nFactor); void DelayUs(unsigned char nFactor); unsigned long SwapINT32(unsigned long dData); unsigned char SendUart(unsigned char *pUsrBuf, unsigned int num);   #line 1 "test.c" /0   #line 1 "usb.h" /0  #line 1 "C:\KEIL\C51\INC\ABSACC.H" /0   #line 10 "C:\KEIL\C51\INC\ABSACC.H" /1                                           #line 1 "usb.h" /0#line 1 "usb.h" /0            typedef struct {  unsigned short  wVID, wPID;          unsigned char  bClass;              unsigned char  bNumOfEPs;           unsigned char  iMfg;				   unsigned char  iPdt;				   unsigned char  bId1;  unsigned char  bId2;  unsigned char  bEPAddr[0x05];      unsigned char  bAttr[0x05];        unsigned short  wPayLoad[0x05];     unsigned short  bInterval[0x05];    unsigned char  bData1[0x05];      } USBDEV, *pUSBDEV;   typedef struct {  unsigned char bmRequest;  unsigned char bRequest;  unsigned short wValue;  unsigned short wIndex;  unsigned short wLength; } SetupPKG, *pSetupPKG;  typedef struct { unsigned char usbaddr;  unsigned char pid; unsigned char wPayload; unsigned int  wLen; unsigned char *buffer;	 SetupPKG setup; unsigned char epbulkin; unsigned char epbulkout;  } XXGPKG, *pXXGPKG;   typedef struct	             {   unsigned char bLength;		      unsigned char bDescriptorType;     unsigned short bcdUSB;		      unsigned char bDeviceClass;        unsigned char bDeviceSubClass;  unsigned char bDeviceProtocol;  unsigned char bMaxPacketSize0;     unsigned short idVendor;		     unsigned short idProduct;  unsigned short bcdDevice;		      unsigned char iManufacturer;	      unsigned char iProduct;		      unsigned char iSerialNumber;	      unsigned char bNumConfigurations;     } sDevDesc, *pDevDesc;  typedef struct {	  unsigned char bLength;                   unsigned char bType;					    unsigned short wLength;                   unsigned char bNumIntf;				    unsigned char bCV;             		    unsigned char bIndex;          		    unsigned char bAttr;                     unsigned char bMaxPower;				   } sCfgDesc, *pCfgDesc;   typedef struct {	unsigned char bLength;	      unsigned char bType;		        unsigned char iNum;		        unsigned char iAltString;	    unsigned char bEndPoints;	    unsigned char iClass;		    unsigned char iSub; 		        unsigned char iProto;		    unsigned char iIndex; 		   } sIntfDesc, *pIntfDesc;   typedef struct {	unsigned char bLength;  unsigned char bType;		        unsigned char bEPAdd;		    unsigned char bAttr;		        unsigned short wPayLoad;          unsigned char bInterval;	       } sEPDesc, *pEPDesc;                                                  void usbBufRead(unsigned char *s, unsigned char c); void usbBufWrite(unsigned char *s, unsigned char c); void usbReset(void); unsigned char usbXfer(unsigned char endPoint); unsigned char ep0Xfer(void); unsigned char epBulkSend(unsigned char *pBuffer,unsigned int len); unsigned char epBulkRcv(unsigned char *pBuffer,unsigned int len); unsigned char setAddress(unsigned char addr); unsigned char setConfiguration(void); unsigned char setDesc(void); unsigned char enumUsbDev(unsigned char usbaddr); void usbInit(void); void checkKeyLED(void); #line 2 "test.c" /0   #line 1 "sd.h" /0            typedef struct _CSD_BLOCK { unsigned char CSD_Struct:2; unsigned char CSD_StructResv:6; unsigned char CSD_RdAcsTime; unsigned char CSD_RdAcsCycl; unsigned char CSD_XferSpeed; unsigned int  CSD_CCC:12; unsigned int  CSD_RdBlkLen:4; unsigned int  CSD_RdBlkPartial:1; unsigned int  CSD_WrBlkMisAlign:1; unsigned int  CSD_RdBlkMisAlign:1; unsigned int  CSD_DSRImp:1; unsigned int  CSD_DevResv:2; unsigned int  CSD_DevSize:12; unsigned int  CSD_MaxRdCurVmin:3; unsigned int  CSD_MaxRdCurVmax:3; unsigned int  CSD_MaxWrCurVmin:3; unsigned int  CSD_MaxWrCurVmax:3; unsigned int  CSD_DevSizeMult:3; unsigned int  CSD_ErsSingBlk:1; unsigned int  CSD_ErsSectSize:7; unsigned int  CSD_WrProtGrpSize:7; unsigned char CSD_WrFmtGrpEn:1; unsigned char CSD_MMCResv:2; unsigned char CSD_WrSpeedFactor:3; unsigned char CSD_MaxWrLen:4; unsigned char CSD_PartBlkWr:1; unsigned char CSD_FileResv:5; unsigned char CSD_FileFmtGrp:1; unsigned char CSD_CopyFlag:1; unsigned char CSD_PermWrProt:1; unsigned char CSD_TempWrProt:1; unsigned char CSD_FileFmt:2; unsigned char CSD_Resv:2; unsigned char CSD_CRC:7; unsigned char CSD_EOB:1; } CSD_BLOCK, *pCSD_BLOCK;                   unsigned char GetDevInfo(void);  unsigned char SDCommand(unsigned char command, unsigned char *pAddr);  unsigned char SDReadSector(unsigned long sector);  unsigned char SDReadFat(unsigned long sector);  unsigned char SDReadRdir(unsigned long sector);  unsigned char SDWriteSector(unsigned long sector, unsigned char *pUsrBuf);  unsigned char SDIdentify(void);  unsigned char SDResp(unsigned char respLen);  unsigned char SDMp3Read(unsigned long sector);  unsigned char UartWaitCmd();  #line 3 "test.c" /0   #line 1 "tpbulk.h" /0  #line 1 "rbccmd.h" /0                           typedef struct _READ_10 { UINT8 OperationCode; UINT8 Reserved1; UINT8 LBA_3; UINT8 LBA_2; UINT8 LBA_1; UINT8 LBA_0; UINT8 Reserved2; UINT8 XferLen_1; UINT8 XferLen_0; UINT8 Reserved3[3]; } READ_10, *pREAD_10;  typedef struct _WRITE_10 { UINT8 OperationCode; UINT8 Reserved1; UINT8 LBA_3; UINT8 LBA_2; UINT8 LBA_1; UINT8 LBA_0; UINT8 Reserved2; UINT8 XferLen_1; UINT8 XferLen_0; UINT8 Reserved3[3]; } WRITE_10, *pWRITE_10;  typedef struct _MODE_SENSE_10 { UINT8 OperationCode; UINT8 Reserved1; UINT8 PageCode : 6; UINT8 Pc : 2; UINT8 Reserved2[4]; UINT8 ParameterListLengthMsb; UINT8 ParameterListLengthLsb; UINT8 Reserved3[3]; } MODE_SENSE_10, *pMODE_SENSE_10;  typedef struct _MODE_SELECT_10 { UINT8 OperationCode; UINT8 Reserved1 : 4; UINT8 PFBit : 1; UINT8 Reserved2 : 3; UINT8 Reserved3[5]; UINT8 ParameterListLengthMsb; UINT8 ParameterListLengthLsb; UINT8 Reserved4[3]; } MODE_SELECT_10, *pMODE_SELECT_10;    typedef struct _GENERIC_CDB { UINT8 OperationCode; UINT8 Reserved[15]; } GENERIC_CDB,*pGENERIC_CDB;  typedef struct _GENERIC_RBC { UINT8 OperationCode; UINT8 Reserved[8]; UINT8 Control; } GENERIC_RBC,*pGENERIC_RBC;   typedef struct _FORMAT_RBC { UINT8 OperationCode;	  UINT8 VendorSpecific; UINT8 Increment : 1; UINT8 PercentorTime : 1; UINT8 Progress : 1; UINT8 Immediate : 1; UINT8 VendorSpecific1 : 4; UINT8 Reserved2[2]; UINT8 Control; } FORMAT_RBC, *pFORMAT_RBC;    typedef struct _READ_RBC { UINT8 OperationCode;	  UINT8 VendorSpecific; union{ struct { UINT8 LBA_3; UINT8 LBA_2; UINT8 LBA_1; UINT8 LBA_0; } LBA_W8 ;  UINT32 LBA_W32; }LBA; UINT8 Reserved;   UINT16 XferLength; UINT8 Control;  } READ_RBC, *pREAD_RBC;    typedef struct _READ_CAPACITY_DATA {  UINT8 LBA_3; UINT8 LBA_2; UINT8 LBA_1; UINT8 LBA_0;  UINT8 BlockLen_3; UINT8 BlockLen_2; UINT8 BlockLen_1; UINT8 BlockLen_0; } READ_CAPACITY_DATA, *pREAD_CAPACITY_DATA;  typedef struct _READ_LONG_CMD{ UINT8 OperationCode; UINT8 LogicalUnitNum	:3; UINT8 RES_1		:5; UINT8 RES_2; UINT8 RES_3; UINT8 RES_4; UINT8 RES_5; UINT8 RES_6; UINT16 AllocationLen; UINT8 RES_7; UINT8 RES_8; UINT8 RES_9; }READ_LONG_CMD, *pREAD_LONG_CMD;  typedef struct _READ_LONG {  UINT8 RES_1; UINT8 RES_2; UINT8 RES_3; UINT8 CAP_LIST_LEN;  UINT8 LBA_3; UINT8 LBA_2; UINT8 LBA_1; UINT8 LBA_0;  UINT8 Descripter; UINT8 BlockLen_2; UINT8 BlockLen_1; UINT8 BlockLen_0; } READ_LONG, *pREAD_LONG;  typedef struct _READ_CAPACITY_RBC { UINT8                OperationCode;	  union  { FLEXI_INT32			l0[2];

⌨️ 快捷键说明

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