Team Riedel - display

Dependencies:   LCD_fonts SPI_TFT_ILI9341 CMSIS_DSP_401_without_cm4 mbed-src SDFileSystem wavfile

Files at this revision

API Documentation at this revision

Comitter:
linx0576
Date:
Sun Dec 13 17:58:10 2015 +0000
Parent:
9:5a860b9c8a6a
Child:
11:737a2367af3c
Commit message:
test mic 1

Changed in this revision

audio_if.cpp Show annotated file Show diff for this revision Revisions of this file
audio_record.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
stm32l476g_discovery_audio.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/audio_if.cpp	Sun Dec 13 16:46:14 2015 +0000
+++ b/audio_if.cpp	Sun Dec 13 17:58:10 2015 +0000
@@ -81,6 +81,7 @@
 int8_t Audio_Init(void)
 {
     return BSP_AUDIO_IN_Init(48000, 16, 1);
+
 }
 
 
--- a/audio_record.cpp	Sun Dec 13 16:46:14 2015 +0000
+++ b/audio_record.cpp	Sun Dec 13 17:58:10 2015 +0000
@@ -1,7 +1,17 @@
 
 #include "main.h"
 #include "stm32l476g_discovery_audio.h"
-
+//
+#include "SPI_TFT_ILI9341.h"
+#include <math.h>
+#include "stdio.h"
+#include "mbed.h"
+#include "string"
+#include "Arial12x12.h"
+#include "Arial24x23.h"
+#include "arm_math.h" 
+#include "SDFileSystem.h"
+//
 //GLOBAL VARIABLES 
 float32_t POWER[1024];
 float32_t PHS[1024];
@@ -12,10 +22,12 @@
 float32_t CONTROLPHS[1024]; //CTONROL 0 PHS
 float32_t CONTROLPWRMSE;//CONTROL PWR MSE
 float32_t CONTROLPHSMSE;//CONTROL PHS MSE
+extern SPI_TFT_ILI9341 TFT;
 
                                                         
 void RECORD(void)
 {
+    int row =0;
     uint32_t counter=0;
     int EXIT=0; //WHILE LOOP EXIT FLAG
 //    uint16_t PDMBUFF[1536];
@@ -28,22 +40,25 @@
     pc.printf("Initializing Audio...\r\n");                          
     if(Audio_Init()!= AUDIO_OK)
         {
-        pc.printf("FAILED to initialize audio...\r\n");
+        TFT.locate(10,row); TFT.printf("FAILED to initialize audio...\r\n"); row+=20; 
+        //pc.printf("FAILED to initialize audio...\r\n");
         }
-    pc.printf("Initialization completed successfully.\r\n");
-  
+    //pc.printf("Initialization completed successfully.\r\n");
+    else 
+    {TFT.locate(10,row); TFT.printf("Initialization completed successfully.\r\n"); row+=20;}
   /* Start the audio record */
 
         if (Audio_Record(RECORDBUFF) != AUDIO_OK)
             {
-                pc.printf("FAILED to begin recording...\r\n");
+                TFT.locate(10,row); TFT.printf("FAILED to begin recording...\r\n"); row+=20;
+//                pc.printf("FAILED to begin recording...\r\n");
             } 
             
 //    pc.printf("DMA\tSPI\tRXNE\tBSY\tCRCERR\tOVR\r\n");
   
   /* PCM samples recording loop */
-  RecordBufferOffset = BUFFER_OFFSET_NONE;
-  while (RecordBufferOffset != BUFFER_OFFSET_FULL);
+//  RecordBufferOffset = BUFFER_OFFSET_NONE;
+//  while (RecordBufferOffset != BUFFER_OFFSET_FULL);
   
 //  while (EXIT != SET)
 //  {
@@ -59,7 +74,8 @@
 //  }
   /* Stop audio input */
     Audio_Stop();
-    pc.printf("Audio recording processed successfully!\r\n");
+    TFT.locate(10,row); TFT.printf("Audio recording processed successfully!\r\n"); row+=20;
+//    pc.printf("Audio recording processed successfully!\r\n");
     //myled = 0;
     WriteData(RECORDBUFF);
         
--- a/main.cpp	Sun Dec 13 16:46:14 2015 +0000
+++ b/main.cpp	Sun Dec 13 17:58:10 2015 +0000
@@ -457,6 +457,7 @@
             TFT.foreground(White);
             TFT.locate(40, 240);
             printf(" recording\n  comparison...");
+            TFT.set_font((unsigned char*) Arial12x12);
             //DFSDM CORE
                 pc.printf("\r\n\r\nEntering AudioRecord_demo()...\r\n");
                 RECORD();   // RECORD CONTROL 0
--- a/stm32l476g_discovery_audio.cpp	Sun Dec 13 16:46:14 2015 +0000
+++ b/stm32l476g_discovery_audio.cpp	Sun Dec 13 17:58:10 2015 +0000
@@ -426,6 +426,7 @@
   */
 uint8_t BSP_AUDIO_IN_Record(uint16_t* pbuf, uint32_t size)
 {
+  
   hAudioIn.pRecBuf = pbuf;
   hAudioIn.RecSize = size;
 
@@ -832,7 +833,7 @@
   hAudioIn.hDfsdmLeftChannel.Init.Offset                   = 0;
   hAudioIn.hDfsdmLeftChannel.Init.RightBitShift            = DFSDMRightBitShift(AudioFreq);
 
-  hAudioIn.hDfsdmLeftChannel.Instance                      = DFSDM_Channel2;
+  hAudioIn.hDfsdmLeftChannel.Instance                      = DFSDM_Channel4;
 
     /* Init the DFSDM Channel */
   if (HAL_DFSDM_ChannelInit(&hAudioIn.hDfsdmLeftChannel) != HAL_OK)
@@ -864,7 +865,7 @@
   
   /* Configure regular channel */
   if (HAL_DFSDM_FilterConfigRegChannel(&BSP_AUDIO_hDfsdmLeftFilter, 
-                                      DFSDM_CHANNEL_2, 
+                                      DFSDM_CHANNEL_4, 
                                       DFSDM_CONTINUOUS_CONV_ON) != HAL_OK)
   {
     return AUDIO_ERROR;