![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
CQエレクトロニクス・セミナ「実習・マイコンを動かしながら学ぶディジタル・フィルタ」で使うプログラム.1次IIRフィルタの係数をターミナルから変更できる. http://seminar.cqpub.co.jp/ccm/ES18-0020
Dependencies: mbed Array_Matrix BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG
F746_Gui_New/GuiBase.hpp@0:47718d3154d9, 2017-10-09 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Mon Oct 09 02:36:11 2017 +0000
- Revision:
- 0:47718d3154d9
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 0:47718d3154d9 | 1 | //----------------------------------------------------------- |
MikamiUitOpen | 0:47718d3154d9 | 2 | // GuiBase class (abstract base class) ---- Header |
MikamiUitOpen | 0:47718d3154d9 | 3 | // |
MikamiUitOpen | 0:47718d3154d9 | 4 | // 2017/03/17, Copyright (c) 2017 MIKAMI, Naoki |
MikamiUitOpen | 0:47718d3154d9 | 5 | //----------------------------------------------------------- |
MikamiUitOpen | 0:47718d3154d9 | 6 | |
MikamiUitOpen | 0:47718d3154d9 | 7 | #ifndef F746_GUI_BASE_HPP |
MikamiUitOpen | 0:47718d3154d9 | 8 | #define F746_GUI_BASE_HPP |
MikamiUitOpen | 0:47718d3154d9 | 9 | |
MikamiUitOpen | 0:47718d3154d9 | 10 | #include "mbed.h" |
MikamiUitOpen | 0:47718d3154d9 | 11 | #include <string> |
MikamiUitOpen | 0:47718d3154d9 | 12 | #include "TS_DISCO_F746NG.h" |
MikamiUitOpen | 0:47718d3154d9 | 13 | #include "LCD_DISCO_F746NG.h" |
MikamiUitOpen | 0:47718d3154d9 | 14 | |
MikamiUitOpen | 0:47718d3154d9 | 15 | namespace Mikami |
MikamiUitOpen | 0:47718d3154d9 | 16 | { |
MikamiUitOpen | 0:47718d3154d9 | 17 | class GuiBase |
MikamiUitOpen | 0:47718d3154d9 | 18 | { |
MikamiUitOpen | 0:47718d3154d9 | 19 | public: |
MikamiUitOpen | 0:47718d3154d9 | 20 | static LCD_DISCO_F746NG& GetLcd() { return lcd_; } |
MikamiUitOpen | 0:47718d3154d9 | 21 | static TS_DISCO_F746NG& GetTs() { return ts_; } |
MikamiUitOpen | 0:47718d3154d9 | 22 | |
MikamiUitOpen | 0:47718d3154d9 | 23 | // If panel touched, return true |
MikamiUitOpen | 0:47718d3154d9 | 24 | static bool PanelTouched(); |
MikamiUitOpen | 0:47718d3154d9 | 25 | // Get touch panel state |
MikamiUitOpen | 0:47718d3154d9 | 26 | static TS_StateTypeDef GetTsState() { return state_; } |
MikamiUitOpen | 0:47718d3154d9 | 27 | |
MikamiUitOpen | 0:47718d3154d9 | 28 | enum { ENUM_TEXT = 0xFFFFFFFF, ENUM_BACK = 0xFF003538, |
MikamiUitOpen | 0:47718d3154d9 | 29 | ENUM_CREATED = 0xFF0068B7, ENUM_TOUCHED = 0xFF7F7FFF, |
MikamiUitOpen | 0:47718d3154d9 | 30 | ENUM_INACTIVE = 0xD0003538, ENUM_INACTIVE_TEXT = 0xFF808080}; |
MikamiUitOpen | 0:47718d3154d9 | 31 | |
MikamiUitOpen | 0:47718d3154d9 | 32 | protected: |
MikamiUitOpen | 0:47718d3154d9 | 33 | static LCD_DISCO_F746NG lcd_; // for LCD display |
MikamiUitOpen | 0:47718d3154d9 | 34 | static TS_DISCO_F746NG ts_; // for touch pannel |
MikamiUitOpen | 0:47718d3154d9 | 35 | |
MikamiUitOpen | 0:47718d3154d9 | 36 | static TS_StateTypeDef state_; |
MikamiUitOpen | 0:47718d3154d9 | 37 | static bool multiTouch_; |
MikamiUitOpen | 0:47718d3154d9 | 38 | |
MikamiUitOpen | 0:47718d3154d9 | 39 | const uint16_t X_, Y_; |
MikamiUitOpen | 0:47718d3154d9 | 40 | sFONT *const FONTS_; |
MikamiUitOpen | 0:47718d3154d9 | 41 | |
MikamiUitOpen | 0:47718d3154d9 | 42 | const uint32_t TEXT_COLOR_; |
MikamiUitOpen | 0:47718d3154d9 | 43 | const uint32_t BACK_COLOR_; |
MikamiUitOpen | 0:47718d3154d9 | 44 | const uint32_t CREATED_COLOR_; |
MikamiUitOpen | 0:47718d3154d9 | 45 | const uint32_t TOUCHED_COLOR_; |
MikamiUitOpen | 0:47718d3154d9 | 46 | const uint32_t INACTIVE_COLOR_; |
MikamiUitOpen | 0:47718d3154d9 | 47 | const uint32_t INACTIVE_TEXT_COLOR_; |
MikamiUitOpen | 0:47718d3154d9 | 48 | |
MikamiUitOpen | 0:47718d3154d9 | 49 | // Constructor |
MikamiUitOpen | 0:47718d3154d9 | 50 | GuiBase(uint16_t x =0, uint16_t y =0, |
MikamiUitOpen | 0:47718d3154d9 | 51 | sFONT &fonts = Font12, |
MikamiUitOpen | 0:47718d3154d9 | 52 | uint32_t textColor = ENUM_TEXT, |
MikamiUitOpen | 0:47718d3154d9 | 53 | uint32_t backColor = ENUM_BACK, |
MikamiUitOpen | 0:47718d3154d9 | 54 | uint32_t createdColor = ENUM_CREATED, |
MikamiUitOpen | 0:47718d3154d9 | 55 | uint32_t touchedColor = ENUM_TOUCHED, |
MikamiUitOpen | 0:47718d3154d9 | 56 | uint32_t inactiveColor = ENUM_INACTIVE, |
MikamiUitOpen | 0:47718d3154d9 | 57 | uint32_t inactiveTextColor = ENUM_INACTIVE_TEXT); |
MikamiUitOpen | 0:47718d3154d9 | 58 | |
MikamiUitOpen | 0:47718d3154d9 | 59 | void DrawString(uint16_t x, uint16_t y, const string str) |
MikamiUitOpen | 0:47718d3154d9 | 60 | { lcd_.DisplayStringAt(x, y, (uint8_t *)str.c_str(), LEFT_MODE); } |
MikamiUitOpen | 0:47718d3154d9 | 61 | |
MikamiUitOpen | 0:47718d3154d9 | 62 | private: |
MikamiUitOpen | 0:47718d3154d9 | 63 | static bool first_; |
MikamiUitOpen | 0:47718d3154d9 | 64 | |
MikamiUitOpen | 0:47718d3154d9 | 65 | // disallow copy constructor and assignment operator |
MikamiUitOpen | 0:47718d3154d9 | 66 | GuiBase(const GuiBase&); |
MikamiUitOpen | 0:47718d3154d9 | 67 | GuiBase& operator=(const GuiBase&); |
MikamiUitOpen | 0:47718d3154d9 | 68 | }; |
MikamiUitOpen | 0:47718d3154d9 | 69 | } |
MikamiUitOpen | 0:47718d3154d9 | 70 | #endif // F746_GUI_BASE_HPP |