My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

LiquidCrystal.h 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #ifndef LiquidCrystal_h
  2. #define LiquidCrystal_h
  3. #include <inttypes.h>
  4. #include "Print.h"
  5. // commands
  6. #define LCD_CLEARDISPLAY 0x01
  7. #define LCD_RETURNHOME 0x02
  8. #define LCD_ENTRYMODESET 0x04
  9. #define LCD_DISPLAYCONTROL 0x08
  10. #define LCD_CURSORSHIFT 0x10
  11. #define LCD_FUNCTIONSET 0x20
  12. #define LCD_SETCGRAMADDR 0x40
  13. #define LCD_SETDDRAMADDR 0x80
  14. // flags for display entry mode
  15. #define LCD_ENTRYRIGHT 0x00
  16. #define LCD_ENTRYLEFT 0x02
  17. #define LCD_ENTRYSHIFTINCREMENT 0x01
  18. #define LCD_ENTRYSHIFTDECREMENT 0x00
  19. // flags for display on/off control
  20. #define LCD_DISPLAYON 0x04
  21. #define LCD_DISPLAYOFF 0x00
  22. #define LCD_CURSORON 0x02
  23. #define LCD_CURSOROFF 0x00
  24. #define LCD_BLINKON 0x01
  25. #define LCD_BLINKOFF 0x00
  26. // flags for display/cursor shift
  27. #define LCD_DISPLAYMOVE 0x08
  28. #define LCD_CURSORMOVE 0x00
  29. #define LCD_MOVERIGHT 0x04
  30. #define LCD_MOVELEFT 0x00
  31. // flags for function set
  32. #define LCD_8BITMODE 0x10
  33. #define LCD_4BITMODE 0x00
  34. #define LCD_2LINE 0x08
  35. #define LCD_1LINE 0x00
  36. #define LCD_5x10DOTS 0x04
  37. #define LCD_5x8DOTS 0x00
  38. class LiquidCrystal : public Print {
  39. public:
  40. LiquidCrystal(uint8_t rs, uint8_t enable,
  41. uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
  42. uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
  43. LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
  44. uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
  45. uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
  46. LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
  47. uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
  48. LiquidCrystal(uint8_t rs, uint8_t enable,
  49. uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
  50. void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
  51. uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
  52. uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
  53. void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);
  54. void clear();
  55. void home();
  56. void noDisplay();
  57. void display();
  58. void noBlink();
  59. void blink();
  60. void noCursor();
  61. void cursor();
  62. void scrollDisplayLeft();
  63. void scrollDisplayRight();
  64. void leftToRight();
  65. void rightToLeft();
  66. void autoscroll();
  67. void noAutoscroll();
  68. void createChar(uint8_t, uint8_t[]);
  69. void setCursor(uint8_t, uint8_t);
  70. virtual size_t write(uint8_t);
  71. void command(uint8_t);
  72. using Print::write;
  73. private:
  74. void send(uint8_t, uint8_t);
  75. void write4bits(uint8_t);
  76. void write8bits(uint8_t);
  77. void pulseEnable();
  78. uint8_t _rs_pin; // LOW: command. HIGH: character.
  79. uint8_t _rw_pin; // LOW: write to LCD. HIGH: read from LCD.
  80. uint8_t _enable_pin; // activated by a HIGH pulse.
  81. uint8_t _data_pins[8];
  82. uint8_t _displayfunction;
  83. uint8_t _displaycontrol;
  84. uint8_t _displaymode;
  85. uint8_t _initialized;
  86. uint8_t _numlines,_currline;
  87. };
  88. #endif