HWA
Bare metal programming with style
|
This class implements a HD44780 LCD controller.
Header file:
HW_HD44780(...) declares a HD44780 object. You must provide:
Currently, HWA supports only the driving of the HD44780 in 4-bit mode through a single dedicated I²C bus expander PCF8574.
The implementation of this device focuses on code size rather than on speed, so it relies on extern C functions rather than on inlined code. You must use HW_IMPLEMENT() to have these functions defined.
HW_DECLARE( LCD ) declares the functions that implement the device. You can put it in your header files:
HW_IMPLEMENT( LCD ) defines the functions that implement the device. This must appear in one of your source files:
(LCD,putchar)
: the name of the putchar function associated to the LCD.Assuming that myprintf
takes the address of a putchar
function as first argument:
hw( configure, LCD, ... ) configures the LCD:
hw( cls, LCD ) clears the screen:
hw( gotoxy, LCD, x, y ) moves the cursor to column x, line y:
hw( newline, LCD ) moves the cursor to the start of the next line:
hw( home, LCD ) moves the cursor to the home position:
hw( putchar, LCD, c ) writes a character at the current position:
Macros | |
#define | HW_DECLARE__hd44780 |
#define | HW_HD44780(...) |
#define | HW_IMPLEMENT__hd44780 |