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++)
121 for (i = 0; i < 10000; i++) ;
129 if (status == DMD_OK) status = DMD_init(0);
130 if ((status != DMD_OK) && (status != DMD_ERROR_DRIVER_ALREADY_INITIALIZED))
while (1) ;
132 if ((status == DMD_OK)) status = DMD_flipDisplay(1, 1);
146 for (y = 0; y < (
LINES - 1); y++)
148 for (x = 0; x <
CHARS; x++)
154 for (x = 0; x <
CHARS; x++)
211 if (c < ' ' || c >
'~')
238 uint32_t pixelX, pixelY;
245 for (y = 0; y <
LINES; y++)
247 for (x = 0; x <
CHARS; x++)
253 for (i = 0; i < 8; i++)
258 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);
268 DMD_writeColor(pixelX + 0, pixelY + i, 0x00, 0x00, 0x00, 1);
276 DMD_writeColor(pixelX + 1, pixelY + i, 0x00, 0x00, 0x00, 1);
284 DMD_writeColor(pixelX + 2, pixelY + i, 0x00, 0x00, 0x00, 1);
292 DMD_writeColor(pixelX + 3, pixelY + i, 0x00, 0x00, 0x00, 1);
300 DMD_writeColor(pixelX + 4, pixelY + i, 0x00, 0x00, 0x00, 1);
308 DMD_writeColor(pixelX + 5, pixelY + i, 0x00, 0x00, 0x00, 1);
316 DMD_writeColor(pixelX + 6, pixelY + i, 0x00, 0x00, 0x00, 1);
324 DMD_writeColor(pixelX + 7, pixelY + i, 0x00, 0x00, 0x00, 1);
336 for (i = 0; i < 8; i++)
341 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);
352 DMD_writeColor(pixelX + 0, pixelY + i, 0x00, 0x00, 0x00, 1);
360 DMD_writeColor(pixelX + 1, pixelY + i, 0x00, 0x00, 0x00, 1);
368 DMD_writeColor(pixelX + 2, pixelY + i, 0x00, 0x00, 0x00, 1);
376 DMD_writeColor(pixelX + 3, pixelY + i, 0x00, 0x00, 0x00, 1);
384 DMD_writeColor(pixelX + 4, pixelY + i, 0x00, 0x00, 0x00, 1);
392 DMD_writeColor(pixelX + 5, pixelY + i, 0x00, 0x00, 0x00, 1);
400 DMD_writeColor(pixelX + 6, pixelY + i, 0x00, 0x00, 0x00, 1);
408 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.
#define BC_SPI_DEMUX_SLAVE_AUDIO
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]
uint16_t BSP_RegisterRead(volatile uint16_t *addr)
Read from a board controller register.
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.
int BSP_RegisterWrite(volatile uint16_t *addr, uint16_t data)
Write to a board controller register.
int BSP_DisplayControl(BSP_Display_TypeDef option)
Configure display control.
#define BC_SPI_DEMUX_SLAVE_DISPLAY