亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ups17b.asm

?? USB大全電子版全部資料3~包含源碼、協議等
?? ASM
?? 第 1 頁 / 共 5 頁
字號:
;======================================================================
;		copyright 1997 Cypress Semiconductor Corporation
;======================================================================
; 		USB UPS Reference Firmware
;======================================================================
; Part Number:	CY7C63001
;======================================================================
;
;	This code implements the USB interface for an Uninterruptable

;	Power Supply.  The interface between the CY7C63001 and the UPS

;	is done through RS-232.  The code has been divided into two 

;	portions a general RS-232 part which is in the serial.asm file

;	and the USB UPS part which is in this file.

;

; UPS Features include:

;	5 Reports that are used to represent :

;	- MAIN AC FLOW PHYSICAL COLLECTION

;	- OUTPUT AC FLOW PHYSICAL COLLECTION

;	- BATTERY SYSTEM PHYSICAL COLLECTION

;	- POWER CONVERTER PHYSICAL COLLECTION

;		- AC INPUT PHYSICAL COLLECTION

;		- AC OUTPUT PHYSICAL COLLECTION

;	
;======================================================================
; History:

;	3/3/98	wmh	v1.7	

;	Minor changes and addition of more comments 

;======================================================================

;	12/13/97	wmh	v1.6	

;	All set/get reports added, conversions and strings added

;======================================================================

;	11/24/97	wmh	v0.9	

;	Change in control_read_16 routine to allow program to send more

;	than 255 bytes of the report descriptor

;======================================================================

;	11/4/97	wmh	v0.8	

;	Change in GetReportDescriptor subroutine

;======================================================================

;	10/28/97	wmh	v0.7	

;	Control Send added and get/set report requests added

; 	Control Send is used to send the data of a get report

;======================================================================

;	10/26/97	wmh	v0.6	

;	Control Read 16 added.  This allows for a larger than 256 byte

; 	report descriptor

;======================================================================

;	10/19/97	wmh	v0.4	

;	String Descriptors added (in ROM)

;======================================================================
;	10/16/97	wmh	v0.3	USB Enumeration added

;	Hid Report id 1 is the only report currently supported

;======================================================================

;	9/27/97 :	jb	v0.1
;	Initial code for generic UPS Serial Interface.
;======================================================================
;
;======================== assembler directives ======================== 
;
label:          XPAGEON
;
; USB ports

USB_EP0_TX_Config:      equ     10h     ; USB EP0 transmit configuration

USB_EP1_TX_Config:      equ     11h     ; USB EP1 transmit configuration

USB_Device_Address:     equ     12h     ; USB device address assigned by host

USB_Status_Control:     equ     13h     ; USB status and control register

USB_EP0_RX_Status:      equ     14h     ; USB EP0 receive status


; control ports
Global_Interrupt:	equ 20h 			; Global interrupt enable
Watchdog:		equ 21h 			; Clear watchdog Timer
CExt:			equ 22h 			; Extenal timeout
Timer:		equ 23h 			; free-running Timer
;
; control port
Status_Control:	equ FFh ;
RAMStart:		equ 00h ;
RAMEnd:		equ 80h 			; End of RAM + 1
;**********  Register constants  ************************************

; Processor Status and Control

RunBit:			equ	 1h		; CPU Run bit

SuspendBits:		equ    9h		; Run and suspend bits set

PowerOnReset:		equ   10h		; Power on reset bit

USBReset:			equ	20h		; USB Bus Reset bit

WatchDogReset:		equ	40h		; Watchdog Reset bit



; USB Status and Control

BusActivity:		equ	 1h		; USB bus activity bit



; interrupt masks

TIMER_ONLY:			equ	 4h		; one msec timer

ENUMERATE_MASK:		equ	0Ch		; one msec timer 	

							; USB EP0 interrupt

RUNTIME_MASK:		equ     1Ch     	; one msec timer

							; USB EP0 interrupt

							; USB EP1 interrupt

; USB EP1 transmit configuration

DataToggle:		equ	40h			; Data 0/1 bit



;========================================================================

; constant declarations

;========================================================================

; from USB Spec v1.0 from page 175

;------------------------------------------------------------------------

; standard request codes

get_status:             equ   0

clear_feature:          equ   1

set_feature:            equ   3

set_address:            equ   5

get_descriptor:         equ   6

set_descriptor:         equ   7

get_configuration:      equ   8

set_configuration:      equ   9

get_interface:          equ  10 

set_interface:          equ  11 

synch_frame:            equ  12



; standard descriptor types

device:         	equ  1

configuration:  	equ  2

string:         	equ  3

interface:      	equ  4

endpoint:       	equ  5



; standard feature selectors

endpoint_stalled:       equ  0		; recipient endpoint

device_remote_wakeup:   equ  1		; recipient device

 

;========================================================================

; from HID Class v1.0 Draft #4

;------------------------------------------------------------------------

; class specific descriptor types from section 7.1 Standard Requests

HID:                    equ  21h

report:                 equ  22h

physical:               equ  23h

  

; class specific request codes from section 7.2 Class Specific Requests

get_report:             equ   1

get_idle:               equ   2

get_protocol:           equ   3

set_report:             equ   9

set_idle:               equ  10

set_protocol:           equ  11



;========================================================================

; USB packet constants (debug purposes)

;------------------------------------------------------------------------

;setup:          	equ  B4h

;in:             	equ  96h

;out:            	equ  87h

;data0:          	equ  C3h

;data1:          	equ  D2h

;ack:            	equ  4Bh

;nak:            	equ  5Ah



DISABLE_REMOTE_WAKEUP:  equ   0         ; bit[1] = 0

ENABLE_REMOTE_WAKEUP:   equ   2         ; bit[1] = 1



DISABLE_PROTOCOL:	equ	0			; bit[0] = 0

ENABLE_PROTOCOL:	equ	1			; bit[0] = 1



;========================================================================

; data variable assignments

;========================================================================



; control endpoint 0 fifo

endpoint_0:             equ  70h	; control endpoint



; definitions for SETUP packets

bmRequestType:          equ  70h

bRequest:               equ  71h

wValue:                 equ  72h        ; default wValue (8-bits)

wValueHi:               equ  73h

wIndex:                 equ  74h        ; default wIndex (8-bits)

wIndexHi:               equ  75h

wLength:                equ  76h        ; default wLength (8-bits)

wLengthHi:              equ  77h

 



; interrupt endpoint 1 fifo

endpoint_1:             equ  78h



;*************************************

;
; variable allocations

;*************************************
interrupt_mask:	equ 20h ;
;************************************************

;USB Variables 

;************************************************

endp0_data_toggle: 	equ  21h

loop_counter:		equ  22h

data_start:			equ  23h

data_count:			equ  24h

endpoint_stall:		equ  25h



remote_wakeup_status:   equ  26h        	; remote wakeup request

							; zero is disabled

							; two is enabled

configuration_status:   equ  27h        	; configuration status

							; zero is unconfigured

							; one is configured

;idle_status:           equ  64h        	; support SetIdle and GetIdle

protocol_status:      	equ  65h        	; zero is boot protocol

							; one is report protocol

data_send:			equ  28h		; start of data to be sent

							; next 16 bytes (28-39) are 

							; send buffer

hi_data_count:		equ  60h		; high byte of data count

low_data_count:		equ  61h		; low byte of data count

loop_num:			equ  62h		; loop number (USB sending)

temp2:			equ  63h		; temporary variable

send_ptr:			equ  7Dh		; Send buffer ptr	




;======================================================================
;
;*************** interrupt vector table ****************
; begin execution here after a reset
	org	00h
;
; Interrupt Vector Number 0 : Reset vector
	jmp	Reset
;
; Interrupt Vector Number 1 :  128us interrupt
	jmp	Serial_ISR
	; Used to implement serial receive/transmit
	; bit timing loops.
;
; Interrupt Vector Number 2 :  1024ms interrupt 
	jmp	One_mSec_ISR
	; Used for Watchdog timer.
;
; Interrupt Vector Number 3 :  endpoint 0 interrupt 
	jmp	USB_EP0_ISR  
;
; Interrupt Vector Number 4 :  endpoint 1 interrupt 
	jmp	DoNothing_ISR


;
; Interrupt Vector Number 5 :  reserved interrupt 
	jmp	Reset
	; Runs initialization at reset.
;
; Interrupt Vector Number 6 :  general purpose I/O interrupt 
	jmp	GPIO_ISR
	; Used to detect receive data start bit.
	; Falling edge of Port 0 Bit 7 detected.
;
; Interrupt Vector Number 7 :  Wakeup_ISR or resume interrupt 
	jmp     DoNothing_ISR
	; Not used
;
;************************************************************************
;
ORG  10h
;************************************************************************
; The Cext, and and most GPIO interrupts are not used by the ups
; code.  If any of these interrupts occur, the software should do nothing
; except re-enable the interrupts.
DoNothing_ISR:
	push	A ; save accumulator on stack
	mov	A, [interrupt_mask]
	ipret	Global_Interrupt

;************************************************************************
; The 1 msec interrupt is used to clear the watchdog timer.
; If the watchdog is not cleared for 8 msec, then a watchdog reset will
; occur. 
One_mSec_ISR:
	push	A		; save accumulator on stack
	iowr	Watchdog	; clear watchdog timer
;
; Finish the interrupt handling
	mov	A,[interrupt_mask] ;
	ipret	Global_Interrupt ;
;

;************************************************************************

; The Serial_ISR routine resides in Serial2.asm

;************************************************************************

; The GPIO_ISR routine resides in Serial2.asm

;************************************************************************

	include	"serial.asm"	;



;************************************************************************
; reset processing
; The idea is to put the microcontroller in a known state.  As this
; is the entry point for the "reserved" interrupt vector, we may not
; assume the processor has actually been reset and must write to all
; of the I/O ports. 
Reset:
	mov	A, endpoint_0	; move data stack pointer
	swap	A, dsp		; so it does not write over USB FIFOs 
	mov	A,00h			;
	mov	X,00h			;
ClrRAMLoop:
	swap	A,X			;
	mov	[X+RAMStart],A	;
	inc	X			;
	swap	A,X			;
	cmp	A,RAMEnd		;
	jnz	ClrRAMLoop		;
;

;************************************************************************

; During serial transfers data bit 0 is transmitted first.

; We will use Port 0 Bit 7 for receive and Bit 0 for transmit.

; Data will always be right shifted for either transmit or receive.

; Port 0 Bit 7 will be a falling edge sensitive GPIO_ISR input.

; Port 0 bits 6-0 and Port 1 bits 3-0 will be outputs.

;

	call SerialInitialize	;


;*****************************************

;USB initialization

;*****************************************

	mov A, 0h

	mov [endpoint_stall], A

	mov [remote_wakeup_status], A

	mov [configuration_status], A



	mov A, ENABLE_PROTOCOL

	mov [protocol_status], A

;

; test what kind of reset occurred 

;

	iord Status_Control

	and A, USBReset		; test for USB Bus Reset

	jnz BusReset



	iord Status_Control

	and A, WatchDogReset	; test for Watch Dog Reset

	jz suspendReset

;

; Process a watchdog reset.  Wait for a Bus Reset to bring the system

; alive again.

	mov A, TIMER_ONLY	; enable one msec timer interrupt

	mov [interrupt_mask],A

	iowr Global_Interrupt



WatchdogHandler:		; wait for USB Bus Reset

	jmp WatchdogHandler

suspendReset:

	mov A, 09h

	iowr Status_Control	; go back to suspend

	nop

	jmp suspendReset		; wait until real bus reset

;

; Either a bus reset or a normal reset has occurred

;

BusReset:

	mov A, RunBit		; clear all reset bits

	iowr Status_Control



; setup for enumeration

	mov A, ENUMERATE_MASK	

	mov [interrupt_mask],A

	iowr Global_Interrupt



wait:						; wait until configured

	iord USB_EP1_TX_Config			

	cmp A, 0		

	jz wait			



;************************************************************************

; This is the main loop that is entered after reset processing

;************************************************************************

;

main:

;	iowr	Watchdog		; clear watchdog timer

	jmp main



;************************************************************************

; Command string transmit processing:

; These 3 routines will transmit four bytes of data for each command.

; 1.) Ident: Manufacturer:  "I M C_R L_F"

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区国产| 国产精品久久久久久久久图文区| 91精品综合久久久久久| 国产日韩欧美电影| 同产精品九九九| 国产成人精品免费| 欧美丰满一区二区免费视频| 中文字幕精品三区| 精品在线亚洲视频| 欧美网站一区二区| 国产精品久久午夜夜伦鲁鲁| 美女脱光内衣内裤视频久久网站 | 亚洲第一会所有码转帖| 狠狠色狠狠色综合系列| 日本精品免费观看高清观看| 国产偷国产偷亚洲高清人白洁| 天天射综合影视| 91极品美女在线| 亚洲三级免费电影| 国产精品2024| 久久久久久久久久久久电影| 奇米色一区二区三区四区| 欧美最猛性xxxxx直播| 亚洲欧洲成人自拍| 成人三级在线视频| 一区二区三区在线看| 成人一区二区三区中文字幕| 久久综合五月天婷婷伊人| 日产精品久久久久久久性色| 日本久久电影网| 一区二区三区四区不卡在线| av电影一区二区| 亚洲图片另类小说| 91小视频在线观看| 国产精品电影一区二区| 丁香六月综合激情| 国产精品视频看| 成人免费视频一区二区| 欧美韩日一区二区三区四区| 国产精品亚洲综合一区在线观看| 久久久精品国产免费观看同学| 黄色精品一二区| 国产欧美日本一区二区三区| 成人性生交大片免费| 中文文精品字幕一区二区| 国产成人av电影在线观看| 欧美国产欧美综合| 99国产精品久久| 亚洲一区二区在线免费观看视频| 欧美性做爰猛烈叫床潮| 日韩精品欧美精品| 精品国产第一区二区三区观看体验| 久久99精品国产91久久来源| 久久久久99精品国产片| 成人18精品视频| 亚洲观看高清完整版在线观看| 91精品国产一区二区三区香蕉| 久久99精品一区二区三区三区| 久久久久99精品一区| 91一区在线观看| 日韩国产成人精品| 久久久久久久久一| 91网站黄www| 日韩av不卡在线观看| 国产夜色精品一区二区av| 99国产精品久久久久久久久久| 午夜婷婷国产麻豆精品| 精品国产乱码久久久久久1区2区| 成人免费视频caoporn| 性感美女久久精品| 久久蜜臀中文字幕| 欧美午夜一区二区三区| 激情久久五月天| 一区二区不卡在线播放 | 樱花影视一区二区| 日韩视频永久免费| 不卡av免费在线观看| 丝袜亚洲另类丝袜在线| 中文字幕乱码久久午夜不卡 | 欧美亚洲禁片免费| 激情成人综合网| 亚洲自拍与偷拍| 26uuu欧美| 欧美年轻男男videosbes| 成人免费视频国产在线观看| 丝袜诱惑制服诱惑色一区在线观看| 亚洲国产岛国毛片在线| 在线91免费看| 91丝袜高跟美女视频| 国产乱妇无码大片在线观看| 亚洲国产综合人成综合网站| 国产精品乱人伦一区二区| 91精品国产综合久久福利软件 | 一区二区三区四区不卡视频| 久久久综合激的五月天| 91.com在线观看| 在线视频中文字幕一区二区| 成人一区二区三区视频在线观看 | 狠狠色2019综合网| 亚洲成人1区2区| 亚洲欧美视频在线观看视频| 久久九九久精品国产免费直播| 欧美日本韩国一区二区三区视频| av高清久久久| 成人av动漫在线| 国产91在线观看丝袜| 久久99精品久久久| 免费高清成人在线| 青青草国产精品97视觉盛宴| 亚洲一区二区三区中文字幕| 亚洲精品国产高清久久伦理二区| 国产精品免费丝袜| 国产欧美精品一区二区色综合朱莉| 337p日本欧洲亚洲大胆精品| 精品久久久久久久久久久久包黑料 | 亚洲成人av一区| 亚洲最新视频在线观看| 亚洲欧美日韩国产中文在线| 欧美极品美女视频| 国产精品妹子av| 欧美高清在线精品一区| 国产午夜精品一区二区三区视频 | 亚洲色欲色欲www| 国产精品成人在线观看 | 日韩视频在线你懂得| 欧美电影一区二区| 欧美一级搡bbbb搡bbbb| 中文字幕一区二区三区四区| 中文av字幕一区| 亚洲欧洲韩国日本视频| 亚洲四区在线观看| 亚洲一线二线三线视频| 日韩精品久久理论片| 看片的网站亚洲| 国内不卡的二区三区中文字幕 | 首页综合国产亚洲丝袜| 日韩成人dvd| 国产精品一线二线三线| 成人av第一页| 欧美图区在线视频| 日韩一级二级三级精品视频| 久久品道一品道久久精品| 国产精品网友自拍| 亚洲午夜一区二区三区| 日本成人在线一区| 狠狠色丁香婷婷综合久久片| 成人免费视频视频| 欧美日韩国产bt| 久久亚洲综合av| 亚洲免费在线看| 久久精品国产77777蜜臀| 国产麻豆精品在线观看| 99久久婷婷国产综合精品| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 制服.丝袜.亚洲.另类.中文| 久久夜色精品一区| 亚洲永久免费av| 国产精品一二三区| 在线视频国内一区二区| www国产成人免费观看视频 深夜成人网| 国产精品美女www爽爽爽| 丝袜美腿亚洲一区二区图片| 国产馆精品极品| 欧美高清一级片在线| 国产精品久久久爽爽爽麻豆色哟哟| 一个色妞综合视频在线观看| 国内外精品视频| 欧美日韩另类国产亚洲欧美一级| 久久久99久久精品欧美| 亚洲成人动漫av| aa级大片欧美| 2021国产精品久久精品| 香蕉久久一区二区不卡无毒影院| 国产成人自拍在线| 欧美美女网站色| 国产精品夫妻自拍| 国内国产精品久久| 欧美一区二区三区系列电影| 亚洲日本一区二区| 国产成人欧美日韩在线电影| 欧美肥妇毛茸茸| 一区二区三区精密机械公司| 国产99久久久精品| 26uuu成人网一区二区三区| 亚洲电影一区二区| 91小视频免费看| 中文字幕一区免费在线观看| 国产成人免费9x9x人网站视频| 日韩一卡二卡三卡国产欧美| 亚洲一区在线观看免费观看电影高清| 国产传媒久久文化传媒| 欧美大肚乱孕交hd孕妇| 爽好久久久欧美精品| 欧美日韩久久一区| 亚洲国产一区二区在线播放| 欧美综合久久久| 亚洲一区二区在线观看视频| 色爱区综合激月婷婷| 亚洲精品成人少妇| 色综合天天在线|