Output the audio signal (*.bin) with filtering by IIR filter in the SD card using onboard CODEC. For *.wav file, F746_SD_WavPlayer and F746_SD_GraphicEqualiser are published on mbed. SD カードのオーディオ信号 (*.bin) を遮断周波数可変の IIR フィルタを通して,ボードに搭載されているCODEC で出力する.*.wav 形式のファイル用には,F746_SD_WavPlayer と F746_SD_GraphicEqualiser を mbed で公開している.

Dependencies:   BSP_DISCO_F746NG_patch_fixed F746_GUI LCD_DISCO_F746NG SDFileSystem_Warning_Fixed TS_DISCO_F746NG mbed

MyClasses_Functions/TouchPanelDetectorX.hpp

Committer:
MikamiUitOpen
Date:
2016-04-17
Revision:
5:4a99dabc9180
Parent:
0:6748e3332e85

File content as of revision 5:4a99dabc9180:

//------------------------------------------------------
//  Touch panel detector for x axis class
//
//  2016/03/31, Copyright (c) 2016 MIKAMI, Naoki
//------------------------------------------------------

#ifndef F746_TOUCH_PANELDETECTORX_HPP
#define F746_TOUCH_PANELDETECTORX_HPP

#include "GuiBase.hpp"

namespace Mikami
{
    class TouchPanelDetectorX : public GuiBase
    {
    public:
        // Constructor
        TouchPanelDetectorX(uint16_t x1, uint16_t x2,
                            uint16_t y1, uint16_t y2)
            : X1_(x1), X2_(x2), Y1_(y1), Y2_(y2) {}

        bool IsTouched(uint16_t xIn, uint16_t &xOut)
        {
            GetTsState();
            
            if (!state_.touchDetected) return false;
            
            uint16_t x = state_.touchX[0];
            uint16_t y = state_.touchY[0];

            if ( (x < X1_) || (x > X2_) || (y < Y1_) || (y > Y2_) )
                return false;

            const int WD = 8;
            if ( (x < xIn-WD) || (x > xIn+WD) ) return false;
            
            xOut = (x >= X1_) ? x : X1_;
            xOut = (x <= X2_) ? x : X2_;
            return true;
        }

    private:
        const uint16_t X1_, X2_, Y1_, Y2_;
    };
}   
#endif  // F746_TOUCH_PANELDETECTORX_HPP