Miroslaw K. / Mbed 2 deprecated RadarDemo

Dependencies:   BSP_DISCO_F746NG Graphics mbed TS_DISCO_F746NG

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TouchScreen.h Source File

TouchScreen.h

00001 /*
00002     TouchScreen.h - Touchscreen
00003 
00004     Copyright(c) 2016 karpent at gmail.com, MIT License
00005 
00006     Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
00007     to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008     and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
00009 
00010     The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
00011 
00012     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00013     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00014     OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
00015     THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00016 */
00017 
00018 #pragma once
00019 
00020 #include "TS_DISCO_F746NG.h"
00021 #include "RK043FN48H.h"
00022 
00023 /// <summary>
00024 /// Touchscreen class
00025 /// </summary>
00026 class TouchScreen : public TS_DISCO_F746NG
00027 {
00028 public:
00029     /// <summary>
00030     /// Initializes a new instance of the <see cref="TouchScreen"/> class.
00031     /// </summary>
00032     TouchScreen(Display* display);
00033 
00034     /// <summary>
00035     /// Finalizes an instance of the <see cref="TouchScreen"/> class.
00036     /// </summary>
00037     ~TouchScreen();
00038     
00039   /**
00040     * @brief  Initializes and configures the touch screen functionalities and 
00041     *         configures all necessary hardware resources (GPIOs, I2C, clocks..).
00042     */
00043     void Init();
00044          
00045     /// <summary>
00046     /// Detect a touch.
00047     /// Returns a pointer to tpoch point position or NULL if touch was not detected. 
00048     /// </summary>
00049     pPoint DetectTouch();
00050     
00051     Point touchPoint;
00052     
00053 private:
00054     /// Maximum X size of the TS area on LCD
00055     uint16_t _width;
00056     
00057     /// Maximum Y size of the TS area on LCD
00058     uint16_t _height;
00059     
00060     TS_StateTypeDef tsState;
00061 };
00062