76 #define BUFFER_EMPTY 1
77 #define BUFFER_AVAILABLE 2
79 typedef struct ring_buff {
85 static char WelcomeMenu[] =
"\r\nHello NXP Semiconductors \r\n"
86 "I2S DEMO : Connect audio headphone out from computer to line-in on tested board to get audio signal\r\n"
87 "Please press \'1\' to test Polling mode\r\n"
88 "Please press \'2\' to test Interrupt mode\r\n"
89 "Please press \'3\' to test DMA mode\r\n"
90 "Please press \'x\' to exit test mode\r\n"
91 "Please press \'m\' to DISABLE/ENABLE mute\r\n";
147 uint8_t bufferUART, continue_Flag = 1;
151 NVIC_EnableIRQ(I2S0_IRQn);
152 while (continue_Flag) {
155 switch (bufferUART) {
159 NVIC_DisableIRQ(I2S0_IRQn);
177 uint8_t bufferUART, continue_Flag = 1;
179 while (continue_Flag) {
182 switch (bufferUART) {
210 uint8_t continue_Flag = 1, bufferUART = 0xFF;
216 NVIC_DisableIRQ(DMA_IRQn);
217 NVIC_SetPriority(DMA_IRQn, ((0x01 << 3) | 0x01));
218 NVIC_EnableIRQ(DMA_IRQn);
229 while (continue_Flag) {
232 switch (bufferUART) {
239 NVIC_DisableIRQ(DMA_IRQn);
303 uint8_t bufferUART, continue_Flag = 1;
311 #if defined( __GNUC__ )
312 __sys_write(0,
"", 0);
326 while (continue_Flag) {
329 switch (bufferUART) {