Subversion Repositories HomeAutomation

Rev

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

  1. #include <inttypes.h>
  2.  
  3.  
  4.  
  5.  
  6.  
  7. #define LCD_DATA_PORT_DB0   PORTB
  8. #define LCD_DATA_PORT_DB1   PORTD
  9. #define LCD_DATA_PORT_DB2   PORTD
  10. #define LCD_DATA_PORT_DB3   PORTD
  11. #define LCD_DATA_PORT_DB4   PORTD
  12. #define LCD_DATA_PORT_DB5   PORTD
  13. #define LCD_DATA_PORT_DB6   PORTD
  14. #define LCD_DATA_PORT_DB7   PORTD
  15.  
  16. #define LCD_DATA_PIN_DB0    0x00
  17. #define LCD_DATA_PIN_DB1    0x07
  18. #define LCD_DATA_PIN_DB2    0x06
  19. #define LCD_DATA_PIN_DB3    0x05
  20. #define LCD_DATA_PIN_DB4    0x04
  21. #define LCD_DATA_PIN_DB5    0x02
  22. #define LCD_DATA_PIN_DB6    0x01
  23. #define LCD_DATA_PIN_DB7    0x00
  24.  
  25. #define LCD_CONTROL_PORT    PORTB
  26. #define LCD_CONTROL_PORT_CS PORTC
  27.  
  28.  
  29. #define LCD_CONTROL_PIN_RS  0x07
  30. #define LCD_CONTROL_PIN_RW  0x02
  31. #define LCD_CONTROL_PIN_E   0x01
  32. #define LCD_CONTROL_PIN_CS1 0x05
  33. #define LCD_CONTROL_PIN_CS2 0x04
  34.  
  35.  
  36. //Här har vi någon slags tillståndsvariabel
  37. typedef struct struct_GrLcdStateType
  38. {
  39.     unsigned char lcdXAddr;
  40.     unsigned char lcdYAddr;
  41. } GrLcdStateType;
  42.  
  43.  
  44. //Alla funktioner
  45. void Disable(void);
  46.  
  47. void Delay(void);
  48.  
  49. void Enable(void);
  50.  
  51. void glcdWriteData(uint8_t data);
  52.  
  53. //extern void glcdWriteChar(char c);
  54.  
  55. //extern void glcdPutStr(const char *s);
  56.  
  57. void glcdWriteChar(char c);
  58.  
  59. void glcdPutStr(char *data);
  60.  
  61. void SetControls(uint8_t RS, uint8_t RW);
  62.  
  63. void SetData(uint8_t Data);
  64.  
  65. void glcdSetXY(uint8_t x, uint8_t y);
  66.  
  67. void glcdPowerOn(void);
  68.  
  69. void glcdClear(void);
  70.