LCD implementation of our project.
Dependencies: mbed mbed-rtos MLX90614
Item.h@0:1e597b0f8b3b, 2015-03-20 (annotated)
- Committer:
- ovidiup13
- Date:
- Fri Mar 20 23:22:41 2015 +0000
- Revision:
- 0:1e597b0f8b3b
- Child:
- 2:fcde41900fa5
initial menu mock-up st7565
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ovidiup13 | 0:1e597b0f8b3b | 1 | #ifndef _ITEM_H |
ovidiup13 | 0:1e597b0f8b3b | 2 | #define _ITEM_H |
ovidiup13 | 0:1e597b0f8b3b | 3 | |
ovidiup13 | 0:1e597b0f8b3b | 4 | #include "st7565LCD.h" |
ovidiup13 | 0:1e597b0f8b3b | 5 | #include "UserInterface.h" |
ovidiup13 | 0:1e597b0f8b3b | 6 | |
ovidiup13 | 0:1e597b0f8b3b | 7 | #define LEFT_MARGIN 5 |
ovidiup13 | 0:1e597b0f8b3b | 8 | #define DEFAULT_COLOR 20 |
ovidiup13 | 0:1e597b0f8b3b | 9 | |
ovidiup13 | 0:1e597b0f8b3b | 10 | class UI; |
ovidiup13 | 0:1e597b0f8b3b | 11 | |
ovidiup13 | 0:1e597b0f8b3b | 12 | class Item { |
ovidiup13 | 0:1e597b0f8b3b | 13 | public: |
ovidiup13 | 0:1e597b0f8b3b | 14 | //name |
ovidiup13 | 0:1e597b0f8b3b | 15 | char * title; |
ovidiup13 | 0:1e597b0f8b3b | 16 | ST7565 * st7565; |
ovidiup13 | 0:1e597b0f8b3b | 17 | UI * ui; |
ovidiup13 | 0:1e597b0f8b3b | 18 | bool isSelectable; |
ovidiup13 | 0:1e597b0f8b3b | 19 | |
ovidiup13 | 0:1e597b0f8b3b | 20 | //declare pure virtual functions |
ovidiup13 | 0:1e597b0f8b3b | 21 | virtual void display(void) = 0; |
ovidiup13 | 0:1e597b0f8b3b | 22 | virtual void update(char c) = 0; |
ovidiup13 | 0:1e597b0f8b3b | 23 | virtual char * getTitle(void) = 0; |
ovidiup13 | 0:1e597b0f8b3b | 24 | |
ovidiup13 | 0:1e597b0f8b3b | 25 | //constructors |
ovidiup13 | 0:1e597b0f8b3b | 26 | Item(char *title, ST7565 * lcd, UI * ui){ |
ovidiup13 | 0:1e597b0f8b3b | 27 | this->title = title; |
ovidiup13 | 0:1e597b0f8b3b | 28 | this->st7565 = lcd; |
ovidiup13 | 0:1e597b0f8b3b | 29 | } |
ovidiup13 | 0:1e597b0f8b3b | 30 | Item(void){ |
ovidiup13 | 0:1e597b0f8b3b | 31 | title = NULL; |
ovidiup13 | 0:1e597b0f8b3b | 32 | st7565 = NULL; |
ovidiup13 | 0:1e597b0f8b3b | 33 | ui = NULL; |
ovidiup13 | 0:1e597b0f8b3b | 34 | } |
ovidiup13 | 0:1e597b0f8b3b | 35 | }; |
ovidiup13 | 0:1e597b0f8b3b | 36 | |
ovidiup13 | 0:1e597b0f8b3b | 37 | #endif |