Production Test Program (PTP) for the LPC4088 Experiment Base Board
Dependencies: EALib I2S LM75B SDFileSystem mbed
TestDisplay.h@2:2f4b7535ceb3, 2014-08-28 (annotated)
- Committer:
- embeddedartists
- Date:
- Thu Aug 28 09:36:13 2014 +0000
- Revision:
- 2:2f4b7535ceb3
Moved each test into separate classes.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 2:2f4b7535ceb3 | 1 | /* |
embeddedartists | 2:2f4b7535ceb3 | 2 | * Copyright 2013 Embedded Artists AB |
embeddedartists | 2:2f4b7535ceb3 | 3 | * |
embeddedartists | 2:2f4b7535ceb3 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
embeddedartists | 2:2f4b7535ceb3 | 5 | * you may not use this file except in compliance with the License. |
embeddedartists | 2:2f4b7535ceb3 | 6 | * You may obtain a copy of the License at |
embeddedartists | 2:2f4b7535ceb3 | 7 | * |
embeddedartists | 2:2f4b7535ceb3 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
embeddedartists | 2:2f4b7535ceb3 | 9 | * |
embeddedartists | 2:2f4b7535ceb3 | 10 | * Unless required by applicable law or agreed to in writing, software |
embeddedartists | 2:2f4b7535ceb3 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
embeddedartists | 2:2f4b7535ceb3 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
embeddedartists | 2:2f4b7535ceb3 | 13 | * See the License for the specific language governing permissions and |
embeddedartists | 2:2f4b7535ceb3 | 14 | * limitations under the License. |
embeddedartists | 2:2f4b7535ceb3 | 15 | */ |
embeddedartists | 2:2f4b7535ceb3 | 16 | |
embeddedartists | 2:2f4b7535ceb3 | 17 | #ifndef TESTDISPLAY_H |
embeddedartists | 2:2f4b7535ceb3 | 18 | #define TESTDISPLAY_H |
embeddedartists | 2:2f4b7535ceb3 | 19 | |
embeddedartists | 2:2f4b7535ceb3 | 20 | #include "AR1021I2C.h" |
embeddedartists | 2:2f4b7535ceb3 | 21 | #include "Graphics.h" |
embeddedartists | 2:2f4b7535ceb3 | 22 | #include "LcdController.h" |
embeddedartists | 2:2f4b7535ceb3 | 23 | #include "EaLcdBoardGPIO.h" |
embeddedartists | 2:2f4b7535ceb3 | 24 | |
embeddedartists | 2:2f4b7535ceb3 | 25 | /** |
embeddedartists | 2:2f4b7535ceb3 | 26 | * Test the display connected with a FPC cable to the LPC4088 Experiment Base Board |
embeddedartists | 2:2f4b7535ceb3 | 27 | * as well as the AR1021 touch sensor on the board. |
embeddedartists | 2:2f4b7535ceb3 | 28 | */ |
embeddedartists | 2:2f4b7535ceb3 | 29 | class TestDisplay { |
embeddedartists | 2:2f4b7535ceb3 | 30 | public: |
embeddedartists | 2:2f4b7535ceb3 | 31 | |
embeddedartists | 2:2f4b7535ceb3 | 32 | /** |
embeddedartists | 2:2f4b7535ceb3 | 33 | * Create an interface to the display |
embeddedartists | 2:2f4b7535ceb3 | 34 | */ |
embeddedartists | 2:2f4b7535ceb3 | 35 | TestDisplay(); |
embeddedartists | 2:2f4b7535ceb3 | 36 | ~TestDisplay(); |
embeddedartists | 2:2f4b7535ceb3 | 37 | |
embeddedartists | 2:2f4b7535ceb3 | 38 | /** |
embeddedartists | 2:2f4b7535ceb3 | 39 | * Use the RED or GREEN LEDs to signal failure/success |
embeddedartists | 2:2f4b7535ceb3 | 40 | */ |
embeddedartists | 2:2f4b7535ceb3 | 41 | void showStatus(bool success); |
embeddedartists | 2:2f4b7535ceb3 | 42 | |
embeddedartists | 2:2f4b7535ceb3 | 43 | /** |
embeddedartists | 2:2f4b7535ceb3 | 44 | * Test the display |
embeddedartists | 2:2f4b7535ceb3 | 45 | * |
embeddedartists | 2:2f4b7535ceb3 | 46 | * @return true if the test was successful; otherwise false |
embeddedartists | 2:2f4b7535ceb3 | 47 | */ |
embeddedartists | 2:2f4b7535ceb3 | 48 | bool runTest(); |
embeddedartists | 2:2f4b7535ceb3 | 49 | |
embeddedartists | 2:2f4b7535ceb3 | 50 | private: |
embeddedartists | 2:2f4b7535ceb3 | 51 | |
embeddedartists | 2:2f4b7535ceb3 | 52 | void drawBars(); |
embeddedartists | 2:2f4b7535ceb3 | 53 | void calibrate_drawMarker(Graphics &g, uint16_t x, uint16_t y, bool erase); |
embeddedartists | 2:2f4b7535ceb3 | 54 | bool calibrate_display(); |
embeddedartists | 2:2f4b7535ceb3 | 55 | |
embeddedartists | 2:2f4b7535ceb3 | 56 | LcdController::Config _lcdCfg; |
embeddedartists | 2:2f4b7535ceb3 | 57 | EaLcdBoardGPIO _lcdBoard; |
embeddedartists | 2:2f4b7535ceb3 | 58 | AR1021I2C _touch; |
embeddedartists | 2:2f4b7535ceb3 | 59 | |
embeddedartists | 2:2f4b7535ceb3 | 60 | uint32_t _framebuffer; |
embeddedartists | 2:2f4b7535ceb3 | 61 | bool _displayWorking; |
embeddedartists | 2:2f4b7535ceb3 | 62 | }; |
embeddedartists | 2:2f4b7535ceb3 | 63 | |
embeddedartists | 2:2f4b7535ceb3 | 64 | #endif |
embeddedartists | 2:2f4b7535ceb3 | 65 |