isr.asm

来自「在ADSP-2126x上编写的优化过的FIR滤波器程序(用c和汇编编写)。」· 汇编 代码 · 共 61 行

ASM
61
字号
/////////////////////////////////////////////////////////////
//                                                         //
//     Interrupt Service Routine                           //
//       acknowledge received audio sample                 //
//                                                         //
/////////////////////////////////////////////////////////////

#include "def21262.h"
.extern _Stereo_FIR_Filter_SIMD;
.extern inbuf;
.extern outbuf;
.extern delaybuf;
.extern coefficients;


.section /pm seg_pmco;
.global _SPORT_ISR;


_SPORT_ISR:

    r6=dm(RXSP0A);            // read sample from ADC

    r6=lshift r6 by 8;        // convert to 32-bit floating point
    f6=float r6;



    r15 = dm(DAI_PIN_STAT);   // Check which channel has been received
    btst r15 by 7;            //   (1=left, 0=right)
    if not sz jump right_ch;  //   In I2S, low on left. When left
                              //   sample is received and triggers ISR
                              //   frame sync = 1 (receiving right)

left_ch:
    dm(inbuf)=f6;
    f6=dm(outbuf);
    jump send_out;

right_ch:
    dm(inbuf+1)=f6;
    f6=dm(outbuf+1);
    call _Stereo_FIR_Filter_SIMD;


send_out:
    r6=fix f6;              // covert to fixed point
    r6=lshift r6 by -8;     // left-align 24-bit audio in 32-bit word

    dm(TXSP1A)=r6;          // write to DAC1
    dm(TXSP1B)=r6;          // write to DAC2
    dm(TXSP2A)=r6;          // write to DAC3
    dm(TXSP2B)=r6;          // write to DAC4

    rti;

_SPORT_ISR.end:

//--------------------------------------------

⌨️ 快捷键说明

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