Synopsis
typedef struct {
int (*capabilities)(HD44780_DRIVER_t *);
void (*set_e)(HD44780_DRIVER_t *, int);
void (*set_rw)(HD44780_DRIVER_t *, int);
void (*set_rs)(HD44780_DRIVER_t *, int);
void (*set_dbus)(HD44780_DRIVER_t *, int);
void (*set_backlight)(HD44780_DRIVER_t *, int);
int (*read_dbus)(HD44780_DRIVER_t *);
void *extra;
int x;
int y;
int cursor;
int width;
int height;
char lcd[];
} HD44780_DRIVER_t;
Description
HD44780_DRIVER_t contains a set of methods that the high-level driver
uses to implement the physical layer of the display.
Structure
-
capabilities
- Returns the underlying capabilities of the physical
interface. The method should return the bitwise-or of
the flags HD44780_BIDIRECTIONAL_DBUS and
HD44780_4BIT_INTERFACE. If the data bus is
bidirectional then the high-level driver will
try to read the bus using read_dbus (to establish
LCD readiness) and set its control its direction using
set_dbus_input and set_dbus_output. Returning
HD44780_4BIT_INTERFACE indicates that the data bus
bus is physically connected using only four bits and
the physical-layer driver adapts to 4-bit mode.
-
set_e
- Sets the E signal high when state is non-zero and
low when state is zero.
-
set_rw
- Sets the R/W signal high when state is non-zero and
low when state is zero.
-
set_rs
- Sets the RS signal high when state is non-zero and
low when state is zero.
-
set_dbus
- Sets the data bus to output mode and its outputs to state.
For a 4-bit data bus, state will contain valid data in
bits 4 through 7 with all other bits zero, and for an 8-bit
data bus, state will contain valid data in bits 0 through 7.
-
set_backlight
- Sets the display backlight level to level. This is a
driver-specific function that is provided as a convenience
in order to enable clients to turn the backlight on and off,
or to set its level using PWM.
-
read_dbus
- Sets the data bus to input mode, reads the data bus, and
returns what is read. For a 4-bit data bus, the four data
bits are expected in bits 4 through 7 and for an 8-bit data
bus they are expected in bits 0 through 7.