History

auxdisplay: charlcd: Add support for 4-bit interfaces

In 4-bit mode, 8-bit commands and data are written using two raw writes to the data interface: high nibble first, low nibble last. This must be handled by the low-level driver. However, as we don't know in which mode (4-bit or 8-bit) nor 4-bit phase the LCD was left, initialization must always be handled using raw writes, and needs to configure the LCD for 8-bit mode first.

Geert Uytterhoeven committed 9 years ago

Commit ac201471 parent 39f8ea42 files · +32 −6Browse files

Showing the changes to include/misc (1 of 2 files). Show all

Unified · Split

include/misc/charlcd.h+2−0
@@ -14,6 +14,7 @@ struct charlcd { · 13 unmodified lines
1414 const struct charlcd_ops *ops;
1515 const unsigned char *char_conv; /* Optional */
1616
17+ int ifwidth; /* 4-bit or 8-bit (default) */
1718 int height;
1819 int width;
1920 int bwidth; /* Default set by charlcd_alloc() */
@@ -28,6 +29,7 @@ struct charlcd_ops { · 8 unmodified lines
2829 void (*write_data)(struct charlcd *lcd, int data);
2930
3031 /* Optional */
32+ void (*write_cmd_raw4)(struct charlcd *lcd, int cmd); /* 4-bit only */
3133 void (*clear_fast)(struct charlcd *lcd);
3234 void (*backlight)(struct charlcd *lcd, int on);
3335 };