From 1c1b3c8d74b1bff02bffbec91bcdc96fce61a82e Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Sat, 12 Jan 2013 09:38:38 +0100 Subject: TDISP: added custom character routine --- src/tdisp/tdisp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/tdisp') diff --git a/src/tdisp/tdisp.c b/src/tdisp/tdisp.c index d57bae56..f10b09ee 100644 --- a/src/tdisp/tdisp.c +++ b/src/tdisp/tdisp.c @@ -78,6 +78,19 @@ void tdispHome(void) { TDISP_LLD(write_cmd)(0x02); } +void tdispCreateChar(uint8_t location, char *charmap) { + uint8_t i; + + /* make sure we don't write somewhere we're not supposed to */ + location &= TDISP_MAX_CUSTOM_CHARS; + + TDISP_LLD(write_cmd)(0x40 | (location << 3)); + + for(i = 0; i < 8; i++) { + TDISP_LLD(write_data)(charmap[i]); + } +} + void tdispGotoXY(coord_t col, coord_t row) { uint8_t row_offsets[] = { 0x00, 0x40, 0x14, 0x54 }; -- cgit v1.2.3