hd44780_i2c_lcd.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * hd44780_i2c_lcd.h
  3. *
  4. * Copyright 2022 dh33ex <dh33ex@riseup.net>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  19. * MA 02110-1301, USA or see <http://www.gnu.org/licenses/>.
  20. *
  21. *
  22. */
  23. #ifndef HD44780_I2C_LCD_H
  24. #define HD44780_I2C_LCD_H
  25. #define HD44780_NO_CURSOR 0
  26. #define HD44780_BLINK_CURSOR 1
  27. #define HD44780_PERMANENT_CURSOR 2
  28. struct hd44780 {
  29. unsigned char light;
  30. unsigned char cursor;
  31. unsigned char address;
  32. unsigned char rows;
  33. unsigned char columns;
  34. };
  35. typedef struct hd44780 HD44780;
  36. void LCD_init(HD44780 *disp);
  37. void LCD_write(HD44780 *disp, char *string);
  38. void LCD_set_address(HD44780 *disp, unsigned char x, unsigned char y);
  39. void LCD_backlight(HD44780 *disp, unsigned char state);
  40. void LCD_clear(HD44780 *disp);
  41. #endif