Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*****************************************************************************
- * lab11.c
- *****************************************************************************/
- #include <sys/platform.h>
- #include "adi_initialize.h"
- #include "lab13.h"
- #include "Talkthrough.h"
- #include <sysreg.h>
- #include <ccblkfn.h>
- /*****************************************************************************
- Variables
- Description: The variables ChannelxLeftIn and ChannelxRightIn contain
- the data coming from the codec ADC (AD1871). The (processed)
- playback data are written into the variables
- ChannelxLeftOut and ChannelxRightOut respectively, which
- are then sent back to the DAC (AD1854) in the SPORT0 ISR.
- ******************************************************************************/
- // left input data from AD1871
- int iChannel0LeftIn, iChannel1LeftIn;
- // right input data from AD1871
- int iChannel0RightIn, iChannel1RightIn;
- // left ouput data for AD1854
- int iChannel0LeftOut, iChannel1LeftOut;
- // right ouput data for AD1854
- int iChannel0RightOut, iChannel1RightOut;
- // SPORT0 DMA transmit buffer
- int iTxBuffer1[2];
- // SPORT0 DMA receive buffer
- int iRxBuffer1[2];
- int wr_ptr = 0;
- float LFO = 0.0;
- float carrerAmplitude = 0.5;
- int FS = 44100;
- float carrerFrequency = 20.0 / 44100;
- float minValue = 1000;
- float maxValue = 3000;
- float L=1;
- int BUFFER_SIZE = 2500;
- int circularBuffer[3000];
- //--------------------------------------------------------------------------//
- // Function: main //
- // //
- // Description: After calling a few initalization routines, main() just //
- // waits in a loop forever. The code to process the incoming //
- // data can be placed in the function Process_Data() in the //
- // file "Process_Data.c". //
- //--------------------------------------------------------------------------//
- void main(void)
- {
- Init_Flags();
- Audio_Reset();
- Init_Sport0();
- Init_DMA();
- Init_Interrupts();
- Enable_DMA_Sport0();
- while(1)
- {
- if(*pPORTFIO & (1 << 2))
- {
- while(*pPORTFIO & (1 << 2));
- L++;
- }
- if(*pPORTFIO & (1 << 3))
- {
- while(*pPORTFIO & (1 << 3));
- L--;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement