Subversion Repositories HomeAutomation

Rev

Rev 1019 | Rev 1789 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. #include <inttypes.h>
  2. #include <config.h>
  3. #include <drivers/sensor/ds18s20/delay.h>
  4.  
  5. #ifndef LCD_CONTROL_PIN_E
  6.  
  7. #define LCD_DATA_PORT_DB0   PORTB
  8. #define LCD_DATA_DDR_DB0    DDRB
  9. #define LCD_DATA_IN_DB0     PINB
  10. #define LCD_DATA_PORT_DB1   PORTD
  11. #define LCD_DATA_DDR_DB1    DDRD
  12. #define LCD_DATA_IN_DB1     PIND
  13. #define LCD_DATA_PORT_DB2   PORTD
  14. #define LCD_DATA_DDR_DB2    DDRD
  15. #define LCD_DATA_IN_DB2     PIND
  16. #define LCD_DATA_PORT_DB3   PORTD
  17. #define LCD_DATA_DDR_DB3    DDRD
  18. #define LCD_DATA_IN_DB3     PIND
  19. #define LCD_DATA_PORT_DB4   PORTD
  20. #define LCD_DATA_DDR_DB4    DDRD
  21. #define LCD_DATA_IN_DB4     PIND
  22. #define LCD_DATA_PORT_DB5   PORTD
  23. #define LCD_DATA_DDR_DB5    DDRD
  24. #define LCD_DATA_IN_DB5     PIND
  25. #define LCD_DATA_PORT_DB6   PORTD
  26. #define LCD_DATA_DDR_DB6    DDRD
  27. #define LCD_DATA_IN_DB6     PIND
  28. #define LCD_DATA_PORT_DB7   PORTD
  29. #define LCD_DATA_DDR_DB7    DDRD
  30. #define LCD_DATA_IN_DB7     PIND
  31.  
  32. #define LCD_DATA_PIN_DB0    0x00
  33. #define LCD_DATA_PIN_DB1    0x07
  34. #define LCD_DATA_PIN_DB2    0x06
  35. #define LCD_DATA_PIN_DB3    0x05
  36. #define LCD_DATA_PIN_DB4    0x04
  37. #define LCD_DATA_PIN_DB5    0x02
  38. #define LCD_DATA_PIN_DB6    0x01
  39. #define LCD_DATA_PIN_DB7    0x00
  40.  
  41. #define LCD_CONTROL_PORT    PORTB
  42. #define LCD_CONTROL_DDR     DDRB
  43. #define LCD_CONTROL_PORT_CS PORTC
  44. #define LCD_CONTROL_DDR_CS  DDRC
  45.  
  46. #define LCD_CONTROL_PIN_RS  0x07
  47. #define LCD_CONTROL_PIN_RW  0x02
  48. #define LCD_CONTROL_PIN_E   0x01
  49. #define LCD_CONTROL_PIN_CS1 0x05
  50. #define LCD_CONTROL_PIN_CS2 0x04
  51.  
  52. #endif
  53.  
  54.  
  55. #define GLCD_COLOR_BLACK 0
  56. #define GLCD_COLOR_WHITE 1
  57. #define GLCD_COLOR_SET   0
  58. #define GLCD_COLOR_CLEAR 1
  59.  
  60. //H�r har vi n�gon slags tillst�ndsvariabel
  61. typedef struct struct_GrLcdStateType
  62. {
  63.     unsigned char lcdXAddr;
  64.     unsigned char lcdYAddr;
  65.     uint8_t lcdYpage;
  66.     uint8_t color;
  67. } GrLcdStateType;
  68.  
  69.  
  70. //Alla funktioner
  71. void Disable(void);
  72.  
  73. void Delay(void);
  74.  
  75. void Enable(void);
  76.  
  77. void glcdWriteData(uint8_t data, uint8_t color);
  78.  
  79. void glcdWriteDataTransparent(uint8_t inputdata, uint8_t color);
  80.  
  81. void glcdWriteChar(char c, uint8_t color);
  82. void glcdWriteCharTransparent(char c, uint8_t color);
  83.  
  84. void glcdPutStr(char *data, uint8_t color);
  85. void glcdPutStrTransparent(char *data, uint8_t color);
  86.  
  87. void SetControls(uint8_t RS, uint8_t RW);
  88.  
  89. void SetData(uint8_t Data);
  90.  
  91. void glcdSetXY(uint8_t x, uint8_t y);
  92.  
  93. uint8_t glcdGetX(void);
  94.  
  95. uint8_t glcdGetY(void);
  96.  
  97. void glcdPowerOn(void);
  98.  
  99. void glcdClear(void);
  100.  
  101. void glcdSetColor(uint8_t color);
  102.  
  103. uint8_t glcdGetColor(void);
  104.  
  105. #define glcdDrawVertLine(x, y, length, color) {glcdFillRect(x, y, 0, length, color);}
  106. #define glcdDrawHoriLine(x, y, length, color) {glcdFillRect(x, y, length, 0, color);}
  107. #define glcdDrawCircle(xCenter, yCenter, radius, color) {glcdDrawRoundRect(xCenter-radius, yCenter-radius, 2*radius, 2*radius, radius, color);}
  108. void glcdDrawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t color);
  109. void glcdDrawRect(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color);
  110. void glcdDrawRoundRect(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t radius, uint8_t color);
  111. void glcdFillRect(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color);
  112. void glcdInvertRect(uint8_t x, uint8_t y, uint8_t width, uint8_t height);
  113. void glcdInvert(void);
  114. void glcdSetDot(uint8_t x, uint8_t y, uint8_t color);
  115.  
  116.