![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Waveform display for input signal using SAI from MEMS microphone or line. MEMS マイクまたはラインから SAI により入力した信号の波形を表示する.
Dependencies: BSP_DISCO_F746NG F746_GUI F746_SAI_IO LCD_DISCO_F746NG TS_DISCO_F746NG mbed
MyClasses/WaveformDisplay.hpp@5:92bb7f2bf714, 2018-03-12 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Mon Mar 12 05:27:19 2018 +0000
- Revision:
- 5:92bb7f2bf714
- Parent:
- 4:bf927b50098b
6
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 0:e2c6c8630aab | 1 | //----------------------------------------------------------- |
MikamiUitOpen | 0:e2c6c8630aab | 2 | // Class for waveform display ---- Header |
MikamiUitOpen | 0:e2c6c8630aab | 3 | // |
MikamiUitOpen | 4:bf927b50098b | 4 | // 2017/03/17, Copyright (c) 2017 MIKAMI, Naoki |
MikamiUitOpen | 0:e2c6c8630aab | 5 | //----------------------------------------------------------- |
MikamiUitOpen | 0:e2c6c8630aab | 6 | |
MikamiUitOpen | 0:e2c6c8630aab | 7 | #ifndef F746_WAVEFORM_DISPLAY_HPP |
MikamiUitOpen | 0:e2c6c8630aab | 8 | #define F746_WAVEFORM_DISPLAY_HPP |
MikamiUitOpen | 0:e2c6c8630aab | 9 | |
MikamiUitOpen | 0:e2c6c8630aab | 10 | #include "mbed.h" |
MikamiUitOpen | 0:e2c6c8630aab | 11 | #include "LCD_DISCO_F746NG.h" |
MikamiUitOpen | 0:e2c6c8630aab | 12 | #include "Array.hpp" |
MikamiUitOpen | 0:e2c6c8630aab | 13 | |
MikamiUitOpen | 0:e2c6c8630aab | 14 | namespace Mikami |
MikamiUitOpen | 0:e2c6c8630aab | 15 | { |
MikamiUitOpen | 0:e2c6c8630aab | 16 | class WaveformDisplay |
MikamiUitOpen | 0:e2c6c8630aab | 17 | { |
MikamiUitOpen | 0:e2c6c8630aab | 18 | public: |
MikamiUitOpen | 4:bf927b50098b | 19 | WaveformDisplay(LCD_DISCO_F746NG &lcd, |
MikamiUitOpen | 0:e2c6c8630aab | 20 | uint16_t x0, uint16_t y0, |
MikamiUitOpen | 0:e2c6c8630aab | 21 | const Array<int16_t>& xn, |
MikamiUitOpen | 0:e2c6c8630aab | 22 | uint16_t rShift, |
MikamiUitOpen | 0:e2c6c8630aab | 23 | uint32_t axisColor, |
MikamiUitOpen | 0:e2c6c8630aab | 24 | uint32_t lineColor, |
MikamiUitOpen | 0:e2c6c8630aab | 25 | uint32_t backColor) |
MikamiUitOpen | 0:e2c6c8630aab | 26 | : X0_(x0), Y0_(y0), xn_(xn), |
MikamiUitOpen | 0:e2c6c8630aab | 27 | N_DATA_(xn.Length()), |
MikamiUitOpen | 0:e2c6c8630aab | 28 | R_SHIFT_(rShift), |
MikamiUitOpen | 0:e2c6c8630aab | 29 | AXIS_COLOR_(axisColor), |
MikamiUitOpen | 0:e2c6c8630aab | 30 | LINE_COLOR_(lineColor), |
MikamiUitOpen | 0:e2c6c8630aab | 31 | BACK_COLOR_(backColor), |
MikamiUitOpen | 0:e2c6c8630aab | 32 | lcd_(lcd) { Axis(); } |
MikamiUitOpen | 0:e2c6c8630aab | 33 | |
MikamiUitOpen | 0:e2c6c8630aab | 34 | void Execute(); |
MikamiUitOpen | 0:e2c6c8630aab | 35 | |
MikamiUitOpen | 0:e2c6c8630aab | 36 | private: |
MikamiUitOpen | 0:e2c6c8630aab | 37 | const uint16_t X0_, Y0_; |
MikamiUitOpen | 0:e2c6c8630aab | 38 | const Array<int16_t>& xn_; |
MikamiUitOpen | 0:e2c6c8630aab | 39 | const int N_DATA_; |
MikamiUitOpen | 0:e2c6c8630aab | 40 | const uint16_t R_SHIFT_; |
MikamiUitOpen | 0:e2c6c8630aab | 41 | const uint32_t AXIS_COLOR_; |
MikamiUitOpen | 0:e2c6c8630aab | 42 | const uint32_t LINE_COLOR_; |
MikamiUitOpen | 0:e2c6c8630aab | 43 | const uint32_t BACK_COLOR_; |
MikamiUitOpen | 0:e2c6c8630aab | 44 | static const int LIMIT_ = 32; |
MikamiUitOpen | 0:e2c6c8630aab | 45 | static const int LIMIT2_ = LIMIT_ + 1; |
MikamiUitOpen | 0:e2c6c8630aab | 46 | |
MikamiUitOpen | 4:bf927b50098b | 47 | LCD_DISCO_F746NG &lcd_; |
MikamiUitOpen | 0:e2c6c8630aab | 48 | |
MikamiUitOpen | 0:e2c6c8630aab | 49 | // Clipping |
MikamiUitOpen | 0:e2c6c8630aab | 50 | uint16_t Clip(int16_t xn); |
MikamiUitOpen | 0:e2c6c8630aab | 51 | |
MikamiUitOpen | 0:e2c6c8630aab | 52 | void Axis(); |
MikamiUitOpen | 0:e2c6c8630aab | 53 | |
MikamiUitOpen | 0:e2c6c8630aab | 54 | // disallow copy constructor and assignment operator |
MikamiUitOpen | 0:e2c6c8630aab | 55 | WaveformDisplay(const WaveformDisplay& ); |
MikamiUitOpen | 0:e2c6c8630aab | 56 | WaveformDisplay& operator=(const WaveformDisplay& ); |
MikamiUitOpen | 0:e2c6c8630aab | 57 | }; |
MikamiUitOpen | 0:e2c6c8630aab | 58 | } |
MikamiUitOpen | 0:e2c6c8630aab | 59 | #endif // F746_WAVEFORM_DISPLAY_HPP |