Subversion Repositories HomeAutomation

Rev

Rev 332 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  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
  19. #define MAX_DATA_LENGTH 7
  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
  28. #define SERVO_VIEW      4
  29.  
  30. #define LAST_VIEW SERVO_VIEW /* To keep track on last view */
  31.  
  32. /*---------------------------------------------------------------
  33.  * Functions
  34.  * ------------------------------------------------------------*/
  35. void printLCDview(uint8_t view);
  36. void printLCDviewData(uint8_t view, uint8_t *data, uint8_t size);
  37.  
  38. /*---------------------------------------------------------------
  39.  * Views
  40.  * <Line 1> <Line 2> <Line 3> <Left> <Right>
  41.  *--------------------------------------------------------------*/
  42. static char viewStrings[][ MAX_LENGTH ] = {
  43.     /* Main view */
  44.     "HomeAutomation", "", "Welcome", "NA", "Temp",
  45.     /* Temperature sensors */
  46.     "Temperature Sensors", "1: NA     2: NA", "3: NA     4: NA", "Main", "Relay",
  47.     /* Relay status */
  48.     "Relay Status", "1: NA     2: NA", "3: NA     4: NA", "Temp", "Dimmer",
  49.     /* Dimmer status */
  50.     "Dimmer Status", "1: NA     2: NA", "3: NA     4: NA", "Relay", "Servo",
  51.     /* Servo (blinds) status */
  52.     "Servo Status", "1: NA     2: NA", "3: NA     4: NA", "Dimmer", "Mail",
  53.     /* Mail status, to interface with a mail account */
  54.     "Mail status","New mail: ","","Servo","   NA"
  55. };
  56.  
  57. static char editStrings[][MAX_LENGTH] = {
  58.  
  59. };
  60.  
  61. static uint8_t dataPos[][2] = {
  62.     {3,1}, /* Data position 1 */
  63.     {13,1}, /* Data position 2 */
  64.     {3,2}, /* Data position 3 */
  65.     {13,2} /* Data position 4 */
  66. };
  67.  
  68.  
  69.