📄 63x0x.inc
字号:
;;******************************************************************************
;; C7C63x0x.h - Cypress Semiconductor Cy7C63x0x micrprocessor definitions
;; Copyright (c) Slade Systems, Inc, 1997
;;
;; Cypress Semiconductor Corp.
;; 12032 113th Ave NE, Kirkland, WA 98034
;; 206-821-9202 - 206-820-8959(f)
;;
;;******************************************************************************
;*******************************************************************************
;
; M8 - 8bit microprocessor
; registers: accumulator 'acc'
; index 'x'
; stack pointer 'dsp'
; program SP 'psp'
; program counter 'pc' 16 bits (14 bit addressing)
; PC low 'pcl'
; PC high 'pch'
; When PC is pushed on stack
; carry flag is stored in bit 14
; zero flag is stored in bit 15
;
; Program ROM 4096 bytes in 256 byte pages
; Program RAM 128 bytes
; Processor PORTs contain 16k-ohm resistor (pull-up and slew control)
;
; After reset:
; Port 0 and Port 1 are set high
;
;
;*******************************************************************************
;*************************************************
;
; I/O ports defined
SysPort0 :equ 00h ; GPIO data port 0 (P00-P07)
SysPort1 :equ 01h ; GPIO data port 1 (P10-P13)
SysPort0IntEnable :equ 04h ; Port0 Interrupt Enable
SysPort1IntEnable :equ 05h ; Port1 Interrupt Enable
SysPort0PullUp :equ 08h ; Port0 PullUp Resistor Enable (0=active)
SysPort1PullUp :equ 09h ; Port1 PullUp Resistor Enable (0=active)
; General
SysStatus :equ FFh ;
SysStatusRun :equ 01h ;
SysStatusReserved2 :equ 02h ; nul
SysStatusReserved3 :equ 04h ; nul
SysStatusSuspend :equ 08h ; write only (restart =256us)
SysStatusPowerOn :equ 10h ;
SysStatusUSBReset :equ 20h ;
SysStatusWDReset :equ 40h ;
SysStatusReserved7 :equ 80h ; nul
SysWatchDog :equ 21h ; WatchDog controller
SysTimerExternal :equ 22h ; Timer also ???
SysTimer :equ 23h ; Timer (read only) {6MHZ=1us resolution}
SysInterrupt :equ 20h ; Global interrupt
SysIntReserved0 :equ 01h ;
SysIntTimer128us :equ 02h ;
SysIntTimer1024us :equ 04h ;
SysIntUSBEndP0 :equ 08h ;
SysIntUSBEndP1 :equ 10h ;
SysIntReserved5 :equ 20h ;
SysIntGPIO :equ 40h ;
SysIntWakeUp :equ 80h ;
; Ouput ISink ???
SysPort0ISinkPin0 :equ 30h ;
SysPort0ISinkPin1 :equ 31h ;
SysPort0ISinkPin2 :equ 32h ;
SysPort0ISinkPin3 :equ 33h ;
SysPort0ISinkPin4 :equ 34h ;
SysPort0ISinkPin5 :equ 35h ;
SysPort0ISinkPin6 :equ 36h ;
SysPort0ISinkPin7 :equ 37h ;
SysPort1ISinkPin0 :equ 38h ;
SysPort1ISinkPin1 :equ 39h ;
SysPort1ISinkPin2 :equ 3Ah ;
SysPort1ISinkPin3 :equ 3Bh ;
; USB FIFOs
USBEndP0FIFO :equ 70h
USBEndP0FIFO_0 :equ 70h ; Will contain CRC if (rx count <8)
USBEndP0FIFO_1 :equ 71h
USBEndP0FIFO_2 :equ 72h
USBEndP0FIFO_3 :equ 73h
USBEndP0FIFO_4 :equ 74h
USBEndP0FIFO_5 :equ 75h
USBEndP0FIFO_6 :equ 76h
USBEndP0FIFO_7 :equ 77h
;
USBEndP1FIFO :equ 78h
USBEndP1FIFO_0 :equ 78h
USBEndP1FIFO_1 :equ 79h
USBEndP1FIFO_2 :equ 7Ah
USBEndP1FIFO_3 :equ 7Bh
USBEndP1FIFO_4 :equ 7Ch
USBEndP1FIFO_5 :equ 7Dh
USBEndP1FIFO_6 :equ 7Eh
USBEndP1FIFO_7 :equ 7Fh
;*************************************************
;
USBDeviceAddress :equ 12h ; Assigned device address
; USB port control
USBControl :equ 13h ; Status/Control register
USBControlBusActive :equ 01h ; 1=active, write 0 and watch if bus dies
USBControlResume :equ 02h ; set transmitter to k state sending resume to host ???
USBControlReserve2 :equ 04h
USBControlAckStatusData :equ 08h ; Auto ACK Data1 SETUP OUT data packets
USBControlAckOutData :equ 10h ; Auto ACK Data1 OUT data packets
USBControlReserve5 :equ 20h
USBControlReserve6 :equ 40h
USBControlReserve7 :equ 80h
USBEndP0RxStatus :equ 14h ; Port0 receive status
USBEndP0RxSetup :equ 01h ; 1=setup token received (must be cleared to write FIFOs ???)
USBEndP0RxOut :equ 02h ; 1=out token received
USBEndP0RxIn :equ 04h ; 1=in token received
USBEndP0RxDataFlag :equ 08h
USBEndP0RxCount0 :equ 10h ; size =count -2 (two bytes of CRC)
USBEndP0RxCount1 :equ 20h
USBEndP0RxCount2 :equ 40h
USBEndP0RxCount3 :equ 80h
USBEndP0TxConfig :equ 10h ; Transmit configuration
USBEndP0TxCount0 :equ 01h
USBEndP0TxCount1 :equ 02h
USBEndP0TxCount2 :equ 04h
USBEndP0TxCount3 :equ 08h
USBEndP0TxRxErr :equ 10h ; read and write
USBEndP0TxStall :equ 20h ;
USBEndP0TxSequence :equ 40h ;
USBEndP0TxRespond :equ 80h ;
USBEndP1TxConfig :equ 11h ;
USBEndP1TxCount0 :equ 01h
USBEndP1TxCount1 :equ 02h
USBEndP1TxCount2 :equ 04h
USBEndP1TxCount3 :equ 08h
USBEndP1TxEnable :equ 10h ;
USBEndP1TxStall :equ 20h ;
USBEndP1TxSequence :equ 40h ;
USBEndP1TxRespond :equ 80h
;*************************************************
; USB Protocol
;union USBRqst
;{ struct
; { BYTE bReceipient :5; // 0=Device,1=Interface,2=Endpoint,3=Other,4..31=Reserved
; BYTE bType :2; // 1=Standard,1=Class,2=Vendor,3=Reserved
; BYTE bDirection :1; // 0=Host to Device,1=Device to Host
; BYTE bRqst; //
; // 0x00,0x01,0x02 =Clear Feature
; // 0x00,0x01,0x02 =Set Feature
; // 0x80,0x81,0x82 =Get Status
; // 0x00 =Set Address
; // 0x80 =Get Descriptor
; // 0x00 =Set Descriptor
; // 0x80 =Get Configuration
; // 0x81 =Get Interface
; // 0x01 =Set Interface
; // 0x82 =Synch Frame
; WORD wValue; //
; WORD wIndex; //
; WORD wLength; //
; }
;}
;*************************************************
; USB Protocol
USBRqstType :equ USBEndP0FIFO_0 ;
USBRqstTypeDirection :equ 80h ; 1=Device to Host,0=Host to Device
USBRqstTypeMask :equ 60h
USBRqstTypeStandard :equ 00h
USBRqstTypeClass :equ 20h
USBRqstTypeVendor :equ 40h
USBRqstTypeReserved :equ 60h
USBRqstTargetDevice :equ 00h
USBRqstTargetInterface :equ 01h
USBRqstTargetEndPoint :equ 02h
USBRqstTargetOther :equ 03h
USBRqstMessage :equ USBEndP0FIFO_1 ;
USBRqstGetStatus :equ 00h ; bit field: 0x01 =Self powered,0x02 =Remote wakeup
USBRqstClearFeature :equ 01h
USBRqstReserved02 :equ 02h
USBRqstSetFeature :equ 03h
USBRqstReserved04 :equ 04h
USBRqstSetAddress :equ 05h
USBRqstGetDescriptor :equ 06h
USBRqstSetDescriptor :equ 07h
USBRqstGetConfiguration :equ 08h
USBRqstSetConfiguration :equ 09h
USBRqstGetInterface :equ 0Ah
USBRqstSetInterface :equ 0Bh
USBRqstSynchFrame :equ 0Ch
USBRqstReserved0D :equ 0Dh
USBRqstWordValueLo :equ USBEndP0FIFO_2 ;
USBRqstWordValueHi :equ USBEndP0FIFO_3 ;
;*************************************************
;
USBDescriptorTypeDevice :equ 01h
USBDescriptorTypeConfig :equ 02h
USBDescriptorTypeString :equ 03h
USBDescriptorTypeInterface :equ 04h
USBDescriptorTypeEndPoint :equ 05h
USBDescriptorTypeReserved06 :equ 06h
;*************************************************
;
USBRawProtocolSetup :equ B4h
USBRawProtocolIn :equ 96h
USBRawProtocolOut :equ 87h
USBRawProtocolPort0 :equ C3h
USBRawProtocolPort1 :equ D2h
USBRawProtocolACK :equ 4Bh
USBRawProtocolNAK :equ 5Ah
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -