?? isrs.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 + -