36 lines
763 B
C
36 lines
763 B
C
#ifndef LCD_I2C_H
|
||
#define LCD_I2C_H
|
||
|
||
#include <stdint.h>
|
||
|
||
/* PCF8574 I²C-Expander Adresse */
|
||
#define LCD_I2C_ADDR 0x27
|
||
|
||
/* PCF8574 P-Pins → LCD Control */
|
||
#define LCD_BACKLIGHT 0x08
|
||
#define LCD_ENABLE 0x04
|
||
#define LCD_RW 0x02
|
||
#define LCD_RS 0x01
|
||
|
||
/**
|
||
* @brief Initialisiert das LCD (4-Bit-Modus, 2 Zeilen, 5×8 Punkte).
|
||
*/
|
||
void lcd_init(void);
|
||
|
||
/**
|
||
* @brief Löscht das Display und setzt Cursor auf Home.
|
||
*/
|
||
void lcd_clear(void);
|
||
|
||
/**
|
||
* @brief Setzt den Cursor auf (row, col). Zero-based: row=0..1, col=0..15.
|
||
*/
|
||
void lcd_set_cursor(uint8_t row, uint8_t col);
|
||
|
||
/**
|
||
* @brief Schreibt einen C-String ins Display an der aktuellen Cursor-Position.
|
||
*/
|
||
void lcd_print(const char *str);
|
||
|
||
#endif /* LCD_I2C_H */
|