LCD implementation of our project.

Dependencies:   mbed mbed-rtos MLX90614

Committer:
ovidiup13
Date:
Mon May 25 14:46:39 2015 +0000
Revision:
4:024e6a9c2ebf
Parent:
3:688b62ff6474
Child:
6:49a007861c76
updated compass with threading

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ovidiup13 0:1e597b0f8b3b 1 #ifndef _UI_H_
ovidiup13 0:1e597b0f8b3b 2 #define _UI_H_
ovidiup13 0:1e597b0f8b3b 3
ovidiup13 3:688b62ff6474 4 //include files
ovidiup13 3:688b62ff6474 5 #include "st7565LCD.h"
ovidiup13 3:688b62ff6474 6 #include "Header.h"
ovidiup13 3:688b62ff6474 7 #include "Item.h"
ovidiup13 3:688b62ff6474 8 #include "Menu.h"
ovidiup13 3:688b62ff6474 9 #include "Compass.h"
ovidiup13 3:688b62ff6474 10 #include "LevelMeter.h"
ovidiup13 3:688b62ff6474 11 #include "Measure.h"
ovidiup13 3:688b62ff6474 12
ovidiup13 3:688b62ff6474 13 //include libs
ovidiup13 0:1e597b0f8b3b 14 #include <string.h>
ovidiup13 0:1e597b0f8b3b 15 #include <assert.h>
ovidiup13 0:1e597b0f8b3b 16 #include <stdio.h>
ovidiup13 0:1e597b0f8b3b 17 #include <stdlib.h>
ovidiup13 0:1e597b0f8b3b 18
ovidiup13 0:1e597b0f8b3b 19 //define brightness and contrast
ovidiup13 0:1e597b0f8b3b 20 #define _DEFAULT_BRIGHTNESS 25
ovidiup13 0:1e597b0f8b3b 21 #define _DEFAULT_CONTRAST 20
ovidiup13 0:1e597b0f8b3b 22 #define _MAX_BRIGHTNESS 200
ovidiup13 0:1e597b0f8b3b 23 #define _MIN_BRIGHTNESS 10
ovidiup13 0:1e597b0f8b3b 24
ovidiup13 0:1e597b0f8b3b 25 //define default color
ovidiup13 0:1e597b0f8b3b 26 #define _DEFAULT_COLOR 20
ovidiup13 0:1e597b0f8b3b 27
ovidiup13 0:1e597b0f8b3b 28 using namespace std;
ovidiup13 0:1e597b0f8b3b 29
ovidiup13 0:1e597b0f8b3b 30 class Item;
ovidiup13 0:1e597b0f8b3b 31
ovidiup13 0:1e597b0f8b3b 32 class UI {
ovidiup13 0:1e597b0f8b3b 33 public:
ovidiup13 0:1e597b0f8b3b 34
ovidiup13 0:1e597b0f8b3b 35 //functions
ovidiup13 0:1e597b0f8b3b 36 void init(void);
ovidiup13 0:1e597b0f8b3b 37 //update all screen
ovidiup13 0:1e597b0f8b3b 38 void update(char c);
ovidiup13 0:1e597b0f8b3b 39 //update header only
ovidiup13 0:1e597b0f8b3b 40 void display(void);
ovidiup13 0:1e597b0f8b3b 41 //update current menu
ovidiup13 0:1e597b0f8b3b 42 void setCurrent(Item * item){
ovidiup13 0:1e597b0f8b3b 43 current = item;
ovidiup13 0:1e597b0f8b3b 44 }
ovidiup13 0:1e597b0f8b3b 45 //set header
ovidiup13 0:1e597b0f8b3b 46 void setHeader(Header * h){
ovidiup13 0:1e597b0f8b3b 47 header = h;
ovidiup13 0:1e597b0f8b3b 48 }
ovidiup13 2:fcde41900fa5 49 //set header title
ovidiup13 2:fcde41900fa5 50 void setHeaderTitle(char * title){
ovidiup13 4:024e6a9c2ebf 51 header->setTitle(title);
ovidiup13 2:fcde41900fa5 52 }
ovidiup13 0:1e597b0f8b3b 53
ovidiup13 0:1e597b0f8b3b 54 UI(ST7565 *lcd){
ovidiup13 0:1e597b0f8b3b 55 current = NULL;
ovidiup13 0:1e597b0f8b3b 56 header = NULL;
ovidiup13 0:1e597b0f8b3b 57 st7565 = lcd;
ovidiup13 0:1e597b0f8b3b 58 }
ovidiup13 4:024e6a9c2ebf 59
ovidiup13 4:024e6a9c2ebf 60 private:
ovidiup13 4:024e6a9c2ebf 61 //variables
ovidiup13 4:024e6a9c2ebf 62 //current selected menu
ovidiup13 4:024e6a9c2ebf 63 Item * current;
ovidiup13 4:024e6a9c2ebf 64 //header object
ovidiup13 4:024e6a9c2ebf 65 Header * header;
ovidiup13 4:024e6a9c2ebf 66 //display pointer
ovidiup13 4:024e6a9c2ebf 67 ST7565 * st7565;
ovidiup13 4:024e6a9c2ebf 68 //set colors
ovidiup13 4:024e6a9c2ebf 69 void set_colors(float r, float g, float b, float aa);
ovidiup13 0:1e597b0f8b3b 70 };
ovidiup13 0:1e597b0f8b3b 71
ovidiup13 0:1e597b0f8b3b 72 #endif