retargettft.c File Reference

Provide stdio retargeting to TFT address mapped mode.

License

Copyright 2018 Silicon Laboratories Inc. www.silabs.com

SPDX-License-Identifier: Zlib

The licensor of this software is Silicon Laboratories Inc.

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Definition in file retargettft.c .

#include <stdio.h>
#include <stdint.h>
#include "em_device.h"
#include " em_cmu.h "
#include " em_ebi.h "
#include " em_gpio.h "
#include "dmd/ssd2119/dmd_ssd2119.h"
#include " bsp.h "
#include " retargettft.h "
#include " displayfont8x8.h "

Macros

#define CHARS 40
#define fontBits chars_8x8_bits
#define LINES 30

Functions

int RETARGET_ReadChar (void)
Receive a byte No input method from TFT is possible, thus we always return -1.
void RETARGET_TftCrLf (int on)
Toggle LF to CRLF conversion.
void RETARGET_TftInit (void)
Intializes TFT text display.
void RETARGET_TFTTX (int c)
Transmit/display a character.
void RETARGET_TFTUpdate (bool fullFrame)
Display framebuffer.
int RETARGET_WriteChar (char c)
Transmit single byte to the TFT.
static void tftTextReset (void)
Reset TFT text display state.
static void tftTextScrollUp (void)
Scroll one line of characters up on the screen.

Variables

static bool bufferReset = true
static uint8_t charBuffer [ LINES ][ CHARS ]
static bool fullUpdate = true
static bool initialized = false
static bool LFtoCRLF = 0
static uint8_t rgbColor [3]
static bool tftReset = true
static int xpos
static int ypos

Macro Definition Documentation

#define CHARS   40

Characters

Definition at line 44 of file retargettft.c .

Referenced by RETARGET_TFTTX() , RETARGET_TFTUpdate() , tftTextReset() , and tftTextScrollUp() .

#define fontBits   chars_8x8_bits

Define font

Definition at line 42 of file retargettft.c .

Referenced by RETARGET_TFTUpdate() .

#define LINES   30

Lines

Definition at line 45 of file retargettft.c .

Referenced by RETARGET_TFTTX() , RETARGET_TFTUpdate() , tftTextReset() , and tftTextScrollUp() .

Function Documentation

int RETARGET_ReadChar ( void )

Receive a byte No input method from TFT is possible, thus we always return -1.

Returns
-1 on failure, or positive character integer on sucesss

Definition at line 364 of file retargettft.c .

int RETARGET_WriteChar ( char c )

Transmit single byte to the TFT.

Parameters
c Character to transmit
Returns
Transmitted character

Definition at line 374 of file retargettft.c .

References BC_ARB_CTRL_EBI , BC_REGISTER , BC_UIF_AEM_EFM , BSP_RegisterRead() , bufferReset , fullUpdate , initialized , LFtoCRLF , RETARGET_TFTTX() , RETARGET_TFTUpdate() , tftReset , and tftTextReset() .

Variable Documentation

bool bufferReset = true
static

Reset buffer

Definition at line 54 of file retargettft.c .

Referenced by RETARGET_WriteChar() , and tftTextReset() .

uint8_t charBuffer[ LINES ][ CHARS ]
static

Character buffer

Definition at line 47 of file retargettft.c .

Referenced by RETARGET_TFTTX() , RETARGET_TFTUpdate() , tftTextReset() , and tftTextScrollUp() .

bool fullUpdate = true
static

Display updated

Definition at line 53 of file retargettft.c .

Referenced by RETARGET_WriteChar() , and tftTextScrollUp() .

bool initialized = false
static

Intialize TFT stdio retarget

Definition at line 57 of file retargettft.c .

Referenced by RETARGET_WriteChar() , and tftTextReset() .

bool LFtoCRLF = 0
static

LF to CRLF conversion disabled

Definition at line 56 of file retargettft.c .

Referenced by RETARGET_TftCrLf() , and RETARGET_WriteChar() .

uint8_t rgbColor[3]
static

Color for font

Definition at line 48 of file retargettft.c .

Referenced by RETARGET_TFTTX() , RETARGET_TFTUpdate() , and tftTextReset() .

bool tftReset = true
static

Reset TFT

Definition at line 55 of file retargettft.c .

Referenced by RETARGET_WriteChar() , and tftTextReset() .

int xpos
static

Cursor position

Definition at line 51 of file retargettft.c .

Referenced by RETARGET_TFTTX() , RETARGET_TFTUpdate() , tftTextReset() , and tftTextScrollUp() .

int ypos
static

Cursor position

Definition at line 51 of file retargettft.c .

Referenced by RETARGET_TFTTX() , RETARGET_TFTUpdate() , tftTextReset() , and tftTextScrollUp() .