TDISP update
This commit is contained in:
parent
d5e7afe756
commit
77a93bb43d
@ -32,13 +32,6 @@
|
|||||||
|
|
||||||
#if GFX_USE_TDISP /*|| defined(__DOXYGEN__)*/
|
#if GFX_USE_TDISP /*|| defined(__DOXYGEN__)*/
|
||||||
|
|
||||||
#ifndef TDISP_ROWS
|
|
||||||
#define TDISP_ROWS 16
|
|
||||||
#endif
|
|
||||||
#ifndef TDISP_COLUMNS
|
|
||||||
#define TDISP_COLUMNS 2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "tdisp_lld_board_example.h"
|
#include "tdisp_lld_board_example.h"
|
||||||
|
|
||||||
static void _writeData(uint8_t data) {
|
static void _writeData(uint8_t data) {
|
||||||
|
@ -41,6 +41,13 @@
|
|||||||
/* Include the low level driver information */
|
/* Include the low level driver information */
|
||||||
#include "tdisp/lld/tdisp_lld.h"
|
#include "tdisp/lld/tdisp_lld.h"
|
||||||
|
|
||||||
|
#ifndef TDISP_ROWS
|
||||||
|
#define TDISP_ROWS 2
|
||||||
|
#endif
|
||||||
|
#ifndef TDISP_COLUMNS
|
||||||
|
#define TDISP_COLUMNS 16
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef TDISP_NEED_4BIT_MODE
|
#ifndef TDISP_NEED_4BIT_MODE
|
||||||
#define TDISP_NEED_4BIT_MODE FALSE
|
#define TDISP_NEED_4BIT_MODE FALSE
|
||||||
#endif
|
#endif
|
||||||
|
@ -50,6 +50,9 @@ void tdispHome(void) {
|
|||||||
void tdispGotoXY(coord_t col, coord_t row) {
|
void tdispGotoXY(coord_t col, coord_t row) {
|
||||||
uint8_t row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
|
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]));
|
TDISP_LLD(write_cmd)(0x80 | (col + row_offsets[row]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +63,7 @@ void tdispDrawChar(char c) {
|
|||||||
void tdispDrawString(char *s) {
|
void tdispDrawString(char *s) {
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
while(c = s++)
|
while(c = *s++)
|
||||||
tdispDrawChar(c);
|
tdispDrawChar(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user