initsport.asm

来自「ADI 公司的DSP ADSP21369 EZ-KIT LITE开发板的全部源代」· 汇编 代码 · 共 63 行

ASM
63
字号
////////////////////////////////////////////////////////////////////////////////////////////
//NAME:     initSPORT.asm
//DATE:     7/29/05
//USAGE:    This file initializes the transmit and receive serial ports (SPORTS). It uses
//			uses SPORT0 to receive data from the ADC and transmits the data to the DAC's
//			via SPORT1A, SPORT1B, SPORT2A and SPORT2B.
//
////////////////////////////////////////////////////////////////////////////////////////////

#include <def21369.h>

.global _initSPORT;
.section/pm seg_pmco;

_initSPORT:

	//============================================================
	//
	// Make sure that the multichannel mode registers are cleared
	//
	//============================================================

	r0 = 0;
	dm(SPMCTL0) = r0;
	dm(SPMCTL1) = r0;
	dm(SPMCTL2) = r0;
	dm(SPCTL0) = r0;
	dm(SPCTL1) = r0;
	dm(SPCTL2) = r0;

	//============================================================
	//
	// Configure SPORT 0 as a receiver (input from ADC)
	//
	//    OPMODE = I2S mode
	//    SLEN24 = 24 bit of data in each 32-bit word
	//    SPEN_A = Enable data channel A
	//
	//------------------------------------------------------------

	r0 = OPMODE | SLEN24 | SPEN_A;
	dm(SPCTL0) = r0;

	//============================================================
	//
	// Configure SPORTs 1 & 2 as transmitter (output to DACs 1-4)
	//
	//    SPTRAN = Transmit on serial port
	//    OPMODE = I2S mode
	//    SLEN24 = 24 bit of data in each 32-bit word
	//    SPEN_A = Enable data channel A
	//    SPEN_B = Enable data channel B
	//
	//------------------------------------------------------------

	r0 = SPTRAN | OPMODE | SLEN24 | SPEN_A | SPEN_B;
	dm(SPCTL1) = r0;
	dm(SPCTL2) = r0;

	rts;

_initSPORT.end:

⌨️ 快捷键说明

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