McMajan Library Pack  v 2.00
Improve your Arduino !
Ss_TFT Class Reference

#include <Ss_TFT.h>

+ Collaboration diagram for Ss_TFT:

Public Member Functions

 Ss_TFT ()
 
void SetLANDSCAPE ()
 
void SetPORTRAIT ()
 
void GetLandscapePoint (int *, int *)
 
void SetFont (uint8_t *font, uint8_t x=0, uint8_t y=0, uint8_t spx=0, uint8_t spy=0)
 
void SetFontOption (const uint8_t)
 
void CleanLCD (unsigned short rgb=0xFFFF)
 
void Initialize ()
 
void Touchpin (int tclk, int tcs, int tdin, int dout, int irq)
 
void TouchGetPoint ()
 
bool TouchReady ()
 
void TouchInitial ()
 
unsigned int TouchGetX ()
 
unsigned int TouchGetY ()
 
void RectFill (int sx, int sy, int ex, int ey, bool force=0)
 
void Rect (int, int, int, int)
 
void Circle (int, int, int)
 
void CircleFill (int, int, int)
 
void plot4pointsE (int, int, int, int)
 
void plot4points (int, int, int, int)
 
void CheckPoint (int *, int *)
 
void SetFcolor (uint8_t, uint8_t, uint8_t)
 
void SetBcolor (uint8_t, uint8_t, uint8_t)
 
void SetFBcolor (int FC, int BC)
 
void DisplayString (int x, int y, char *st, uint8_t options=0)
 
void d32s (short, short, uint8_t)
 
void DisplayChar (short, short, uint8_t, uint8_t option=0)
 
void DisplayBitmapChar (int, int, uint8_t, uint8_t option=0)
 
void Pixel (int x, int y)
 
void Line (int sx, int sy, int ex, int ey)
 
void LineVS (int x, int y, int l)
 
void LineHS (int x, int y, int l)
 
void HLine (short x, short y, short l)
 
void VLine (short x, short y, short l)
 
void LCD_Write_CD (unsigned short, unsigned short)
 
void LCD_Write8 (uint8_t)
 
void LCD_Write8x2 (unsigned short)
 
void LCD_Write_DATA8 (unsigned short)
 
void LCD_Write_COMM8 (unsigned short)
 
void SetXY (unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2)
 
void Write7843 (uint8_t num)
 
unsigned int Read7843 ()
 

Public Attributes

int TouchRawX
 
int TouchRawY
 
int TouchRawCalibX
 
int TouchRawCalibSCR_XX
 
int TouchRawCalibY
 
int TouchRawCalibSCR_YY
 
int Tc_X
 
int Tc_Y
 
Font LocalFont
 
uint8_t Service
 
unsigned short ForeColor
 
unsigned short BackColor
 
unsigned short SCR_WW
 
unsigned short SCR_HH
 
unsigned short SCR_XX
 
unsigned short SCR_YY
 
unsigned short SCR_WIDTH
 
unsigned short SCR_HEIGHT
 
int T_CLK
 
int T_CS
 
int T_DIN
 
int T_DOUT
 
int T_IRQ
 
int LCD_RS
 
int LCD_WR
 
int LCD_CS
 
int LCD_REST
 

Detailed Description

Definition at line 112 of file Ss_TFT.h.

Constructor & Destructor Documentation

§ Ss_TFT()

Member Function Documentation

§ CheckPoint()

void CheckPoint ( int *  x,
int *  y 
)

Definition at line 361 of file Ss_TFT.cpp.

References SCR_XX, and SCR_YY.

§ Circle()

void Circle ( int  cx,
int  cy,
int  radius 
)

Draw empty circle

Parameters
cxx coordinate of circle center
cyy coordinate of circle center
radiusradius

(error&0x80))

Definition at line 576 of file Ss_TFT.cpp.

References plot4points().

+ Here is the call graph for this function:

§ CircleFill()

void CircleFill ( int  x,
int  y,
int  raggio 
)

Draw filled circle

Parameters
cxx coordinate of circle center
cyy coordinate of circle center
radiusradius

Definition at line 631 of file Ss_TFT.cpp.

References Line().

+ Here is the call graph for this function:

§ CleanLCD()

void CleanLCD ( unsigned short  rgb = 0xFFFF)

This function empties the display content. Without parameter it uses the white color. Alternatively you can select a color on the format 0xRRGGBB.

Parameters
rgboptional background color

Definition at line 416 of file Ss_TFT.cpp.

References ForeColor, RectFill(), SCR_XX, and SCR_YY.

+ Here is the call graph for this function:

§ d32s()

void d32s ( short  x,
short  y,
uint8_t  val 
)

Definition at line 648 of file Ss_TFT.cpp.

§ DisplayBitmapChar()

void DisplayBitmapChar ( int  x,
int  y,
uint8_t  val,
uint8_t  option = 0 
)

Definition at line 941 of file Ss_TFT.cpp.

§ DisplayChar()

void DisplayChar ( short  x,
short  y,
uint8_t  val,
uint8_t  option = 0 
)

Definition at line 921 of file Ss_TFT.cpp.

§ DisplayString()

void DisplayString ( int  x,
int  y,
char *  st,
uint8_t  options = 0 
)

This function writes a string to the display in the selected position, using actual font and colors.

For vectorial font you need 3 parameters: X, Y and string

lcd.DisplayString(10,10,"MCMAJAN.COM");

If you are using a bitmap font, you have to add a fourth parameter: this one at 0 indicate normal dimension, at 1 doubles X, at 2 doubles Y, at 3 doubles X and Y.

lcd.DisplayString(10,10,"MCMAJAN.COM",3);

Definition at line 1132 of file Ss_TFT.cpp.

§ GetLandscapePoint()

void GetLandscapePoint ( int *  x,
int *  y 
)

Definition at line 1162 of file Ss_TFT.cpp.

References SCR_YY.

§ HLine()

void HLine ( short  x,
short  y,
short  ln 
)

Draw horizontal line

Parameters
xx coordinate of starting point
yy coordinate of starting point
lnlenght of line

Definition at line 458 of file Ss_TFT.cpp.

References ForeColor, LCD_Write8x2(), SCR_XX, and SetXY().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Initialize()

void Initialize ( )

Inizialize dislay in standar portrait orientation

Definition at line 245 of file Ss_TFT.cpp.

References LCD_Write_CD().

+ Here is the call graph for this function:

§ LCD_Write8()

void LCD_Write8 ( uint8_t  data)

Definition at line 62 of file Ss_TFT.cpp.

§ LCD_Write8x2()

void LCD_Write8x2 ( unsigned short  dataL)

Definition at line 115 of file Ss_TFT.cpp.

+ Here is the caller graph for this function:

§ LCD_Write_CD()

void LCD_Write_CD ( unsigned short  command,
unsigned short  data 
)

Definition at line 225 of file Ss_TFT.cpp.

References LCD_Write_COMM8(), and LCD_Write_DATA8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LCD_Write_COMM8()

void LCD_Write_COMM8 ( unsigned short  comm)

Definition at line 212 of file Ss_TFT.cpp.

References LCD_Write8x2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LCD_Write_DATA8()

void LCD_Write_DATA8 ( unsigned short  data)

Definition at line 219 of file Ss_TFT.cpp.

References LCD_Write8x2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Line()

void Line ( int  x1,
int  y1,
int  x2,
int  y2 
)

Draw line

Parameters
x1x coordinate of starting point
y1y coordinate of starting point
x2x coordinate of target point
y2y coordinate of target point

Definition at line 502 of file Ss_TFT.cpp.

References ForeColor, HLine(), LCD_Write_DATA8(), SetXY(), and VLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ LineHS()

void LineHS ( int  x,
int  y,
int  l 
)

Definition at line 491 of file Ss_TFT.cpp.

References Line().

+ Here is the call graph for this function:

§ LineVS()

void LineVS ( int  x,
int  y,
int  l 
)

Definition at line 487 of file Ss_TFT.cpp.

References Line().

+ Here is the call graph for this function:

§ Pixel()

void Pixel ( int  x,
int  y 
)

Draw a single dot

Parameters
x
y

Definition at line 1153 of file Ss_TFT.cpp.

References ForeColor, LCD_Write8x2(), and SetXY().

+ Here is the call graph for this function:

§ plot4points()

void plot4points ( int  cx,
int  cy,
int  x,
int  y 
)

Definition at line 614 of file Ss_TFT.cpp.

+ Here is the caller graph for this function:

§ plot4pointsE()

void plot4pointsE ( int  ,
int  ,
int  ,
int   
)

§ Read7843()

unsigned int Read7843 ( )

Definition at line 1226 of file Ss_TFT.cpp.

References HPulse(), and T_CLK.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Rect()

void Rect ( int  x0,
int  y0,
int  x1,
int  y1 
)

Draw empty rectangle

Parameters
x0x coordinate of starting point
y0y coordinate of starting point
x1x coordinate of target point
y1y coordinate of target point

Definition at line 347 of file Ss_TFT.cpp.

References Line().

+ Here is the call graph for this function:

§ RectFill()

void RectFill ( int  sx,
int  sy,
int  ex,
int  ey,
bool  force = 0 
)

Draw filled rectangle

Parameters
sxx coordinate of starting point
syy coordinate of starting point
exx coordinate of target point
eyy coordinate of target point
forceoptional parameter (default false): if set to true the dysplay orientation will be ignored (used default portrait)

Definition at line 378 of file Ss_TFT.cpp.

References ForeColor, LCD_Write8x2(), and SetXY().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SetBcolor()

void SetBcolor ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Sets background color. Every componente are from 0 to 255 (8bit for channel) but the display support less colors number, for this an automatic conversion will done.

Parameters
rred component
ggreen component
bblue component

Definition at line 438 of file Ss_TFT.cpp.

§ SetFBcolor()

void SetFBcolor ( int  FC,
int  BC 
)

Sets foreground and color using single integer value (for example 0xff00cc

Parameters
FCForeground color
BCBackground color

Definition at line 447 of file Ss_TFT.cpp.

References BackColor, and ForeColor.

§ SetFcolor()

void SetFcolor ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Sets foreground color. Every componente are from 0 to 255 (8bit for channel) but the display support less colors number, for this an automatic conversion will done.

Parameters
rred component
ggreen component
bblue component

Definition at line 429 of file Ss_TFT.cpp.

§ SetFont()

void SetFont ( uint8_t *  font,
uint8_t  x = 0,
uint8_t  y = 0,
uint8_t  spx = 0,
uint8_t  spy = 0 
)

Select the font type. Parameters changes if you use bitmap or vectorial font. If you use bitmap font you have to choice only the font pointer:

extern uint8_t BasicSmallFont[];
...
lcd.SetFont(BasicSmallFont);

If you want to use the vectorial font you must use 4 parameters: font pointer, segment width, segment height, space between segments, more X width and Y height (for change X:Y ratio).

extern unsigned char SegmentFont[];
...
lcd.SetFont(SegmentFont,2,1,0);

Definition at line 881 of file Ss_TFT.cpp.

§ SetFontOption()

void SetFontOption ( const uint8_t  option)

Definition at line 910 of file Ss_TFT.cpp.

§ SetLANDSCAPE()

void SetLANDSCAPE ( )
inline

It sets the display orientation. When you create the instance, the Display is sets to the portrait orientation. You can force this setting using SetLANDSCAPE or SetPORTRAIT. The coordinate 0,0 is on the right upper corner.

Definition at line 129 of file Ss_TFT.h.

References SCR_HEIGHT, SCR_HH, SCR_WIDTH, and SCR_WW.

§ SetPORTRAIT()

void SetPORTRAIT ( )
inline

It sets the display orientation. When you create the instance, the Display is sets to the portrait orientation. You can force this setting using SetLANDSCAPE or SetPORTRAIT. The coordinate 0,0 is on the right upper corner.

Definition at line 131 of file Ss_TFT.h.

References SCR_HEIGHT, SCR_HH, SCR_WIDTH, and SCR_WW.

§ SetXY()

void SetXY ( unsigned int  x1,
unsigned int  y1,
unsigned int  x2,
unsigned int  y2 
)

Definition at line 231 of file Ss_TFT.cpp.

References LCD_Write_CD(), and LCD_Write_COMM8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ TouchGetPoint()

void TouchGetPoint ( )

Transforms raw touch screen coordinates to real X,Y pixel. If you need it, you can read coordinates reading Tc_X e Tc_Y.

lcd.TouchGetPoint();
int lx=lcd.Tc_X;
int ly=lcd.Tc_Y;

Definition at line 1247 of file Ss_TFT.cpp.

References HPulse(), Read7843(), SCR_XX, SCR_YY, T_CLK, Tc_X, Tc_Y, TouchRawCalibSCR_XX, TouchRawCalibSCR_YY, TouchRawCalibX, TouchRawCalibY, TouchRawX, and TouchRawY.

+ Here is the call graph for this function:

§ TouchGetX()

unsigned int TouchGetX ( )

Definition at line 1309 of file Ss_TFT.cpp.

References SCR_WW, TouchRawCalibSCR_XX, TouchRawCalibX, and TouchRawX.

§ TouchGetY()

unsigned int TouchGetY ( )

Definition at line 1316 of file Ss_TFT.cpp.

References SCR_HH, TouchRawCalibSCR_YY, TouchRawCalibY, and TouchRawY.

§ TouchInitial()

void TouchInitial ( )

Initialize touch screen capabilities

Definition at line 1191 of file Ss_TFT.cpp.

§ Touchpin()

void Touchpin ( int  tclk,
int  tcs,
int  tdin,
int  dout,
int  irq 
)

Definition at line 1176 of file Ss_TFT.cpp.

References T_CLK, T_CS, T_DIN, T_DOUT, and T_IRQ.

§ TouchReady()

bool TouchReady ( )

Return true if touch sensor was touched

Definition at line 1300 of file Ss_TFT.cpp.

§ VLine()

void VLine ( short  x,
short  y,
short  ln 
)

Draw vertical line

Parameters
xx coordinate of starting point
yy coordinate of starting point
lnlenght of line

Definition at line 473 of file Ss_TFT.cpp.

References ForeColor, LCD_Write8x2(), SCR_YY, and SetXY().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ Write7843()

void Write7843 ( uint8_t  num)

Definition at line 1199 of file Ss_TFT.cpp.

Member Data Documentation

§ BackColor

unsigned short BackColor

Definition at line 194 of file Ss_TFT.h.

§ ForeColor

unsigned short ForeColor

Definition at line 193 of file Ss_TFT.h.

§ LCD_CS

int LCD_CS

Definition at line 201 of file Ss_TFT.h.

§ LCD_REST

int LCD_REST

Definition at line 201 of file Ss_TFT.h.

§ LCD_RS

int LCD_RS

Definition at line 201 of file Ss_TFT.h.

§ LCD_WR

int LCD_WR

Definition at line 201 of file Ss_TFT.h.

§ LocalFont

Font LocalFont

Definition at line 127 of file Ss_TFT.h.

§ SCR_HEIGHT

unsigned short SCR_HEIGHT

Definition at line 195 of file Ss_TFT.h.

§ SCR_HH

unsigned short SCR_HH

Definition at line 195 of file Ss_TFT.h.

§ SCR_WIDTH

unsigned short SCR_WIDTH

Definition at line 195 of file Ss_TFT.h.

§ SCR_WW

unsigned short SCR_WW

Definition at line 195 of file Ss_TFT.h.

§ SCR_XX

unsigned short SCR_XX

Definition at line 195 of file Ss_TFT.h.

§ SCR_YY

unsigned short SCR_YY

Definition at line 195 of file Ss_TFT.h.

§ Service

uint8_t Service

Definition at line 192 of file Ss_TFT.h.

§ T_CLK

int T_CLK

Definition at line 200 of file Ss_TFT.h.

§ T_CS

int T_CS

Definition at line 200 of file Ss_TFT.h.

§ T_DIN

int T_DIN

Definition at line 200 of file Ss_TFT.h.

§ T_DOUT

int T_DOUT

Definition at line 200 of file Ss_TFT.h.

§ T_IRQ

int T_IRQ

Definition at line 200 of file Ss_TFT.h.

§ Tc_X

int Tc_X

Definition at line 118 of file Ss_TFT.h.

§ Tc_Y

int Tc_Y

Definition at line 118 of file Ss_TFT.h.

§ TouchRawCalibSCR_XX

int TouchRawCalibSCR_XX

Definition at line 116 of file Ss_TFT.h.

§ TouchRawCalibSCR_YY

int TouchRawCalibSCR_YY

Definition at line 117 of file Ss_TFT.h.

§ TouchRawCalibX

int TouchRawCalibX

Definition at line 116 of file Ss_TFT.h.

§ TouchRawCalibY

int TouchRawCalibY

Definition at line 117 of file Ss_TFT.h.

§ TouchRawX

int TouchRawX

Definition at line 115 of file Ss_TFT.h.

§ TouchRawY

int TouchRawY

Definition at line 115 of file Ss_TFT.h.


The documentation for this class was generated from the following files: