Details | Last modification | View Log | SVN | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 193 | eqlazer | 1 | /* |
| 2 | * Header file for printing predefined pages to 20x4 character LCD. |
||
| 3 | * |
||
| 4 | * Author: Erik Larsson |
||
| 5 | * Date: 2006-12-29 |
||
| 6 | * |
||
| 7 | */ |
||
| 8 | |||
| 9 | /*--------------------------------------------------------------- |
||
| 10 | * Includes |
||
| 11 | * ------------------------------------------------------------*/ |
||
| 12 | #include <stdlib.h> |
||
| 13 | #include <inttypes.h> |
||
| 14 | |||
| 15 | /*-------------------------------------------------------------- |
||
| 16 | * Defines |
||
| 17 | * -----------------------------------------------------------*/ |
||
| 18 | #define MAX_LENGTH 21 |
||
| 256 | eqlazer | 19 | #define MAX_DATA_LENGTH 7 |
| 193 | eqlazer | 20 | #define LINES 4 |
| 21 | #define CHARACTERS 20 |
||
| 22 | #define EDIT_MODE_SYMBOL "&&" |
||
| 23 | |||
| 24 | #define MAIN_VIEW 0 |
||
| 25 | #define TEMPSENS_VIEW 1 |
||
| 26 | #define RELAYS_VIEW 2 |
||
| 27 | #define DIMMERS_VIEW 3 |
||
| 256 | eqlazer | 28 | #define SERVO_VIEW 4 |
| 193 | eqlazer | 29 | |
| 30 | /*--------------------------------------------------------------- |
||
| 31 | * Functions |
||
| 32 | * ------------------------------------------------------------*/ |
||
| 33 | void printLCDview(uint8_t view); |
||
| 196 | eqlazer | 34 | void printLCDviewData(uint8_t view, uint8_t *data, uint8_t size); |
| 193 | eqlazer | 35 | |
| 36 | /*--------------------------------------------------------------- |
||
| 37 | * Views |
||
| 38 | * <Line 1> <Line 2> <Line 3> <Left> <Right> |
||
| 39 | *--------------------------------------------------------------*/ |
||
| 196 | eqlazer | 40 | static char viewStrings[][ MAX_LENGTH ] = { |
| 193 | eqlazer | 41 | /* Main view */ |
| 42 | "HomeAutomation", "", "Welcome", "NA", "Temp", |
||
| 43 | /* Temperature sensors */ |
||
| 44 | "Temperature Sensors", "1: NA 2: NA", "3: NA 4: NA", "Main", "Relay", |
||
| 45 | /* Relay status */ |
||
| 256 | eqlazer | 46 | "Relay Status", "1: NA 2: NA", "3: NA 4: NA", "Temp", "Dimmer", |
| 193 | eqlazer | 47 | /* Dimmer status */ |
| 256 | eqlazer | 48 | "Dimmer Status", "1: NA 2: NA", "3: NA 4: NA", "Relay", "Servo", |
| 49 | /* Servo (blinds) status */ |
||
| 50 | "Servo Status", "1: NA 2: NA", "3: NA 4: NA", "Dimmer", " NA" |
||
| 193 | eqlazer | 51 | }; |
| 52 | |||
| 196 | eqlazer | 53 | static uint8_t dataPos[][2] = { |
| 54 | {3,1}, /* Data position 1 */ |
||
| 55 | {13,1}, /* Data position 2 */ |
||
| 56 | {3,2}, /* Data position 3 */ |
||
| 57 | {13,2} /* Data position 4 */ |
||
| 58 | }; |
||
| 59 | |||
| 60 |