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

📄 declare.a51

📁 演示了如何开发WINDOES下I/O口驱动
💻 A51
字号:
; This module declares the variables and constants used in the examples
; It is common to all of the examples
;
; Declare Special Function Registers used
TimerControl	DATA	088H
TimerMode	DATA	089H
Timer0High	DATA	08CH
EI		DATA	0A8H
EIE		DATA	0E8H	; EZ-USB specific
EXIF		DATA	091H	; EZ-USB specific
EICON		DATA	0D8H	; EZ-USB specific
PageReg		DATA	092H	; EZ-USB specific, used with MOVX @Ri
DPS		DATA	086H	; EZ-USB specific, used with dual data pointers
;
; "External" memory locations used, EZ-USB specific
; Note that most of these variables are in Page 7FH
SETUPDAT	EQU	07FE8H
SUDPTR		EQU	07FD4H
EP0Control	EQU	07FB4H
EP0InBuffer	EQU	07F00H
EP0OutBuffer	EQU	07EC0H		; Not in Page 7FH
EP1InBuffer	EQU	07E80H		; Not in Page 7FH
IN0ByteCount	EQU	07FB5H
Out0ByteCount	EQU	07FC5H
IN1ByteCount	EQU	07FB7H
IN07IEN		EQU	07FACH
IN07IRQ		EQU	07FA9H
OUT07IEN	EQU	07FADH
OUT07IRQ	EQU	07FAAH
USBIEN		EQU	07FAEH
USBIRQ		EQU	07FABH
USBControl	EQU	07FD6H
I2CData		EQU	07FA6H
I2CControl	EQU	07FA5H
PortA_Config	EQU	07F93H
PortB_Config	EQU	07F94H
PortC_Config	EQU	07F95H
PortA_OUT	EQU	07F96H
PortB_OUT	EQU	07F97H
PortC_OUT	EQU	07F98H
PortA_PINS	EQU	07F99H
PortB_PINS	EQU	07F9AH
PortC_PINS	EQU	07F9BH
PortA_OE	EQU	07F9CH
PortB_OE	EQU	07F9DH
PortC_OE	EQU	07F9EH
;
; Byte Variables
		
		DSEG	AT 20H
FLAGS:		DS 	1	; This register is bit-addressable
; Bit Variables
Configured	EQU	FLAGS.0	; Is this device configured
STALL		EQU	FLAGS.1	; Need to STALL endpoint 0
SendData	EQU	FLAGS.2 ; Need to send data to PC Host
IsDescriptor	EQU	FLAGS.3	; Enable a shortcut reply
;
MonitorSpace:	DS	1FH	; Used by Dscope
Temp:		DS	1	; A temporary working register
Idle_Time:	DS	1	; The time the PC host wants us to wait
Expired_Time:	DS	1	; A downcounter for timed Reports
ReplyBuffer:	DS	3	; First byte is Count
CurrentConfiguration:
		DS	1	; Some examples support > 1 configurations
;
; Declare the specific variables used by each of the examples
Overlay		EQU	$
Old_Buttons:	DS	1	; Used by BAL: stores current button position
LEDstrobe:	DS	1	; Used by BAL: strobe one LED on at a time
LEDvalue:	DS	1	; Used by BAL: stores current LED value
Msec_Counter:	DS	1	; Used by BAL: counts up to 4 msec

		ORG Overlay	; Overlay the variables (only one set in use at any one time)
I2CDataByte:	DS	1	; Used by I2C: keep a local copy of data read from I2C bus

		ORG Overlay
LightValues:	DS	6	; Used by LP: local buffer for light brightness
WorkingValues:	DS	6	; Used by LP: counted down each half cycle
Mask:		DS	1	; Used by LP: TurnON mask for Triacs
LastCycle	EQU	FLAGS.4	; Used by LP: Tracks Positive & Negative Mains half cycles

		ORG Overlay
CurrentPosition:DS	1	; Used by Stepper: motor has 16 stable positions
MotorControl:	DS	3	; Used by Stepper: direction, Low(count) and High(count)

		ORG Overlay
LimitValues:	DS	12	; Used by Temps: local buffer for limits

		ORG Overlay
ButtonsValue:	DS	1	; Used by RB: buttons are read each full scan
DisplayPosition:DS	1	; Used by RB: holds current display position
LEDBuffer:	DS	42	; Used by RB: local buffer for reader board

;

⌨️ 快捷键说明

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