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

📄 isrs.c

📁 This directory contains an example ADSP-BF535 subroutine that demonstrates the initialization of t
💻 C
字号:
#include "BF535 Talkthrough.h"

//--------------------------------------------------------------------------//
// Function:	SPORT0_TX_ISR												//
//																			//
// Parameters:	None														//
//																			//
// Return:		None														//
//																			//
// Description:	This interrupt handler for SPORT0 TX copies the processed	//
//				audio data and the corresponding Tag into the DMA transmit	//
//				buffer. It then re-enables the DMA transfer.				//
//--------------------------------------------------------------------------//
EX_INTERRUPT_HANDLER(SPORT0_TX_ISR)
{
	// copy processed data into transmit buffer
	sSPORT0_TX_Buffer[SLOT_TAG]			= sAC97_Tag_Out;
	sSPORT0_TX_Buffer[SLOT_PCM_LEFT]	= sLeft_Channel_Out;
	sSPORT0_TX_Buffer[SLOT_PCM_RIGHT]	= sRight_Channel_Out;

	// re-enable DMA transfer for SPORT0 transmitter; confirm interrupt handling
	sSPORT0_TX_Descriptor[0]	= 0x8005;
	*pSPORT0_DESCR_RDY_TX		= 0x0001;
	*pSPORT0_IRQSTAT_TX			= 0x0001;

	// delete flags and audio values, so that for the next unused frame the slots are empty
	// (necessary for sample rates smaller than 48 kHz)
	sAC97_Tag_Out		= 0x8000;
	sLeft_Channel_Out	= 0x0000;
	sRight_Channel_Out	= 0x0000;
}

//--------------------------------------------------------------------------//
// Function:	SPORT0_RX_ISR												//
//																			//
// Parameters:	None														//
//																			//
// Return:		None														//
//																			//
// Description:	This interrupt handler for SPORT0 RX copies the received	//
//				audio data and the corresponding Tag from the DMA receive	//
//				buffer into some variables. It then re-enables the DMA		//
//				transfer. The flag sNew_Sample_Received is set, which can	//
//				can be tested in main to call the audio processing routine.	//
//--------------------------------------------------------------------------//
EX_INTERRUPT_HANDLER(SPORT0_RX_ISR)
{
	if(sSPORT0_RX_Buffer[SLOT_TAG] & 0x1800)
	{
		// save new values in variables
		sAC97_Tag_In		= sSPORT0_RX_Buffer[SLOT_TAG];
		sLeft_Channel_In	= sSPORT0_RX_Buffer[SLOT_PCM_LEFT];
		sRight_Channel_In	= sSPORT0_RX_Buffer[SLOT_PCM_RIGHT];

		// set flag, indicating that a new sample has been received; can be checked in main
		sNew_Sample_Received = 1;
	}

	// re-enable DMA transfer for SPORT0 receiver; confirm interrupt handling
	sSPORT0_RX_Descriptor[0]	= 0x8007;
	*pSPORT0_DESCR_RDY_RX		= 0x0001;
	*pSPORT0_IRQSTAT_RX			= 0x0001;
}

⌨️ 快捷键说明

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