23 #include "dmd/ssd2119/dmd_ssd2119.h"
25 #include "retargettft.h"
28 #define fontBits chars_8x8_bits
33 static uint8_t charBuffer[LINES][CHARS];
34 static uint8_t rgbColor[3];
37 static int xpos, ypos;
39 static bool fullUpdate = true;
40 static bool bufferReset = true;
41 static bool tftReset = true;
42 static bool LFtoCRLF = 0;
43 static bool initialized = false;
55 #if !defined(__CROSSWORKS_ARM) && defined(__GNUC__)
56 setvbuf(stdout, NULL, _IONBF, 0);
96 for (y = 0; y <
LINES; y++)
98 for (x = 0; x <
CHARS; x++)
116 for (i = 0; i < 10000; i++) ;
124 if (status == DMD_OK) status = DMD_init(0);
125 if ((status != DMD_OK) && (status != DMD_ERROR_DRIVER_ALREADY_INITIALIZED))
while (1) ;
127 if ((status == DMD_OK)) status = DMD_flipDisplay(1, 1);
141 for (y = 0; y < (
LINES - 1); y++)
143 for (x = 0; x <
CHARS; x++)
149 for (x = 0; x <
CHARS; x++)
206 if (c < ' ' || c >
'~')
233 uint32_t pixelX, pixelY;
240 for (y = 0; y <
LINES; y++)
242 for (x = 0; x <
CHARS; x++)
248 for (i = 0; i < 8; i++)
253 DMD_writeData(pixelX, pixelY + i, (uint8_t *)
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 8);
263 DMD_writeColor(pixelX + 0, pixelY + i, 0x00, 0x00, 0x00, 1);
271 DMD_writeColor(pixelX + 1, pixelY + i, 0x00, 0x00, 0x00, 1);
279 DMD_writeColor(pixelX + 2, pixelY + i, 0x00, 0x00, 0x00, 1);
287 DMD_writeColor(pixelX + 3, pixelY + i, 0x00, 0x00, 0x00, 1);
295 DMD_writeColor(pixelX + 4, pixelY + i, 0x00, 0x00, 0x00, 1);
303 DMD_writeColor(pixelX + 5, pixelY + i, 0x00, 0x00, 0x00, 1);
311 DMD_writeColor(pixelX + 6, pixelY + i, 0x00, 0x00, 0x00, 1);
319 DMD_writeColor(pixelX + 7, pixelY + i, 0x00, 0x00, 0x00, 1);
331 for (i = 0; i < 8; i++)
336 DMD_writeData(pixelX, pixelY + i, (uint8_t *)
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 8);
347 DMD_writeColor(pixelX + 0, pixelY + i, 0x00, 0x00, 0x00, 1);
355 DMD_writeColor(pixelX + 1, pixelY + i, 0x00, 0x00, 0x00, 1);
363 DMD_writeColor(pixelX + 2, pixelY + i, 0x00, 0x00, 0x00, 1);
371 DMD_writeColor(pixelX + 3, pixelY + i, 0x00, 0x00, 0x00, 1);
379 DMD_writeColor(pixelX + 4, pixelY + i, 0x00, 0x00, 0x00, 1);
387 DMD_writeColor(pixelX + 5, pixelY + i, 0x00, 0x00, 0x00, 1);
395 DMD_writeColor(pixelX + 6, pixelY + i, 0x00, 0x00, 0x00, 1);
403 DMD_writeColor(pixelX + 7, pixelY + i, 0x00, 0x00, 0x00, 1);
Clock management unit (CMU) API.
int RETARGET_ReadChar(void)
Receive a byte No input method from TFT is possible, thus we always return -1.
Board support package API definitions.
void RETARGET_TftCrLf(int on)
Toggle LF to CRLF conversion.
static void tftTextReset(void)
Reset TFT text display state.
static uint8_t charBuffer[LINES][CHARS]
8x8 font with all characters
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
void RETARGET_TFTTX(int c)
Transmit/display a character.
void RETARGET_TftInit(void)
Intializes TFT text display.
static uint8_t rgbColor[3]
External Bus Iterface (EBI) peripheral API.
General Purpose IO (GPIO) peripheral API.
int RETARGET_WriteChar(char c)
Transmit single byte to the TFT.
static void tftTextScrollUp(void)
Scroll one line of characters up on the screen.
void RETARGET_TFTUpdate(bool fullFrame)
Display framebuffer.