Automate écran capacitif

Dependencies:   BSP_DISCO_F469NI LCD_DISCO_F469NI SeeedStudioTFTv2 TFT_fonts mbed

Fork of DISCO-F469NI_LCD_demo by ST

Committer:
SquirrelGod
Date:
Fri Mar 31 15:36:26 2017 +0000
Revision:
2:2182df2d7810
Programme ?cran capacitif

Who changed what in which revision?

UserRevisionLine numberNew contents of line
SquirrelGod 2:2182df2d7810 1 //-----------------------------------------------------------
SquirrelGod 2:2182df2d7810 2 // GuiBase class (abstract base class)
SquirrelGod 2:2182df2d7810 3 //
SquirrelGod 2:2182df2d7810 4 // 2016/03/29, Copyright (c) 2016 MIKAMI, Naoki
SquirrelGod 2:2182df2d7810 5 //-----------------------------------------------------------
SquirrelGod 2:2182df2d7810 6
SquirrelGod 2:2182df2d7810 7 #include "GuiBase.hpp"
SquirrelGod 2:2182df2d7810 8
SquirrelGod 2:2182df2d7810 9 namespace Mikami
SquirrelGod 2:2182df2d7810 10 {
SquirrelGod 2:2182df2d7810 11 GuiBase::GuiBase(
SquirrelGod 2:2182df2d7810 12 uint16_t x, uint16_t y, sFONT &fonts,
SquirrelGod 2:2182df2d7810 13 uint32_t textColor, uint32_t backColor,
SquirrelGod 2:2182df2d7810 14 uint32_t createdColor, uint32_t touchedColor,
SquirrelGod 2:2182df2d7810 15 uint32_t inactiveColor, uint32_t inactiveTextColor)
SquirrelGod 2:2182df2d7810 16 : X_(x), Y_(y), FONTS_(&fonts),
SquirrelGod 2:2182df2d7810 17 TEXT_COLOR_(textColor), BACK_COLOR_(backColor),
SquirrelGod 2:2182df2d7810 18 CREATED_COLOR_(createdColor),
SquirrelGod 2:2182df2d7810 19 TOUCHED_COLOR_(touchedColor),
SquirrelGod 2:2182df2d7810 20 INACTIVE_COLOR_(inactiveColor),
SquirrelGod 2:2182df2d7810 21 INACTIVE_TEXT_COLOR_(inactiveTextColor)
SquirrelGod 2:2182df2d7810 22 {
SquirrelGod 2:2182df2d7810 23 if (first_)
SquirrelGod 2:2182df2d7810 24 {
SquirrelGod 2:2182df2d7810 25 lcd_.Clear(backColor);
SquirrelGod 2:2182df2d7810 26 first_ = false;
SquirrelGod 2:2182df2d7810 27 }
SquirrelGod 2:2182df2d7810 28 }
SquirrelGod 2:2182df2d7810 29
SquirrelGod 2:2182df2d7810 30 // If panel touched, return true
SquirrelGod 2:2182df2d7810 31 bool GuiBase::PanelTouched()
SquirrelGod 2:2182df2d7810 32 {
SquirrelGod 2:2182df2d7810 33 ts_.GetState(&state_);
SquirrelGod 2:2182df2d7810 34 return (bool)(state_.touchDetected);
SquirrelGod 2:2182df2d7810 35 }
SquirrelGod 2:2182df2d7810 36
SquirrelGod 2:2182df2d7810 37 LCD_DISCO_F469NI GuiBase::lcd_;
SquirrelGod 2:2182df2d7810 38 TS_DISCO_F469NI GuiBase::ts_;
SquirrelGod 2:2182df2d7810 39
SquirrelGod 2:2182df2d7810 40 TS_StateTypeDef GuiBase::state_;
SquirrelGod 2:2182df2d7810 41
SquirrelGod 2:2182df2d7810 42 bool GuiBase::multiTouch_ = false;
SquirrelGod 2:2182df2d7810 43 bool GuiBase::first_ = true;
SquirrelGod 2:2182df2d7810 44 }