diff options
author | Joel Bodenmann <joel@unormal.org> | 2013-01-16 10:27:42 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@unormal.org> | 2013-01-16 10:27:42 +0100 |
commit | 1f1dd626871835547b5875e2e48d64e35c55f850 (patch) | |
tree | 98231533f523fe766c06ca6c1b2e899a76ced825 /drivers | |
parent | d7b85cb00e7c38ca131541ae4849edf4abf5cc8e (diff) | |
download | uGFX-1f1dd626871835547b5875e2e48d64e35c55f850.tar.gz uGFX-1f1dd626871835547b5875e2e48d64e35c55f850.tar.bz2 uGFX-1f1dd626871835547b5875e2e48d64e35c55f850.zip |
TDISP update
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tdisp/HD44780/tdisp_lld.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/tdisp/HD44780/tdisp_lld.c b/drivers/tdisp/HD44780/tdisp_lld.c index 2e152977..2c28d8a3 100644 --- a/drivers/tdisp/HD44780/tdisp_lld.c +++ b/drivers/tdisp/HD44780/tdisp_lld.c @@ -85,6 +85,28 @@ bool_t TDISP_LLD(init)(void) { return TRUE; } +void TDISP_LLD(set_cursor)(coord_t col, coord_t row) { + uint8_t row_offsets[] = { 0x00, 0x40, 0x14, 0x54 }; + + if(row >= TDISP_ROWS) + row = TDISP_ROWS - 1; + + TDISP_LLD(write_cmd)(0x80 | (col + row_offsets[row])); +} + +void TDISP_LLD(create_char)(uint8_t address, char *charmap) { + uint8_t i; + + /* make sure we don't write somewhere we're not supposed to */ + address &= TDISP_MAX_CUSTOM_CHARS; + + TDISP_LLD(write_cmd)(0x40 | (address << 3)); + + for(i = 0; i < 8; i++) { + TDISP_LLD(write_data)(charmap[i]); + } +} + #endif /* GFX_USE_TDISP */ /** @} */ |