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

📄 usb_hid_ad_et.asm

📁 基于义统et44的AD与PWM控制程序,简单的输出输入动作控制程序,可用于自行设定任何控制.
💻 ASM
字号:
;--------------------------------------------------------
; C_Compiler for ETOMS MCU
; Target MCU: ET44M210
;--------------------------------------------------------
;	.module usb_hid_ad
;--------------------------------------------------------
; publics variables in this module
;--------------------------------------------------------
;	.globl _Int_Pwm1ie
;	.globl _Int_Adcie
;	.globl _main
;	.globl _byPwmData
;	.globl _byAdData
;	.globl _byAdDataL
;	.globl _byAdDataH
;	.globl _byCount
;	.globl _byTemp
;	.globl _byPwmOut
;	.globl _szCount
;	.globl _nCount
;	.globl _nDt1
;	.globl _nPrd1
;	.globl _usb_byTemp
;	.globl _nAddrBuf
;	.globl _nTable
;	.globl _nRomAdr
;	.globl _nwLength
;	.globl _nHwLength
;	.globl _psz
;	.globl _DelayMs
;	.globl _DelayNs
;	.globl _AdInitial
;	.globl _AdStart
;	.globl _GetPwmData
;	.globl _AddUsbSetReportSub
;	.globl _AddUsbInitialWorkSub
;	.globl _AddUsbRt0x01Request
;	.globl _AddUsbRt0x02Request
;	.globl _AddUsbRt0x00Request
;	.globl _AddUsbRt0x80Request
;	.globl _AddUsbRt0x82Request
;	.globl _AddUsbRt0x20Request
;	.globl _AddUsbRt0x21Request
;	.globl _AddUsbRt0x23Request
;	.globl _AddUsbRt0xA0Request
;	.globl _AddUsbRt0xA1Request
;	.globl _AddUsbRt0xA3Request
;	.globl _AddUsbGetReportSub
;	.globl _AddUsbBmRequestType
;	.globl _AddUsbGetReportExpSub
;	.globl _AddUsbEp1Sub
;	.globl _AddUsbEp2Sub
;	.globl _AddUsbEp3Sub
;	.globl _AddUsbBusResetSub
;	.globl _AddUsbIdleIntSub
;	.globl _AddUsbWakeup
;	.globl _AddUsbSof
;	.globl _AddUsbDeviceConfigOk
;--------------------------------------------------------
; special function registers
_KWUAIF	EQU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
_IOCF	EQU	0x8b
_PUCA	EQU	0x8c
_PUCB	EQU	0x8d
_PUCC	EQU	0x8e
_PUCD	EQU	0x85
_PUCE	EQU	0x90
_PUCF	EQU	0x91
_ODCB	EQU	0x92
_TCCC	EQU	0x93
_FRCC	EQU	0x94
_WDT_CON	EQU	0x95
_ADCAIS	EQU	0x96
_ADCCR	EQU	0x97
_PWMCR	EQU	0x98
_RFINTE	EQU	0x99
_HbmRequestType	EQU	0x80	;Bank1 Source:180 
_HbRequest	EQU	0x81	;Bank1 Source:181 
_HwValueL	EQU	0x82	;Bank1 Source:182 
_HwValueH	EQU	0x83	;Bank1 Source:183 
_HwIndexL	EQU	0x84	;Bank1 Source:184 
_HwIndexH	EQU	0x85	;Bank1 Source:185 
_HwLengthL	EQU	0x86	;Bank1 Source:186 
_HwLengthH	EQU	0x87	;Bank1 Source:187 
_HTBLL	EQU	0x88	;Bank1 Source:188 
_HROMADRL	EQU	0x89	;Bank1 Source:189 
_HROMADRH	EQU	0x8a	;Bank1 Source:18a 
_A_INTERFACE	EQU	0x8b	;Bank1 Source:18b 
_TEMP_UREG	EQU	0x8c	;Bank1 Source:18c 
_PROTOCOL	EQU	0x8d	;Bank1 Source:18d 
_IDLE_TIMER	EQU	0x8e	;Bank1 Source:18e 
_USB_STATUS	EQU	0x8f	;Bank1 Source:18f 
_HUB_STATUS	EQU	0x8f	;Bank1 Source:18f 
_FC_STATUS	EQU	0x8f	;Bank1 Source:18f 
_ADDRESS_BUFh	EQU	0x90	;Bank1 Source:190 
_ADDRESS_BUFf	EQU	0x91	;Bank1 Source:191 
_CTR_BUF	EQU	0x92	;Bank1 Source:192 
_Reg_Adr	EQU	0x93	;Bank1 Source:193 
_HEP1_CNT	EQU	0x94	;Bank1 Source:194 
_STACK_IAP0	EQU	0x95	;Bank1 Source:195 
_bmRequestType	EQU	0xc0	;Bank1 Source:1c0 
_bRequest	EQU	0xc1	;Bank1 Source:1c1 
_wValueL	EQU	0xc2	;Bank1 Source:1c2 
_wValueH	EQU	0xc3	;Bank1 Source:1c3 
_wIndexL	EQU	0xc4	;Bank1 Source:1c4 
_wIndexH	EQU	0xc5	;Bank1 Source:1c5 
_wLengthL	EQU	0xc6	;Bank1 Source:1c6 
_wLengthH	EQU	0xc7	;Bank1 Source:1c7 
_TBLL	EQU	0xc8	;Bank1 Source:1c8 
_ROMADRL	EQU	0xc9	;Bank1 Source:1c9 
_ROMADRH	EQU	0xca	;Bank1 Source:1ca 
_STATUS_BUF	EQU	0xcb	;Bank1 Source:1cb 
_USBTR	EQU	0xcc	;Bank1 Source:1cc 
_GCNTR	EQU	0xcd	;Bank1 Source:1cd 
_EP1CNTR	EQU	0xce	;Bank1 Source:1ce 
_EP2CNTR	EQU	0xcf	;Bank1 Source:1cf 
_EP3CNTR	EQU	0xd0	;Bank1 Source:1d0 
_EPINTR	EQU	0xd1	;Bank1 Source:1d1 
_EPINTE	EQU	0xd2	;Bank1 Source:1d2 
_STAINTR	EQU	0xd3	;Bank1 Source:1d3 
_STAINTE	EQU	0xd4	;Bank1 Source:1d4 
_FAR	EQU	0xd5	;Bank1 Source:1d5 
_EP0RXTR	EQU	0xd6	;Bank1 Source:1d6 
_EP0RXCSR	EQU	0xd7	;Bank1 Source:1d7 
_EP0TXCSR	EQU	0xd8	;Bank1 Source:1d8 
_EP1CSR	EQU	0xd9	;Bank1 Source:1d9 
_EP2CSR	EQU	0xda	;Bank1 Source:1da 
_EP3CSR	EQU	0xdb	;Bank1 Source:1db 
_EP0RXCTR	EQU	0xdc	;Bank1 Source:1dc 
_EP0TXCTR	EQU	0xdd	;Bank1 Source:1dd 
_EP1CTR	EQU	0xde	;Bank1 Source:1de 
_EP2CTR	EQU	0xdf	;Bank1 Source:1df 
_EP3CTR	EQU	0xe0	;Bank1 Source:1e0 
_EP0RXDAR	EQU	0xe1	;Bank1 Source:1e1 
_EP0TXDAR	EQU	0xe2	;Bank1 Source:1e2 
_EP1DAR	EQU	0xe3	;Bank1 Source:1e3 
_EP2DAR	EQU	0xe4	;Bank1 Source:1e4 
_EP3DAR	EQU	0xe5	;Bank1 Source:1e5 
_HGSR	EQU	0xe6	;Bank1 Source:1e6 
_HINTR	EQU	0xe7	;Bank1 Source:1e7 
_HINTE	EQU	0xe8	;Bank1 Source:1e8 
_HAR	EQU	0xe9	;Bank1 Source:1e9 
_HEP0RXTR	EQU	0xea	;Bank1 Source:1ea 
_HEP0RXCSR	EQU	0xeb	;Bank1 Source:1eb 
_HEP0TXCSR	EQU	0xec	;Bank1 Source:1ec 
_HEP1TXCSR	EQU	0xed	;Bank1 Source:1ed 
_HEP0RXCTR	EQU	0xee	;Bank1 Source:1ee 
_HEP0TXCTR	EQU	0xef	;Bank1 Source:1ef 
_HEP0RXDAR	EQU	0xf0	;Bank1 Source:1f0 
_HEP0TXDAR	EQU	0xf1	;Bank1 Source:1f1 
_HEP1TXDAR	EQU	0xf2	;Bank1 Source:1f2 
_HPCONR	EQU	0xf3	;Bank1 Source:1f3 
_HPSTAR	EQU	0xf4	;Bank1 Source:1f4 
_HSR	EQU	0xf5	;Bank1 Source:1f5 
_HPSR1	EQU	0xf6	;Bank1 Source:1f6 
_HPSR2	EQU	0xf7	;Bank1 Source:1f7 
_HPSR3	EQU	0xf8	;Bank1 Source:1f8 
_HPSR4	EQU	0xf9	;Bank1 Source:1f9 
_HPSCR1	EQU	0xfa	;Bank1 Source:1fa 
_HPSCR2	EQU	0xfb	;Bank1 Source:1fb 
_HPSCR3	EQU	0xfc	;Bank1 Source:1fc 
_HPSCR4	EQU	0xfd	;Bank1 Source:1fd 
_FNLR	EQU	0xfe	;Bank1 Source:1fe 
_FNHR	EQU	0xff	;Bank1 Source:1ff 
_UsbState	EQU	0x40
_AdState	EQU	0x50
_PwmState	EQU	0x60
;--------------------------------------------------------
;--------------------------------------------------------
; internal ram data
;	.area	DSEG    (DATA)
;	_psz
;	_psz_1
_nHwLength	EQU	0x86	;Bank1 Source:186 
_nwLength	EQU	0xc6	;Bank1 Source:1c6 
_nRomAdr	EQU	0xc9	;Bank1 Source:1c9 
_nTable	EQU	0x0b
_nAddrBuf	EQU	0x90	;Bank1 Source:190 
_usb_byTemp	EQU	0x92	;Bank1 Source:192 
_nPrd1	EQU	0x29
_nDt1	EQU	0x2b
_nCount	EQU	0x4a
_szCount	EQU	0x4c
_byPwmOut	EQU	0x43
_byTemp	EQU	0x4a
_byCount	EQU	0x4b
_byAdDataH	EQU	0x51
_byAdDataL	EQU	0x52
_byAdData	EQU	0x53
_byPwmData	EQU	0x61
;--------------------------------------------------------
; Bit registers 
; Allocated Registers 
r0xA0	EQU	0xa0	;bank0
r0xA1	EQU	0xa1	;bank0
r0xA2	EQU	0xa2	;bank0
r0xA3	EQU	0xa3	;bank0
; Direct Registers 
; Stack Register 
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	.area	OSEG    (OVR,DATA)
;--------------------------------------------------------
; Stack segment in internal ram 
;--------------------------------------------------------
;	.area	SSEG	(DATA)
;__start__stack:
;	.ds	1

;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
;	.area	ISEG    (DATA)
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
;	.area	XSEG    (XDATA)
;--------------------------------------------------------
; Project Start
;--------------------------------------------------------
RORG 0x00
	JMP	__etcc_program_startup
;--------------------------------------------------------
; interrupt vector 
;--------------------------------------------------------
;	.area	CSEG    (CODE)
ORG	0x38
	BANK	0
	PAGE	_Int_Adcie.PAGENUM
	JBS		_INTF,7,_Int_Adcie
	RETI
ENDO
ORG	0x40
	BANK	0
	PAGE	_Int_Pwm1ie.PAGENUM
	JBS		_INTF,5,_Int_Pwm1ie
	RETI
ENDO
RORG	0xB0
__etcc_program_startup:
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
;	.area GSINIT  (CODE)
;	.area GSFINAL (CODE)
;	.area GSINIT  (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
;	.area CSEG    (CODE)
;***
;  pBlock Stats: dbName = M
;***
;entry:  _main:	;Function start
; 1 exit point 
;Using Bank: Bank0
;has an exit
;functions called:
;   _AdInitial
;   _UsbInitial
;   _AddUsbEp1Sub
;   _AdStart
;; Starting pCode block
_main:	;Function start
; 1 exit point 
;#CSRC	D:\ETOMS\DT\library\弧

⌨️ 快捷键说明

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