mirror of https://github.com/kidoman/embd
Merge 642e75ad30
into d3d8c0c5c6
This commit is contained in:
commit
77ad07a648
|
@ -646,3 +646,14 @@ func (conn *I2CConnection) Close() error {
|
||||||
glog.V(2).Info("hd44780: closing I2C bus")
|
glog.V(2).Info("hd44780: closing I2C bus")
|
||||||
return conn.I2C.Close()
|
return conn.I2C.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allows us to fill the first 8 CGRAM locations
|
||||||
|
// with custom characters, we can then print with writeChar(0-7)
|
||||||
|
func (hd *HD44780) CreateChar(location byte, charmap []byte) error {
|
||||||
|
location &= 0x7;
|
||||||
|
err := hd.WriteInstruction(lcdSetCGRamAddr | (location << 3))
|
||||||
|
for i := 0; i < 8; i++ {
|
||||||
|
hd.WriteChar(charmap[i]);
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue