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

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

?? uart.asm

?? DSP 5402 聲音壓縮 Demo板測試程序
?? ASM
?? 第 1 頁 / 共 4 頁
字號:
	bc	SkipDisableTx,tc		; if another pkt is in buffer for Tx, don't disable DMA
	andm	#~TxDMACh,*(DMPREC)		; disable DMA channel for Tx                            
SkipDisableTx:
 .if INTERRUPT_BASED
	call	_UARTTBEint			; call routine to handle transmitter reg empty
 .endif
        popm	st0
        rete			     		; return and enable global interrupts    

*****************************************************************
*	Function: _UARTTxChar					*
*	Purpose: Adds parity, start, and stop bits to		*
*		 character to transmit.  Puts coded character	*
*		 into raw Tx buffer and resets the Transmit	*
*		 Holding Register Empty flag.  Only call when	* 
*		 THRE=1.					*
*	Inputs:	 al = character to transmit			*
*	Outputs: none						*
*	Modified: a,ar2,st0(tc,c),brc,rea,rsa			*
*****************************************************************  	
_UARTTxChar:        
	pshm	imr				; save the IMR state to restore Tx DMA int at end
	andm	#~TxDMAInt,*(imr)		; disable the DMA Tx interrupt (so DMA ISR doesn't change state here)
 .if DMA_ABU_FIX; 5402 workaround (can't start DMA ABU in 2nd half of buffer)
	bitf	*(txbufhalf),#1                	; check if in 2nd half of buffer (txbufhalf=1)
	bc	NoAdjust,ntc			; if not, nothing to worry about, so skip out
	cmpm	*(numTxPkts),#0			; check if DMA is disabled (no packets to transmit)
	bc	NoAdjust,ntc			; if DMA still on, nothing to worry about, so skip out
	xorm	#1,*(txbufhalf)			; set txbufhalf to 0 to point to 1st half	
	stm	#TxDMAptr,DMSA			; set subaddress to Tx DMA Source register.
	stm	#Tx1stStart,DMSDN		; Set Tx DMA pointer to start of 1st half
NoAdjust:
 .endif		; end 5402 workaround
	bitf	*(txbufhalf),#1                	; check if in 2nd half of buffer
	xorm	#1,*(txbufhalf)        		; toggle the buffer half which is available
	stm	#Tx2ndStart,ar2			; assume in 2nd half of buffer (point to start of this half) 
	xc	2,ntc                		; if not,  
	  stm	#Tx1stStart,ar2  		; point ar2 to the start of first half of buffer
 .if  (PARITY==EVEN)|(PARITY==ODD)      	;
	call	ParityCalc			; returns parity in TC: (0=even, 1=odd) and char in AL  
   .if PARITY==EVEN			;
	xc	2,tc				; if need to add one to make even parity	
	  or	#1,DATABITS,a  			; add in the parity bit
   .endif
   .if PARITY==ODD
	xc	2,ntc				; if need to add one to make odd parity	
	  or	#1,DATABITS,a  			; add in the parity bit
   .endif                               	;
 .elseif PARITY==MARK               		
	or	#1,DATABITS,a  			; MARK parity always adds in the parity bit
 .endif
	stm	#DATABITS+PARITYBITS-1,brc 	; now translate the data and parity bits in the character
	rptbd	CodeLoop-1                    	;
	  st	#00000h,*ar2fwd	    		; write the start bit first
	ror	a            			; rotate LSb out of A into C (carry bit)
	st	#00000h,*ar2  			; assume it is a zero and write code for 0 into buffer
	xc	2,c         			; if it was a 1 instead, 
	  st	#0ffffh,*ar2  			; write code for 1 into buffer
	mar	*ar2fwd	     			; increment buffer pointer
CodeLoop:                                     	;
	rpt	#TxHSTOPBITS-1          	;
	  st	#000ffh,*ar2fwd  		; write the stop bits into the buffer
startTx:
	addm	#1,*(numTxPkts)			; increment number of pkts in Tx buffer
	cmpm	*(numTxPkts),#2			; check if another pkt was already in buffer (now have 2)
	andm	#~THRE,*(_UARTLSR)		; signal that no space is available in Tx buffer (assume it now has 2 words)
	bcd	SkipDMARestart,tc		; if another pkt in buffer, skip the restart routine
	  stm	#SPSA,ar2            		; point to McBSP subaddress register	
	st	#SPCR2,*ar2+ 			; write the SPCR2 subregister offset and point to access register
waitReady:
	bitf	*ar2,#XRDY   			; check if XRDY==1
	bc	waitReady,ntc                   ; wait until serial port has clocked out any bits in XSR
	stm	#TxDMAptr,DMSA			; set subaddress to Tx DMA Source register
	mvmd	DMSDN,ar2			; get source address w/o autoincrement and put in ar2
	mvdk	*ar2fwd,DXR1reg			; write first "bit" to DXR
	mvdm	ar2,DMSDN			; write decremented address to DMA
	orm	#TxDMACh,*(DMPREC)		; enable DMA channel for Tx data.   
	orm	#THRE,*(_UARTLSR)		; signal that one space is still available in Tx buffer
SkipDMARestart:
	popm	imr				; restore state of IMR (turn Tx DMA int back on)
	ret
 
*****************************************************************
*	Function: _UARTRxChar					*
*	Purpose: Returns last character read by UART and 	*
*		 resets the Data Ready (DR) flag.		*
*	Inputs:	 none						*
*	Outputs: al = received character			*
*		 intm = 0					*
*	Modified: a						*
*****************************************************************  	
_UARTRxChar:   
	pshm	imr				; save the IMR state to restore Rx DMA int at end
	andm	#~RxDMAInt,*(imr)		; disable the DMA Rx interrupt
	andm	#~DR,*(_UARTLSR)		; once read, reset the flag       
	ld	*(rxchar),a			; return the character in al
	popm	imr				; restore state of IMR (turn Rx DMA int back on)
	ret                                  	
   
*****************************************************************
*	Function: _UARTInit					*
*	Purpose: Initializes variables as well as the		*
*		 McBSP and DMA registers.  When this function	*
*		 returns, the DMA and McBSP are initialized	*
*		 but are not enabled.				*
*	Inputs:	 none						*
*	Outputs: none						*
*	Modified: ar2,a,brc,rea,rsa				* 
***************************************************************** 
_UARTInit:    
	st	#MASK1011b,*(mask1011b)        	; init mask values
	st	#MASK0100b,*(mask0100b)                           
	st	#DECODER_MASK,*(decodeMask)
	st	#1,*(one)                     	; init 1
	st	#0,*(_UARTLSR)                 	; clear the status register
	stm	#SPCR1,SPSA			; write the SPCR1 sub-address
	andm	#~RRST,*(McBSPDataReg)		; write the SPCR1 register value to put rx in reset
	stm	#SPCR2,SPSA			; write the SPCR2 sub-address
	andm	#~(FRST|GRST|XRST),*(McBSPDataReg) ; write the SPCR2 register value to put tx in reset
	stm	#SPSA,ar2			; point ar2 to McBSP subaddress register
	ldx	#McBSPInitTable,16,a    	; get the program address of the McBSP init table
	or	#McBSPInitTable,a	   	; both high and low words
	stm	#(EndMcBSPInitTable-McBSPInitTable)/2-1,brc
	rptb	McBSPloop-1			;
	reada	*ar2+                           ; set the subaddress
	add	#1,a			        ; increment the table pointer
	reada	*ar2-				; write the value
	add	#1,a				; increment the table pointer
McBSPloop:					;
	rpt	#RESET_LATENCY-1
	  nop                                   ; wait for McBSP to sync internally
	andm	#~(TxDMACh|RxDMACh),*(DMPREC)	; disable DMA channels for Tx and Rx data.
	orm	#(INTOSEL<<6),*(DMPREC)		; set multiplexed interrupt choices
	andm	#~(TxDMACh<<8|RxDMACh<<8),*(DMPREC); set DMA channel Priorities low (=0)
	ldx	#DMAInitTable,16,a    		; get the program address of the DMA init table
	or	#DMAInitTable,a	   		; both high and low words
	stm	#DMSA,ar2			; point ar2 to the DMA Rx channel subaddress register
	reada	*ar2+				; store the first subaddress
	add	#1,a                           	; increment the table pointer
	rpt	#(EndDMARxInitTable-DMARxInitTable)-1			
	  reada	*ar2				; write the values, autoincrementing
	add	#5,a				; update the table address
	stm	#DMSA,ar2			; point ar2 to the DMA Tx channel subaddress register
	reada	*ar2+				; store the first subaddress
	add	#1,a                            ; increment the table pointer
	rpt	#(EndDMATxInitTable-DMATxInitTable)-1
	  reada	*ar2				; write the values, autoincrementing
	ret
	
*****************************************************************
*	Function: _UARTStart					*
*	Purpose: Enables UART for reception by enabling the	*
*		 Rx and TX DMA channels and taking the		*
*		 receiver of McBSP out of reset.  The		*
*		 DMA is reinitialized in this routine to 	*
*		 ensure correct alignment of DMA pointers	*
*		 in case DMA halted in mid-word last time. 	*
*		 Note that this routine will globally enable 	*
*		 all unmasked interrupts.			*
*	Inputs:	 a:    -1 = start Rx only			*
*			0 = start Rx and Tx			*
*			1 = start Tx only			*	
*	Outputs: none						*
*	Modified: imr,ifr,intm(st1),SPCR1,SPCR2,DMPREC		*
***************************************************************** 
_UARTStart:
	stm	#SPCR2,SPSA			; write the SPCR2 sub-address
	orm	#GRST,*(McBSPDataReg)		; enable clk generator (if not already enabled)
	rpt	#RESET_LATENCY-1
	  nop                                   ; wait for 2 bit clocks
   	bc	TxStartUp,agt   		; if input denotes Tx only startup, branch
RxStartUp:
        andm	#~(BI|FE|PE|OE|DR),*(_UARTLSR)	; init the status reg bits for Rx to 0
	st	#0,*(rxbufhalf)      		; initialize the half of Rx buffer to get bits from
	stm	#(RxDMAptr+1),DMSA		; set subaddress to Rx DMA Destination register.
	stm	#Rx1stStart,DMSDN		; DMDST: Destination is Receive raw data buffer
	stm	#RxDMAInt,ifr        		; clear all pending Rx interrupts
	orm	#RxDMAInt,*(imr)		; enable the DMA Rx interrupt
	orm	#RxDMACh,*(DMPREC)		; enable DMA channel for Rx data.
	stm	#SPCR1,SPSA			; write the SPCR1 sub-address
	orm	#RRST,*(McBSPDataReg)		; write the SPCR1 register value to enable rx 
	bc	SkipTxStartUp,alt               ; if input denotes Rx only startup, branch
TxStartUp:
	st	#0,*(txbufhalf)      		; initialize the half of Tx buffer to put bits in
        orm	#THRE,*(_UARTLSR)    		; init the status reg bits for Tx (available for tx)
       	st	#0,*(numTxPkts)	                ; init number of pkts in tx buffer to 0
	stm	#TxDMAptr,DMSA			; set subaddress to Tx DMA Source register.
	stm	#Tx1stStart,DMSDN		; DMSRC: Source is Transmit raw data buffer
	stm	#TxDMAInt,ifr        		; clear all pending Tx interrupts
	orm	#TxDMAInt,*(imr)		; enable the DMA Tx interrupt
	stm	#SPCR2,SPSA			; write the SPCR2 sub-address
	orm	#XRST,*(McBSPDataReg)		; write the SPCR2 register value to enable tx
SkipTxStartUp:                                                 
	rpt	#RESET_LATENCY-1
	  nop                                   ; wait for McBSP to come out of reset
	rsbx	intm       			; enable maskable interrupts
	ret

*****************************************************************
*	Function: _UARTStop					*
*	Purpose: Disables UART for reception by disabling the	*
*		 Rx and TX DMA channels and putting the		*
*		 receiver and transmitter on McBSP in reset.   	*
*		 Waits until all data from Tx buffer		*
*		 has been transmitted before it halts Tx UART.	*
*	Inputs:	 a:    -1 = stop Rx only			*
*			0 = stop Rx and Tx			*
*			1 = stop Tx only			*	
*	Outputs: none						*
*	Modified: ar2,imr,st0(tc),SPCR1,SPCR2,DMPREC		*
***************************************************************** 
_UARTStop:        
	bcd	ShutDownTx,agt                  ; if input denotes Tx only shutdown, branch
	  stm	#SPSA,ar2            		; point to McBSP subaddress register	
ShutDownRx:
	andm	#~RxDMAInt,*(imr)		; disable the DMA Rx interrupt
	andm	#~RxDMACh,*(DMPREC)		; disable DMA channel for Rx data.
	st	#SPCR1,*ar2+	 		; write the SPCR1 sub-address and point to access register
	andm	#~RRST,*ar2-		    	; write the SPCR1 register value to disable rx and move pointer back
	andm	#~DR,*(_UARTLSR)		; clear data ready flag so no more data received
	bc	SkipShutDownTx,alt              ; if input denotes Rx only shutdown, branch
	st	#SPCR2,*ar2+	 		; write the SPCR2 sub-address and point to access register
	andm	#~GRST,*ar2-			; disable clk generator when both rx and tx shutdown
ShutDownTx: 
	cmpm	*(numTxPkts),#0             	;
	bc	ShutDownTx,ntc			; wait until all pkts have been sent	
	st	#SPCR2,*ar2+ 			; write the SPCR2 subregister offset and point to access register
waitDone:
	bitf	*ar2,#XRDY   			; check if XRDY==1
	bc	waitDone,ntc                   	; wait until serial port has clocked out any bits in XSR	
	mar	*ar2-				; point to subaddress register
	andm	#~TxDMAInt,*(imr)		; disable the DMA Tx interrupt
	andm	#~TxDMACh,*(DMPREC)		; disable DMA channel for Tx data.
	st	#SPCR2,*ar2+	 		; write the SPCR2 sub-address and point to access register
	andm	#~XRST,*ar2-			; write the SPCR2 register value to disable tx and move pointer back
	andm	#~THRE,*(_UARTLSR)		; clear THRE flag so no more data sent
SkipShutDownTx:
	rpt	#RESET_LATENCY-1
	  nop                                   ; wait for McBSP to go into reset
	ret

*****************************************************************
*	Function: _UARTSetBaudRate				*
*	Purpose: Sets new baud rate for UART.  The UART MUST	* 
*		 be stopped before calling this routine.  Use	*
*		 _UARTStop to halt the UART (both tx and rx).	*
*	Inputs:	 a = new baud divisor				*
*	Outputs: none						*
*	Modified: a, SRGR1					*
***************************************************************** 
_UARTSetBaudRate:   
	sub	#1,a				; reduce divisor by 1 for correct storage to McBSP register
	stm	#SRGR1,SPSA			; write the SRGR1 sub-address to address register
	stlm	a,McBSPDataReg    		; write the register value to data register
	ret	
 
*****************************************************************
*	Function: _UARTSetBreak					*
*	Purpose: Sends a packet of all 0, including what	*
*		 would normally be the stop & parity bits.	*
*		 Must call with input of 0 to end the		*
*		 break before can transmit another char.	*
*		 Only call when THRE=1.				*
*	Inputs:	 a != 0 - send break				*
*		 a  = 0 - end break				*
*	Outputs: none						*
*	Modified: a,ar2,st0(tc)					*
***************************************************************** 
_UARTSetBreak:      
	pshm	imr				; save the IMR state to restore Tx DMA int at end
	andm	#~TxDMAInt,*(imr)		; disable the DMA Tx interrupt (so DMA ISR doesn't change state here)
 .if DMA_ABU_FIX; 5402 workaround (can't start DMA ABU in 2nd half of buffer)
	bitf	*(txbufhalf),#1                	; check if in 2nd half of buffer (txbufhalf=1)
	bc	NoAdjust2,ntc			; if not, nothing to worry about, so skip out

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人性生交大片| 国产成人精品三级麻豆| 国产精品视频看| 久久网站热最新地址| 欧美成人vps| 337p日本欧洲亚洲大胆精品| 日韩视频一区在线观看| 日韩欧美中文字幕精品| 欧美成人a在线| 国产亚洲精久久久久久| 中文字幕av一区二区三区| 亚洲视频在线一区观看| 亚洲一区视频在线| 美女国产一区二区三区| 国产在线精品不卡| av亚洲精华国产精华精华| 96av麻豆蜜桃一区二区| 欧美色偷偷大香| 精品国产不卡一区二区三区| 国产喂奶挤奶一区二区三区| 日韩一区有码在线| 五月婷婷久久综合| 国产乱理伦片在线观看夜一区| 国产91丝袜在线18| 在线观看一区二区视频| 欧美xxxxx牲另类人与| 国产精品视频观看| 日日夜夜精品视频免费| 国产黄色精品网站| 欧美日韩不卡一区| 国产片一区二区| 亚洲成人动漫一区| 国产成人精品综合在线观看| 91久久久免费一区二区| 久久麻豆一区二区| 亚洲一区二区三区自拍| 国产91精品精华液一区二区三区| 欧美视频一区在线| 久久久高清一区二区三区| 亚洲裸体xxx| 国模娜娜一区二区三区| 在线观看网站黄不卡| 国产亚洲综合在线| 日韩av一二三| 色狠狠色噜噜噜综合网| 欧美国产日产图区| 久久91精品国产91久久小草| 色综合久久综合网| 国产亚洲一区二区三区在线观看 | 99精品在线免费| 91麻豆精品国产自产在线| 国产精品久久久久影院色老大| 久久精品国产精品亚洲精品| 欧美视频在线观看一区二区| 亚洲欧洲一区二区三区| 国产剧情一区二区三区| 69精品人人人人| 亚洲自拍欧美精品| 92国产精品观看| 国产午夜精品美女毛片视频| 美女久久久精品| 在线不卡免费av| 亚洲一区在线观看网站| 色婷婷国产精品久久包臀| 欧美韩国日本不卡| 国产成人精品网址| 国产日韩欧美精品电影三级在线| 久久99精品久久久久婷婷| 日韩一区二区精品葵司在线| 亚洲成人免费av| 欧美精品一二三区| 肉色丝袜一区二区| 91精品国产一区二区三区蜜臀| 亚洲电影欧美电影有声小说| 欧美在线你懂得| 天使萌一区二区三区免费观看| 欧美熟乱第一页| 日韩av中文字幕一区二区| 6080yy午夜一二三区久久| 午夜精品久久久久久久蜜桃app| 欧美日韩五月天| 日韩激情视频在线观看| 欧美一区二区啪啪| 国产米奇在线777精品观看| 久久精品免费在线观看| 99国产精品国产精品久久| 亚洲狠狠丁香婷婷综合久久久| 91福利精品第一导航| 日韩精品福利网| 精品成人私密视频| 成人av第一页| 亚洲成人动漫在线免费观看| 日韩免费在线观看| 国产电影一区二区三区| 国产精品久久久久久久久久久免费看| 不卡一区二区三区四区| 亚洲成国产人片在线观看| 欧美成人三级在线| 大胆欧美人体老妇| 一区二区三区日韩精品视频| 在线播放中文一区| 国产精品自产自拍| 尤物视频一区二区| 精品国产制服丝袜高跟| 91在线精品一区二区三区| 亚洲va欧美va国产va天堂影院| 久久综合国产精品| 日本国产一区二区| 精品亚洲欧美一区| 一区二区久久久久久| 精品裸体舞一区二区三区| 91麻豆免费观看| 久久成人久久爱| 亚洲伦理在线免费看| 精品sm在线观看| 欧美午夜精品理论片a级按摩| 精品一区二区三区免费| 亚洲精品视频在线观看免费| 日韩欧美一区二区在线视频| k8久久久一区二区三区 | 国产成人激情av| 亚洲成人精品在线观看| 国产精品福利一区二区三区| 7878成人国产在线观看| 91小视频在线免费看| 久久99久久99| 性做久久久久久免费观看| 国产精品久久三区| 久久久国产一区二区三区四区小说| 欧洲一区二区三区在线| 成人18视频在线播放| 韩国成人福利片在线播放| 日日夜夜精品免费视频| 亚洲精品亚洲人成人网在线播放| 国产欧美一区二区精品性色| 日韩女优毛片在线| 91精品国产综合久久婷婷香蕉 | 婷婷国产在线综合| 亚洲精品国产品国语在线app| 欧美激情在线观看视频免费| 久久只精品国产| 精品乱码亚洲一区二区不卡| 欧美久久久久中文字幕| 欧美日韩精品系列| 色激情天天射综合网| 色婷婷久久一区二区三区麻豆| 成人动漫中文字幕| 成人高清免费观看| www.日本不卡| 色婷婷av久久久久久久| 91在线免费播放| 色狠狠色狠狠综合| 欧美日韩一区二区三区四区| 欧美日韩中文精品| 4438亚洲最大| 日韩欧美不卡在线观看视频| 99久久久国产精品| 在线看国产日韩| 7878成人国产在线观看| 欧美一区二区三区小说| 欧美一区二区人人喊爽| www一区二区| 国产精品国产三级国产三级人妇 | 五月婷婷综合激情| 免费黄网站欧美| 国产精品一二三四| av欧美精品.com| 欧美图区在线视频| 日韩欧美成人一区二区| 久久久久久久久久久久久女国产乱| 国产亚洲综合av| 18欧美乱大交hd1984| 同产精品九九九| 国内成人精品2018免费看| av中文字幕亚洲| 欧美福利一区二区| wwwwxxxxx欧美| 一区二区三区蜜桃| 蜜桃av噜噜一区| 97aⅴ精品视频一二三区| 6080午夜不卡| 自拍偷自拍亚洲精品播放| 日韩精品免费专区| 97久久久精品综合88久久| 91精品国产综合久久香蕉的特点| 欧美激情一区三区| 午夜视频一区二区| 成人天堂资源www在线| 欧美日韩精品一区视频| 久久久噜噜噜久久人人看| 亚洲一区免费在线观看| 国产精品资源网| 欧美日韩国产中文| 国产精品沙发午睡系列990531| 亚洲成a人片在线观看中文| 国产91在线|亚洲| 91精品免费在线| 亚洲综合男人的天堂| 岛国一区二区三区| 日韩免费一区二区|