Subversion Repositories HomeAutomation

Rev

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

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