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

📄 uartsetup.inc

📁 DSP 5402 声音压缩 Demo板测试程序
💻 INC
字号:
*****************************************************************
* Filename: UARTsetup.inc					*
* Function: Software UART parameter selection			*
* Author:   Robert J. DeNardo					*
* 	    Texas Instruments, Inc				*
* Revision History:						*
* 11/12/99  Original Code			Robert DeNardo	*
* 12/21/99  Increased data bits	to 1-15.	Robert DeNardo	* 
* 01/07/00  Added DMA_PTR_MOD & DMA_ABU_FIX.	Robert DeNardo	* 
*****************************************************************

****** Conditional Choices ********
MCBSP_CHOICE	.set	1	; # of McBSP to use for UART (0-2, depending on 54xx choice)
DMA_RX_CHOICE	.set	4	; # of DMA channel to use for Rx (0-5)
DMA_TX_CHOICE	.set	5	; # of DMA channel to use for Tx (0-5), different than above
INTOSEL		.set	1	; Selection of DMA/McBSP multiplexed interrupts (0-3).
				; The choices are device dependent and specified in DMA User's Guide.
PARITY		.set	0	; parity checked and generated (0=NO, 1=EVEN, 2=ODD, 3=MARK, 4=SPACE)
HSTOPBITS	.set	2	; number of 1/2 stop bits (2,3 or 4) for Tx
DATABITS	.set	8	; number of data bits (1-14 with parity, or 1-15 w/o parity)
BAUDRATEDIV	.set	163	; Enter baud rate divisor (approx DSPCLK/(16*baudrate) See app note for calculation.
INTERRUPT_BASED	.set	1	; 0=only use polling to check status of UART
				; 1=run ISR's for the interrupt events on UART
DMA_PTR_MOD	.set	1	; Direction for DMA ptr modification (0=post-decrement, 1=post-increment)
				; 5410 can only use 0=post-decrement
DMA_ABU_FIX	.set	1	; Adds workaround for ABU difference in 5402 (0=no fix, 1=add fix)
				; Difference occurs when DMA ABU started with DMA ptr in 2nd half of buffer				
***********************************


*************************************************
* This is the available public variable		*
* which can be used in your code		*
************************************************* 
* _UARTLSR - Line Status Register bit definitions
* This register is used to monitor status of the line, including
* status for available receive data or status for transmit, as well
* as error bits.
DR		.set	1<<0	; Data Ready: character is ready
OE		.set	1<<1	; Overrun Error: before last char read, it was overwritten
PE		.set	1<<2	; Parity Error: parity of received char doesn't match setting of UART
FE		.set	1<<3	; Framing Error: received character has invalid stop bit
BI		.set	1<<4	; Break Indicator: received data input was 0 longer than packet length
THRE		.set	1<<5	; Transmit Holding Register Empty: another char can be transmitted

⌨️ 快捷键说明

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