ESR-2025/lcd.h

36 lines
763 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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 */