A basic graphics package for the LPC4088 Display Module.
Dependents: lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI lpc4088_displaymodule_fs_aid ... more
Fork of DMBasicGUI by
Application/AppTouchCalibration.h@22:f0d00f29bfeb, 2019-11-04 (annotated)
- Committer:
- embeddedartists
- Date:
- Mon Nov 04 14:31:50 2019 +0000
- Revision:
- 22:f0d00f29bfeb
- Parent:
- 17:6e2abf107800
More updates related to mbed OS 5
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 1:46c8df4608c8 | 1 | /* |
embeddedartists | 1:46c8df4608c8 | 2 | * Copyright 2014 Embedded Artists AB |
embeddedartists | 1:46c8df4608c8 | 3 | * |
embeddedartists | 1:46c8df4608c8 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
embeddedartists | 1:46c8df4608c8 | 5 | * you may not use this file except in compliance with the License. |
embeddedartists | 1:46c8df4608c8 | 6 | * You may obtain a copy of the License at |
embeddedartists | 1:46c8df4608c8 | 7 | * |
embeddedartists | 1:46c8df4608c8 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
embeddedartists | 1:46c8df4608c8 | 9 | * |
embeddedartists | 1:46c8df4608c8 | 10 | * Unless required by applicable law or agreed to in writing, software |
embeddedartists | 1:46c8df4608c8 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
embeddedartists | 1:46c8df4608c8 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
embeddedartists | 1:46c8df4608c8 | 13 | * See the License for the specific language governing permissions and |
embeddedartists | 1:46c8df4608c8 | 14 | * limitations under the License. |
embeddedartists | 1:46c8df4608c8 | 15 | */ |
embeddedartists | 1:46c8df4608c8 | 16 | |
embeddedartists | 0:4977187e90c7 | 17 | #ifndef APP_TOUCHCALIBRATION_H |
embeddedartists | 0:4977187e90c7 | 18 | #define APP_TOUCHCALIBRATION_H |
embeddedartists | 0:4977187e90c7 | 19 | |
embeddedartists | 0:4977187e90c7 | 20 | #include "App.h" |
embeddedartists | 0:4977187e90c7 | 21 | #include "DMBoard.h" |
embeddedartists | 0:4977187e90c7 | 22 | #include "lpc_swim.h" |
embeddedartists | 17:6e2abf107800 | 23 | #include "ImageButton.h" |
embeddedartists | 17:6e2abf107800 | 24 | #include "Resource.h" |
embeddedartists | 0:4977187e90c7 | 25 | |
embeddedartists | 0:4977187e90c7 | 26 | /** |
embeddedartists | 14:647b1896ed84 | 27 | * An App example guiding the user through the steps needed to (re)calibrate the |
embeddedartists | 1:46c8df4608c8 | 28 | * touch controller. After the user presses each of the four corner for calibration |
embeddedartists | 1:46c8df4608c8 | 29 | * the program turns into a very simple drawing application until the Done button |
embeddedartists | 1:46c8df4608c8 | 30 | * is pressed. |
embeddedartists | 0:4977187e90c7 | 31 | * |
embeddedartists | 1:46c8df4608c8 | 32 | * The purpose of this example is to show how to (re)calibrate the touch controller |
embeddedartists | 1:46c8df4608c8 | 33 | * if that is ever needed. |
embeddedartists | 0:4977187e90c7 | 34 | */ |
embeddedartists | 0:4977187e90c7 | 35 | class AppTouchCalibration : public App { |
embeddedartists | 0:4977187e90c7 | 36 | public: |
embeddedartists | 0:4977187e90c7 | 37 | |
embeddedartists | 0:4977187e90c7 | 38 | AppTouchCalibration(); |
embeddedartists | 10:651861441108 | 39 | virtual ~AppTouchCalibration(); |
embeddedartists | 0:4977187e90c7 | 40 | |
embeddedartists | 0:4977187e90c7 | 41 | virtual bool setup(); |
embeddedartists | 0:4977187e90c7 | 42 | virtual void runToCompletion(); |
embeddedartists | 0:4977187e90c7 | 43 | virtual bool teardown(); |
embeddedartists | 0:4977187e90c7 | 44 | |
embeddedartists | 17:6e2abf107800 | 45 | enum Resources { |
embeddedartists | 17:6e2abf107800 | 46 | Resource_Ok_button, |
embeddedartists | 17:6e2abf107800 | 47 | }; |
embeddedartists | 17:6e2abf107800 | 48 | |
embeddedartists | 17:6e2abf107800 | 49 | /** Specifies the resource to use |
embeddedartists | 17:6e2abf107800 | 50 | * |
embeddedartists | 17:6e2abf107800 | 51 | * Adds a resource for a specific id. This allows the |
embeddedartists | 17:6e2abf107800 | 52 | * user program to select e.g. which image to use and |
embeddedartists | 17:6e2abf107800 | 53 | * if it should be loaded from a file or an array. |
embeddedartists | 17:6e2abf107800 | 54 | * |
embeddedartists | 17:6e2abf107800 | 55 | * @param id the identifier |
embeddedartists | 17:6e2abf107800 | 56 | * @param res the resource |
embeddedartists | 17:6e2abf107800 | 57 | */ |
embeddedartists | 17:6e2abf107800 | 58 | void addResource(Resources id, Resource* res); |
embeddedartists | 17:6e2abf107800 | 59 | |
embeddedartists | 0:4977187e90c7 | 60 | private: |
embeddedartists | 0:4977187e90c7 | 61 | Display* _disp; |
embeddedartists | 0:4977187e90c7 | 62 | TouchPanel* _touch; |
embeddedartists | 0:4977187e90c7 | 63 | SWIM_WINDOW_T* _win; |
embeddedartists | 0:4977187e90c7 | 64 | SWIM_WINDOW_T* _msg; |
embeddedartists | 0:4977187e90c7 | 65 | void* _fb; |
embeddedartists | 17:6e2abf107800 | 66 | ImageButton* _btn; |
embeddedartists | 17:6e2abf107800 | 67 | Resource* _resOk; |
embeddedartists | 0:4977187e90c7 | 68 | |
embeddedartists | 0:4977187e90c7 | 69 | void draw(); |
embeddedartists | 0:4977187e90c7 | 70 | void drawMarker(uint16_t x, uint16_t y, bool erase); |
embeddedartists | 0:4977187e90c7 | 71 | bool calibrate(); |
embeddedartists | 0:4977187e90c7 | 72 | void showStatus(const char* message, int line=0); |
embeddedartists | 0:4977187e90c7 | 73 | }; |
embeddedartists | 0:4977187e90c7 | 74 | |
embeddedartists | 0:4977187e90c7 | 75 | #endif |