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

📄 kd12ci.lst

📁 飞利浦D12的AT89C52固件
💻 LST
📖 第 1 页 / 共 5 页
字号:
C51 COMPILER V6.20c  KD12CI                                                                10/31/2002 21:55:45 PAGE 1   


C51 COMPILER V6.20c, COMPILATION OF MODULE KD12CI
OBJECT MODULE PLACED IN kd12ci.OBJ
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE kd12ci.c REGFILE(.\xugy.ORC) BROWSE ORDER DEBUG OBJECTEXTEND CODE LISTINCLU
                    -DE SYMBOLS

stmt level    source

   1          #include "kd12ci.h"
   1      =1  #define D12_NOLAZYCLOCK			0x02
   2      =1  #define D12_CLOCKRUNNING  	        0x04
   3      =1  #define D12_INTERRUPTMODE		0x08
   4      =1  #define D12_SOFTCONNECT			0x10
   5      =1  #define D12_ENDP_NONISO			0x00
   6      =1  #define D12_ENDP_ISOOUT			0x40
   7      =1  #define D12_ENDP_ISOIN			0x80
   8      =1  #define D12_ENDP_ISOIO			0xC0
   9      =1  
  10      =1  #define D12_CLOCK_12M			0x03
  11      =1  #define D12_CLOCK_4M			0x0b
  12      =1  #define D12_SETTOONE   		        0x40
  13      =1  #define D12_SOFONLY			0x80
  14      =1  
  15      =1  #define D12_DMASINGLE			0x00
  16      =1  #define D12_BURST_4			0x01
  17      =1  #define D12_BURST_8			0x02
  18      =1  #define D12_BURST_16			0x03
  19      =1  #define D12_DMAENABLE     	        0x04
  20      =1  #define D12_DMA_INTOKEN			0x08
  21      =1  #define D12_AUTOLOAD			0x10
  22      =1  
  23      =1  //==============================================
  24      =1  #define D12_NORMALPLUSSOF		0x20
  25      =1  #define D12_ENDP4INTENABLE		0x40
  26      =1  #define D12_ENDP5INTENABLE		0x80	// bug fixed in V2.1
  27      =1  
  28      =1  #define D12_INT_ENDP0OUT		0x01
  29      =1  #define D12_INT_ENDP0IN			0x02
  30      =1  #define D12_INT_ENDP1OUT		0x04
  31      =1  #define D12_INT_ENDP1IN			0x08
  32      =1  #define D12_INT_ENDP2OUT		0x10
  33      =1  #define D12_INT_ENDP2IN			0x20
  34      =1  #define D12_INT_BUSRESET		0x40
  35      =1  #define D12_INT_SUSPENDCHANGE		0x80
  36      =1  #define D12_INT_EOT			0x0100
  37      =1  
  38      =1  #define D12_SETUPPACKET			0x20
  39      =1  
  40      =1  #define D12_BUFFER0FULL			0x20
  41      =1  #define D12_BUFFER1FULL			0x40
  42      =1  
  43      =1  #define D12_FULLEMPTY			0x01
  44      =1  #define D12_STALL			0x02
  45      =1  
  46      =1  
  47      =1  //#define D12_COMMAND			XBYTE[0xFF03]
  48      =1  //#define D12_DATA			XBYTE[0xFF02]
  49      =1  #define D12_COMMAND			0x0ff03
  50      =1  #define D12_DATA			0x0ff02
  51      =1  
  52      =1  //-----------------------------------------------------
  53      =1  void D12_SetEndpointEnable(unsigned char bEnable);
C51 COMPILER V6.20c  KD12CI                                                                10/31/2002 21:55:45 PAGE 2   

  54      =1  void D12_SetAddressEnable(unsigned char bAddress, unsigned char bEnable);void D12_SetAddressEnable(unsigne
             -d char bAddress, unsigned char bEnable);void D12_SetAddressEnable(unsigned char bAddress, unsigned char bEnable);
  55      =1  void D12_SetMode(unsigned char bConfig, unsigned char bClkDiv);
  56      =1  void D12_SetDMA(unsigned char bMode);
  57      =1  unsigned char D12_GetDMA(void);
  58      =1  unsigned short D12_ReadInterruptRegister(void);
  59      =1  unsigned char D12_SelectEndpoint(unsigned char bEndp);
  60      =1  unsigned char D12_ReadLastTransactionStatus(unsigned char bEndp);
  61      =1  unsigned char D12_ReadEndpointStatus(unsigned char bEndp);
  62      =1  void D12_SetEndpointStatus(unsigned char bEndp, unsigned char bStalled);
  63      =1  void D12_SendResume(void);
  64      =1  
  65      =1  unsigned char D12_ReadEndpoint(unsigned char endp, unsigned char len, unsigned char * buf);
  66      =1  unsigned char D12_WriteEndpoint(unsigned char endp, unsigned char len, unsigned char * buf);
  67      =1  void D12_AcknowledgeEndpoint(unsigned char endp);
  68      =1  
  69      =1  
  70      =1  
   2          #include "kmain.h"
   1      =1  /*
   2      =1     //*************************************************************************
   3      =1     // basic #defines
   4      =1     //*************************************************************************
   5      =1     */
   6      =1  #define MAX_ENDPOINTS      (unsigned char)0x3
   7      =1  
   8      =1  //#define EP0_TX_FIFO_SIZE   16
   9      =1  //#define EP0_RX_FIFO_SIZE   16
  10      =1  #define EP0_PACKET_SIZE    16
  11      =1  
  12      =1  //#define EP1_TX_FIFO_SIZE   4
  13      =1  //#define EP1_RX_FIFO_SIZE   4
  14      =1  #define EP1_PACKET_SIZE    4
  15      =1  
  16      =1  //#define EP2_TX_FIFO_SIZE   64
  17      =1  //#define EP2_RX_FIFO_SIZE   64
  18      =1  #define EP2_PACKET_SIZE    64
  19      =1  
  20      =1  
  21      =1  #define USB_IDLE           0
  22      =1  #define USB_TRANSMIT       1
  23      =1  #define USB_RECEIVE        2
  24      =1  
  25      =1  #define USB_CLASS_CODE_TEST_CLASS_DEVICE                    0xdc
  26      =1  #define USB_SUBCLASS_CODE_TEST_CLASS_D12                    0xA0
  27      =1  #define USB_PROTOCOL_CODE_TEST_CLASS_D12                    0xB0
  28      =1  
  29      =1  /*
  30      =1     //*************************************************************************
  31      =1     // masks
  32      =1     //*************************************************************************
  33      =1  */
  34      =1  
  35      =1  #define USB_RECIPIENT            (unsigned char)0x1F
  36      =1  #define USB_RECIPIENT_DEVICE     (unsigned char)0x00
  37      =1  #define USB_RECIPIENT_INTERFACE  (unsigned char)0x01
  38      =1  #define USB_RECIPIENT_ENDPOINT   (unsigned char)0x02
  39      =1  
  40      =1  #define USB_REQUEST_TYPE_MASK    (unsigned char)0x60
  41      =1  #define USB_STANDARD_REQUEST     (unsigned char)0x00
  42      =1  //#define USB_CLASS_REQUEST        (unsigned char)0x20
  43      =1  #define USB_VENDOR_REQUEST       (unsigned char)0x40
C51 COMPILER V6.20c  KD12CI                                                                10/31/2002 21:55:45 PAGE 3   

  44      =1  
  45      =1  #define USB_REQUEST_MASK         (unsigned char)0x0F
  46      =1  
  47      =1  #define DEVICE_ADDRESS_MASK      0x7F
  48      =1  
  49      =1  /*
  50      =1     //*************************************************************************
  51      =1     // macros
  52      =1     //*************************************************************************
  53      =1  */
  54      =1  #define SWAP(x)   ((((x) & 0xFF) << 8) | (((x) >> 8) & 0xFF))
  55      =1  
  56      =1  #define MSB(x)    (((x) >> 8) & 0xFF)
  57      =1  #define LSB(x)    ((x) & 0xFF)
  58      =1  
  59      =1  #define FALSE   0
  60      =1  #define TRUE    (!FALSE)
  61      =1  
  62      =1  /*
  63      =1     //*************************************************************************
  64      =1     // basic typedefs
  65      =1     //*************************************************************************
  66      =1  */
  67      =1  typedef unsigned char   UCHAR;
  68      =1  typedef unsigned short  USHORT;
  69      =1  typedef unsigned long   ULONG;
  70      =1  typedef unsigned char   BOOL;
  71      =1  
  72      =1  /*
  73      =1     //*************************************************************************
  74      =1     // structure and union definitions
  75      =1     //*************************************************************************
  76      =1  */
  77      =1  typedef union _epp_flags
  78      =1  {
  79      =1  	struct _flags
  80      =1  	{
  81      =1  		unsigned char timer               	: 1;
  82      =1  		unsigned char bus_reset           	: 1;
  83      =1  		unsigned char suspend             	: 1;
  84      =1  		unsigned char setup_packet  	  	: 1;
  85      =1  		unsigned char remote_wakeup		   	: 1;
  86      =1  		unsigned char in_isr		      	: 1;
  87      =1  		unsigned char control_state			: 2;
  88      =1  
  89      =1  		unsigned char configuration			: 1;
  90      =1  		unsigned char verbose				: 1;
  91      =1  		unsigned char ep1_rxdone			: 1;
  92      =1  		unsigned char setup_dma				: 2; // V2.3
  93      =1  		unsigned char dma_state      		: 2;
  94      =1  		unsigned char power_down			: 1; // Smart Board
  95      =1  	} bits;
  96      =1  	unsigned short value;
  97      =1  } EPPFLAGS;
  98      =1  
  99      =1  typedef struct _device_request
 100      =1  {
 101      =1  	unsigned char bmRequestType;
 102      =1  	unsigned char bRequest;
 103      =1  	unsigned short wValue;
 104      =1  	unsigned short wIndex;
 105      =1  	unsigned short wLength;
C51 COMPILER V6.20c  KD12CI                                                                10/31/2002 21:55:45 PAGE 4   

 106      =1  } DEVICE_REQUEST;
 107      =1  
 108      =1  typedef struct _IO_REQUEST {
 109      =1  	unsigned short	uAddressL;
 110      =1  	unsigned char	bAddressH;
 111      =1  	unsigned short	uSize;
 112      =1  	unsigned char	bCommand;
 113      =1  } IO_REQUEST, *PIO_REQUEST;
 114      =1  
 115      =1  #define MAX_CONTROLDATA_SIZE	8
 116      =1  
 117      =1  typedef struct _control_xfer
 118      =1  {
 119      =1  	DEVICE_REQUEST DeviceRequest;
 120      =1  	unsigned short wLength;
 121      =1  	unsigned short wCount;
 122      =1  	unsigned char * pData;
 123      =1  	unsigned char dataBuffer[MAX_CONTROLDATA_SIZE];
 124      =1  } CONTROL_XFER;
 125      =1  
 126      =1  /*
 127      =1     //*************************************************************************
 128      =1     // USB utility functions
 129      =1     //*************************************************************************
 130      =1  */
 131      =1  //extern void D12_SetMode(unsigned char bConfig, unsigned char bClkDiv);
 132      =1  //extern void D12_SetDMA(unsigned char bMode);
 133      =1  //extern unsigned char D12_GetDMA(void);
 134      =1  //extern unsigned char D12_ReadEndpointStatus(unsigned char bEndp);
 135      =1  //extern void D12_SetEndpointStatus(unsigned char bEndp, unsigned char bStalled);
 136      =1  //extern void single_transmit(unsigned char * pData, unsigned char len);
 137      =1  //extern void stall_ep0(void);
 138      =1  //void D12_SendResume(void);
 139      =1  
 140      =1  //#define IN_TOKEN_DMA 	1
 141      =1  //#define OUT_TOKEN_DMA 	0
 142      =1  
 143      =1  #define DMA_BUFFER_SIZE		256
 144      =1  
 145      =1  #define DMA_IDLE	0
 146      =1  #define DMA_RUNNING	1
 147      =1  #define DMA_PENDING	2
 148      =1  
 149      =1  #define SETUP_DMA_REQUEST 		0x0471
 150      =1  #define GET_FIRMWARE_VERSION    0x0472
 151      =1  //#define GET_SET_TWAIN_REQUEST   0x0473
 152      =1  #define GET_BUFFER_SIZE		    0x0474
 153      =1  /*
 154      =1  typedef struct _TWAIN_FILEINFO {
 155      =1  	unsigned char	bPage;    // bPage bit 7 - 5 map to uSize bit 18 - 16
 156      =1  	unsigned char	uSizeH;    // uSize bit 15 - 8
 157      =1  	unsigned char	uSizeL;    // uSize bit 7 - 0
 158      =1  } TWAIN_FILEINFO, *PTWAIN_FILEINFO;
 159      =1  */
 160      =1  
 161      =1  
 162      =1  
   3          #include "khal.h"
   1      =1  #include <At89x52.h>
   1      =2  /*--------------------------------------------------------------------------
   2      =2  AT89X52.H
   3      =2  
C51 COMPILER V6.20c  KD12CI                                                                10/31/2002 21:55:45 PAGE 5   

   4      =2  Header file for the low voltage Flash Atmel AT89C52 and AT89LV52.
   5      =2  Copyright (c) 1995-1996 Keil Software, Inc.  All rights reserved.
   6      =2  --------------------------------------------------------------------------*/
   7      =2  
   8      =2  #ifndef AT89X52_HEADER_FILE
   9      =2  #define AT89X52_HEADER_FILE 1
  10      =2  
  11      =2  /*------------------------------------------------
  12      =2  Byte Registers
  13      =2  ------------------------------------------------*/
  14      =2  sfr P0      = 0x80;
  15      =2  sfr SP      = 0x81;
  16      =2  sfr DPL     = 0x82;
  17      =2  sfr DPH     = 0x83;
  18      =2  sfr PCON    = 0x87;
  19      =2  sfr TCON    = 0x88;
  20      =2  sfr TMOD    = 0x89;
  21      =2  sfr TL0     = 0x8A;
  22      =2  sfr TL1     = 0x8B;
  23      =2  sfr TH0     = 0x8C;
  24      =2  sfr TH1     = 0x8D;
  25      =2  sfr P1      = 0x90;
  26      =2  sfr SCON    = 0x98;
  27      =2  sfr SBUF    = 0x99;
  28      =2  sfr P2      = 0xA0;
  29      =2  sfr IE      = 0xA8;
  30      =2  sfr P3      = 0xB0;
  31      =2  sfr IP      = 0xB8;

⌨️ 快捷键说明

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