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/AppLauncher.h@0:4977187e90c7, 2014-12-11 (annotated)
- Committer:
- embeddedartists
- Date:
- Thu Dec 11 11:03:57 2014 +0000
- Revision:
- 0:4977187e90c7
- Child:
- 1:46c8df4608c8
First version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 0:4977187e90c7 | 1 | |
embeddedartists | 0:4977187e90c7 | 2 | #ifndef APP_LAUNCHER_H |
embeddedartists | 0:4977187e90c7 | 3 | #define APP_LAUNCHER_H |
embeddedartists | 0:4977187e90c7 | 4 | |
embeddedartists | 0:4977187e90c7 | 5 | #include "App.h" |
embeddedartists | 0:4977187e90c7 | 6 | #include "DMBoard.h" |
embeddedartists | 0:4977187e90c7 | 7 | #include "lpc_swim.h" |
embeddedartists | 0:4977187e90c7 | 8 | #include "Button.h" |
embeddedartists | 0:4977187e90c7 | 9 | |
embeddedartists | 0:4977187e90c7 | 10 | /** |
embeddedartists | 0:4977187e90c7 | 11 | * LcdController example |
embeddedartists | 0:4977187e90c7 | 12 | * |
embeddedartists | 0:4977187e90c7 | 13 | * @code |
embeddedartists | 0:4977187e90c7 | 14 | * #include "mbed.h" |
embeddedartists | 0:4977187e90c7 | 15 | * #include "LcdController.h" |
embeddedartists | 0:4977187e90c7 | 16 | * |
embeddedartists | 0:4977187e90c7 | 17 | * LcdController::Config innolux( |
embeddedartists | 0:4977187e90c7 | 18 | * 45, |
embeddedartists | 0:4977187e90c7 | 19 | * 17, |
embeddedartists | 0:4977187e90c7 | 20 | * 2, |
embeddedartists | 0:4977187e90c7 | 21 | * 800, |
embeddedartists | 0:4977187e90c7 | 22 | * 22, |
embeddedartists | 0:4977187e90c7 | 23 | * 22, |
embeddedartists | 0:4977187e90c7 | 24 | * 2, |
embeddedartists | 0:4977187e90c7 | 25 | * 480, |
embeddedartists | 0:4977187e90c7 | 26 | * false, |
embeddedartists | 0:4977187e90c7 | 27 | * false, |
embeddedartists | 0:4977187e90c7 | 28 | * true, |
embeddedartists | 0:4977187e90c7 | 29 | * true, |
embeddedartists | 0:4977187e90c7 | 30 | * true, |
embeddedartists | 0:4977187e90c7 | 31 | * LcdController::Bpp_16_565, |
embeddedartists | 0:4977187e90c7 | 32 | * 36000000, |
embeddedartists | 0:4977187e90c7 | 33 | * LcdController::Tft, |
embeddedartists | 0:4977187e90c7 | 34 | * false); |
embeddedartists | 0:4977187e90c7 | 35 | * |
embeddedartists | 0:4977187e90c7 | 36 | * int main(void) { |
embeddedartists | 0:4977187e90c7 | 37 | * LcdController lcd; |
embeddedartists | 0:4977187e90c7 | 38 | * |
embeddedartists | 0:4977187e90c7 | 39 | * lcd.open(&innolux); |
embeddedartists | 0:4977187e90c7 | 40 | * lcd.setFrameBuffer(frameBuffer); |
embeddedartists | 0:4977187e90c7 | 41 | * lcd.setPower(true); |
embeddedartists | 0:4977187e90c7 | 42 | * |
embeddedartists | 0:4977187e90c7 | 43 | * // draw on the frame buffer |
embeddedartists | 0:4977187e90c7 | 44 | * ... |
embeddedartists | 0:4977187e90c7 | 45 | * } |
embeddedartists | 0:4977187e90c7 | 46 | * @endcode |
embeddedartists | 0:4977187e90c7 | 47 | */ |
embeddedartists | 0:4977187e90c7 | 48 | class AppLauncher : public App { |
embeddedartists | 0:4977187e90c7 | 49 | public: |
embeddedartists | 0:4977187e90c7 | 50 | |
embeddedartists | 0:4977187e90c7 | 51 | AppLauncher(); |
embeddedartists | 0:4977187e90c7 | 52 | ~AppLauncher(); |
embeddedartists | 0:4977187e90c7 | 53 | |
embeddedartists | 0:4977187e90c7 | 54 | virtual bool setup(); |
embeddedartists | 0:4977187e90c7 | 55 | virtual void runToCompletion(); |
embeddedartists | 0:4977187e90c7 | 56 | virtual bool teardown(); |
embeddedartists | 0:4977187e90c7 | 57 | |
embeddedartists | 0:4977187e90c7 | 58 | private: |
embeddedartists | 0:4977187e90c7 | 59 | enum Constants { |
embeddedartists | 0:4977187e90c7 | 60 | TitleHeight = 20, |
embeddedartists | 0:4977187e90c7 | 61 | ButtonWidth = 75, |
embeddedartists | 0:4977187e90c7 | 62 | ButtonHeight = 75, |
embeddedartists | 0:4977187e90c7 | 63 | ButtonRows = 2, |
embeddedartists | 0:4977187e90c7 | 64 | ButtonColumns = 5, |
embeddedartists | 0:4977187e90c7 | 65 | NumberOfButtons = ButtonRows*ButtonColumns, |
embeddedartists | 0:4977187e90c7 | 66 | }; |
embeddedartists | 0:4977187e90c7 | 67 | |
embeddedartists | 0:4977187e90c7 | 68 | Display* _disp; |
embeddedartists | 0:4977187e90c7 | 69 | SWIM_WINDOW_T* _win; |
embeddedartists | 0:4977187e90c7 | 70 | void* _fb; |
embeddedartists | 0:4977187e90c7 | 71 | Button* _buttons[NumberOfButtons]; |
embeddedartists | 0:4977187e90c7 | 72 | int _usedButtons; |
embeddedartists | 0:4977187e90c7 | 73 | |
embeddedartists | 0:4977187e90c7 | 74 | void draw(); |
embeddedartists | 0:4977187e90c7 | 75 | void addButton(uint32_t buttonID, const char* caption); |
embeddedartists | 0:4977187e90c7 | 76 | }; |
embeddedartists | 0:4977187e90c7 | 77 | |
embeddedartists | 0:4977187e90c7 | 78 | #endif |
embeddedartists | 0:4977187e90c7 | 79 | |
embeddedartists | 0:4977187e90c7 | 80 |