Demo program of SAI_IO class for audio signal input and output. DISCO-F746 搭載の CODEC (WM8994) を使ってオーディオ信号の入出力を行うための SAI_IO クラスの使用例.

Dependencies:   BSP_DISCO_F746NG F746_GUI F746_SAI_IO LCD_DISCO_F746NG TS_DISCO_F746NG mbed

Revision:
8:6cb2c40946c4
Parent:
4:0beea5d9a205
--- a/WaveformDisplay.hpp	Mon Jan 23 13:35:54 2017 +0000
+++ b/WaveformDisplay.hpp	Thu Mar 16 08:26:07 2017 +0000
@@ -1,7 +1,7 @@
 //-----------------------------------------------------------
 //  Class for waveform display
 //
-//  2016/05/03, Copyright (c) 2016 MIKAMI, Naoki
+//  2017/03/16, Copyright (c) 2017 MIKAMI, Naoki
 //-----------------------------------------------------------
 
 #ifndef F746_WAVEFORM_DISPLAY_HPP
@@ -14,7 +14,7 @@
     class WaveformDisplay
     {
     public:
-        WaveformDisplay(LCD_DISCO_F746NG *lcd,
+        WaveformDisplay(LCD_DISCO_F746NG &lcd,
                         uint16_t x0, uint16_t y0, int nData,
                         uint16_t rShift,
                         uint32_t axisColor, uint32_t lineColor,
@@ -28,7 +28,7 @@
             static const uint16_t LIMIT1 = Y0_ + LIMIT2_;
             static const uint16_t LIMIT2 = Y0_ - LIMIT2_;
             Axis();
-            lcd_->SetTextColor(LINE_COLOR_);
+            lcd_.SetTextColor(LINE_COLOR_);
             uint16_t x1 = X0_;
             uint16_t y1 = Clip(xn[0]);
             for (int n=1; n<N_DATA_; n++)
@@ -38,18 +38,18 @@
                 if ( ((y2 == LIMIT1) && (y1 == LIMIT1)) ||
                      ((y2 == LIMIT2) && (y1 == LIMIT2)) )
                 {   // Out of displaying boundaries
-                    lcd_->SetTextColor(LCD_COLOR_RED);
-                    lcd_->DrawHLine(x1, y1, 1);
-                    lcd_->SetTextColor(LINE_COLOR_);
+                    lcd_.SetTextColor(LCD_COLOR_RED);
+                    lcd_.DrawHLine(x1, y1, 1);
+                    lcd_.SetTextColor(LINE_COLOR_);
                 }
                 else
-                    lcd_->DrawLine(x1, y1, x2, y2);
+                    lcd_.DrawLine(x1, y1, x2, y2);
                 if ((y1 == LIMIT1) || (y1 == LIMIT2))
-                    lcd_->DrawPixel(x1, y1, LCD_COLOR_RED);
+                    lcd_.DrawPixel(x1, y1, LCD_COLOR_RED);
                 x1 = x2;
                 y1 = y2;
             }
-            lcd_->SetTextColor(BACK_COLOR_);
+            lcd_.SetTextColor(BACK_COLOR_);
         }
         
     private:
@@ -63,7 +63,7 @@
         static const int LIMIT_ = 32;
         static const int LIMIT2_ = LIMIT_ + 1;
         
-        LCD_DISCO_F746NG *lcd_;
+        LCD_DISCO_F746NG &lcd_;
         
         // Clipping
         uint16_t Clip(int16_t xn)
@@ -76,11 +76,11 @@
         
         void Axis()
         {
-            lcd_->SetTextColor(BACK_COLOR_);
-            lcd_->FillRect(X0_, Y0_-LIMIT2_, N_DATA_, LIMIT2_*2+1);
+            lcd_.SetTextColor(BACK_COLOR_);
+            lcd_.FillRect(X0_, Y0_-LIMIT2_, N_DATA_, LIMIT2_*2+1);
 
-            lcd_->SetTextColor(AXIS_COLOR_);
-            lcd_->DrawLine(X0_-5, Y0_, X0_+N_DATA_+5, Y0_);
+            lcd_.SetTextColor(AXIS_COLOR_);
+            lcd_.DrawLine(X0_-5, Y0_, X0_+N_DATA_+5, Y0_);
         }        
 
         // disallow copy constructor and assignment operator