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

📄 initsport.asm

📁 ADI 公司的DSP ADSP21369 EZ-KIT LITE开发板的全部源代码
💻 ASM
字号:
////////////////////////////////////////////////////////////////////////////////////////////
//NAME:     initSPORT.asm
//DATE:     7/29/05
//USAGE:    This file initializes the transmit and receive serial ports (SPORTS). It uses
//			SPORT0 to receive data from the SPDIF Rx 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 SPDIF Rx).
    //
    //    OPMODE = I2S mode
    //    L_FIRST= Send the Left word first (per I2S requirement)
    //    SLEN24 = 24 bit of data in each 32-bit word
    //    SPEN_A = Enable data channel A
    //
    //------------------------------------------------------------

    r0 = OPMODE | L_FIRST | 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
    //    L_FIRST= Send the Left word first (per I2S requirement)
    //    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 | L_FIRST | SLEN24 | SPEN_A | SPEN_B;
    dm(SPCTL1) = r0;
    dm(SPCTL2) = r0;


_initSPORT.end:
    rts;

⌨️ 快捷键说明

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