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

📄 kisr.lst

📁 飞利浦D12的AT89C52固件
💻 LST
📖 第 1 页 / 共 5 页
字号:
 191      =2  #define T2OE_   0x02    /* Timer 2 output enable */
 192      =2  
 193      =2  /*------------------------------------------------
 194      =2  PSW Bit Registers
 195      =2  ------------------------------------------------*/
 196      =2  sbit P    = 0xD0;
 197      =2  sbit FL   = 0xD1;
 198      =2  sbit OV   = 0xD2;
 199      =2  sbit RS0  = 0xD3;
 200      =2  sbit RS1  = 0xD4;
 201      =2  sbit F0   = 0xD5;
 202      =2  sbit AC   = 0xD6;
 203      =2  sbit CY   = 0xD7;
 204      =2  
 205      =2  /*------------------------------------------------
 206      =2  Interrupt Vectors:
 207      =2  Interrupt Address = (Number * 8) + 3
 208      =2  ------------------------------------------------*/
 209      =2  #define IE0_VECTOR	0  /* 0x03 External Interrupt 0 */
 210      =2  #define TF0_VECTOR	1  /* 0x0B Timer 0 */
 211      =2  #define IE1_VECTOR	2  /* 0x13 External Interrupt 1 */
C51 COMPILER V6.20c  KISR                                                                  10/31/2002 21:55:46 PAGE 6   

 212      =2  #define TF1_VECTOR	3  /* 0x1B Timer 1 */
 213      =2  #define SIO_VECTOR	4  /* 0x23 Serial port */
 214      =2  
 215      =2  #define TF2_VECTOR	5  /* 0x2B Timer 2 */
 216      =2  #define EX2_VECTOR	5  /* 0x2B External Interrupt 2 */
 217      =2  
 218      =2  /*------------------------------------------------
 219      =2  ------------------------------------------------*/
 220      =2  #endif
 221      =2  
 222      =2  
   2      =1  	
   3      =1  #define EPP_PORT  P1
   4      =1  #define DATA_BUS  P0
   5      =1  
   6      =1  sbit MCU_SWM0     = P1^0;
   7      =1  sbit MCU_SWM1     = P1^1;
   8      =1  sbit MCU_LED0	  = P1^2;
   9      =1  sbit MCU_LED1	  = P1^3;
  10      =1  
  11      =1  sbit MCU_D12CS	  = P1^6;
  12      =1  sbit MCU_D12RST   = P1^7;
  13      =1  
  14      =1  sbit D12SUSPD	  = P3^3;
  15      =1  
  16      =1  #define DISABLE		EA=0
  17      =1  #define ENABLE		EA=1
  18      =1  
   6          #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
C51 COMPILER V6.20c  KISR                                                                  10/31/2002 21:55:46 PAGE 7   

  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);
  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  
   7          #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
C51 COMPILER V6.20c  KISR                                                                  10/31/2002 21:55:46 PAGE 8   

  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
  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;
C51 COMPILER V6.20c  KISR                                                                  10/31/2002 21:55:46 PAGE 9   

  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;
 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
C51 COMPILER V6.20c  KISR                                                                  10/31/2002 21:55:46 PAGE 10  

 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  
   8          #include "kUSB100.h"
   1      =1  #include "kprotodma.h"
   1      =2  void read_write_register(void);
   2      =1  #define MAXIMUM_USB_STRING_LENGTH 255
   3      =1  

⌨️ 快捷键说明

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