CQエレクトロニクス・セミナ「実習・マイコンを動かしながら学ぶディジタル・フィルタ」で使うプログラムを,入力として STM32F746 の内蔵 ADC を使うように変更したもの. http://seminar.cqpub.co.jp/ccm/ES18-0020
Dependencies: mbed Array_Matrix BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG
Diff: F746_Gui_New/ResetButton.hpp
- Revision:
- 0:ab7a35d87173
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/F746_Gui_New/ResetButton.hpp Sat Oct 07 03:28:40 2017 +0000 @@ -0,0 +1,46 @@ +//----------------------------------------------------------- +// ResetButton class -- derived class of Button class +// +// 2017/01/16, Copyright (c) 2017 MIKAMI, Naoki +//----------------------------------------------------------- + +#ifndef F746_RESET_BUTTON_HPP +#define F746_RESET_BUTTON_HPP + +#include "Button.hpp" + +namespace Mikami +{ + class ResetButton : public Button + { + public: + ResetButton(uint16_t x = 0, uint16_t y = 240, + uint16_t w = 32, uint16_t h = 32) + : Button(x, y, w, h) + { + pt_[0] = (Point){x+0.2f*w, y+h/2}; + pt_[1] = (Point){x+0.75f*w, y+0.175f*h}; + pt_[2] = (Point){x+0.75f*w, y+0.825f*h}; + Draw(); + } + + void DoIfTouched() + { + if (!Touched()) return; + + wait(0.2f); + NVIC_SystemReset(); + } + + void Draw() + { + Activate(); + lcd_.SetTextColor(LCD_COLOR_WHITE); + lcd_.FillPolygon(pt_, 3); + } + + private: + Point pt_[3]; + }; +} +#endif // F746_RESET_BUTTON_HPP