LCD implementation of our project.

Dependencies:   mbed mbed-rtos MLX90614

Committer:
ovidiup13
Date:
Wed Jun 03 17:42:47 2015 +0000
Revision:
10:97389d774ae1
Parent:
8:81ed1135ba02
working version, comment out thermo in main;

Who changed what in which revision?

UserRevisionLine numberNew 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 4:024e6a9c2ebf 5 #include "rtos.h"
ovidiup13 7:11675c1dce4f 6 #include "gyro.h"
ovidiup13 8:81ed1135ba02 7 #include "mbed.h"
ovidiup13 6:49a007861c76 8
ovidiup13 6:49a007861c76 9 //screen configuration
ovidiup13 0:1e597b0f8b3b 10 #define LEFT_MARGIN 5
ovidiup13 0:1e597b0f8b3b 11 #define DEFAULT_COLOR 20
ovidiup13 0:1e597b0f8b3b 12
ovidiup13 5:5b1a8ad6c187 13 #define SCREEN_WIDTH 128
ovidiup13 5:5b1a8ad6c187 14 #define SCREEN_HEIGHT 64
ovidiup13 5:5b1a8ad6c187 15
ovidiup13 6:49a007861c76 16 //control macros
ovidiup13 6:49a007861c76 17 #define NL 121 //select - y
ovidiup13 6:49a007861c76 18 #define UP 119 //up - w
ovidiup13 6:49a007861c76 19 #define DOWN 115 //down - s
ovidiup13 6:49a007861c76 20
ovidiup13 6:49a007861c76 21 //threading macros
ovidiup13 5:5b1a8ad6c187 22 #define START_THREAD 1
ovidiup13 5:5b1a8ad6c187 23 #define PAUSE_THREAD 2
ovidiup13 5:5b1a8ad6c187 24
ovidiup13 0:1e597b0f8b3b 25 class Item {
ovidiup13 0:1e597b0f8b3b 26 public:
ovidiup13 0:1e597b0f8b3b 27 //name
ovidiup13 0:1e597b0f8b3b 28 char * title;
ovidiup13 0:1e597b0f8b3b 29 ST7565 * st7565;
ovidiup13 0:1e597b0f8b3b 30 bool isSelectable;
ovidiup13 3:688b62ff6474 31 Item *selectedScreen, *back;
ovidiup13 0:1e597b0f8b3b 32
ovidiup13 0:1e597b0f8b3b 33 //declare pure virtual functions
ovidiup13 0:1e597b0f8b3b 34 virtual void display(void) = 0;
ovidiup13 0:1e597b0f8b3b 35 virtual void update(char c) = 0;
ovidiup13 0:1e597b0f8b3b 36
ovidiup13 2:fcde41900fa5 37 //get title function
ovidiup13 2:fcde41900fa5 38 char * getTitle(void){
ovidiup13 2:fcde41900fa5 39 return title;
ovidiup13 2:fcde41900fa5 40 }
ovidiup13 2:fcde41900fa5 41
ovidiup13 3:688b62ff6474 42 Item * getSelectedScreen(){
ovidiup13 3:688b62ff6474 43 return selectedScreen;
ovidiup13 0:1e597b0f8b3b 44 }
ovidiup13 3:688b62ff6474 45
ovidiup13 3:688b62ff6474 46 void setSelectedScreen(Item *s){
ovidiup13 3:688b62ff6474 47 selectedScreen = s;
ovidiup13 0:1e597b0f8b3b 48 }
ovidiup13 0:1e597b0f8b3b 49 };
ovidiup13 0:1e597b0f8b3b 50
ovidiup13 0:1e597b0f8b3b 51 #endif