aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2013-01-16 10:27:42 +0100
committerJoel Bodenmann <joel@unormal.org>2013-01-16 10:27:42 +0100
commit1f1dd626871835547b5875e2e48d64e35c55f850 (patch)
tree98231533f523fe766c06ca6c1b2e899a76ced825 /src
parentd7b85cb00e7c38ca131541ae4849edf4abf5cc8e (diff)
downloaduGFX-1f1dd626871835547b5875e2e48d64e35c55f850.tar.gz
uGFX-1f1dd626871835547b5875e2e48d64e35c55f850.tar.bz2
uGFX-1f1dd626871835547b5875e2e48d64e35c55f850.zip
TDISP update
Diffstat (limited to 'src')
-rw-r--r--src/tdisp/tdisp.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/tdisp/tdisp.c b/src/tdisp/tdisp.c
index 22de001f..38fd56d8 100644
--- a/src/tdisp/tdisp.c
+++ b/src/tdisp/tdisp.c
@@ -78,26 +78,12 @@ 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 tdispCreateChar(uint8_t address, char *charmap) {
+ TDISP_LLD(create_char)(address, charmap);
}
-void tdispGotoXY(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 tdispSetCursor(coord_t col, coord_t row) {
+ TDISP_LLD(set_cursor)(col, row);
}
void tdispDrawChar(char c) {
@@ -110,12 +96,12 @@ void tdispDrawString(char *s) {
}
void tdispDrawCharLocation(coord_t col, coord_t row, char c) {
- tdispGotoXY(col, row);
+ tdispSetCursor(col, row);
tdispDrawChar(c);
}
void tdispDrawStringLocation(coord_t col, coord_t row, char *s) {
- tdispGotoXY(col, row);
+ tdispSetCursor(col, row);
tdispDrawString(s);
}