![]() |
McMajan Library Pack
v 2.00
Improve your Arduino !
|
#include <Ss_TFT.h>
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 |
Ss_TFT | ( | ) |
Definition at line 8 of file Ss_TFT.cpp.
References BackColor, ForeColor, SCR_HEIGHT, SCR_HH, SCR_WIDTH, SCR_WW, SCR_XX, SCR_YY, Tc_X, Tc_Y, TouchRawCalibSCR_XX, TouchRawCalibSCR_YY, TouchRawCalibX, and TouchRawCalibY.
void CheckPoint | ( | int * | x, |
int * | y | ||
) |
Definition at line 361 of file Ss_TFT.cpp.
void Circle | ( | int | cx, |
int | cy, | ||
int | radius | ||
) |
Draw empty circle
cx | x coordinate of circle center |
cy | y coordinate of circle center |
radius | radius |
(error&0x80))
Definition at line 576 of file Ss_TFT.cpp.
References plot4points().
void CircleFill | ( | int | x, |
int | y, | ||
int | raggio | ||
) |
Draw filled circle
cx | x coordinate of circle center |
cy | y coordinate of circle center |
radius | radius |
Definition at line 631 of file Ss_TFT.cpp.
References Line().
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.
rgb | optional background color |
Definition at line 416 of file Ss_TFT.cpp.
References ForeColor, RectFill(), SCR_XX, and SCR_YY.
void d32s | ( | short | x, |
short | y, | ||
uint8_t | val | ||
) |
Definition at line 648 of file Ss_TFT.cpp.
void DisplayBitmapChar | ( | int | x, |
int | y, | ||
uint8_t | val, | ||
uint8_t | option = 0 |
||
) |
Definition at line 941 of file Ss_TFT.cpp.
void DisplayChar | ( | short | x, |
short | y, | ||
uint8_t | val, | ||
uint8_t | option = 0 |
||
) |
Definition at line 921 of file Ss_TFT.cpp.
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
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.
Definition at line 1132 of file Ss_TFT.cpp.
void GetLandscapePoint | ( | int * | x, |
int * | y | ||
) |
Definition at line 1162 of file Ss_TFT.cpp.
References SCR_YY.
void HLine | ( | short | x, |
short | y, | ||
short | ln | ||
) |
Draw horizontal line
x | x coordinate of starting point |
y | y coordinate of starting point |
ln | lenght of line |
Definition at line 458 of file Ss_TFT.cpp.
References ForeColor, LCD_Write8x2(), SCR_XX, and SetXY().
void Initialize | ( | ) |
Inizialize dislay in standar portrait orientation
Definition at line 245 of file Ss_TFT.cpp.
References LCD_Write_CD().
void LCD_Write8 | ( | uint8_t | data | ) |
Definition at line 62 of file Ss_TFT.cpp.
void LCD_Write8x2 | ( | unsigned short | dataL | ) |
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().
void LCD_Write_COMM8 | ( | unsigned short | comm | ) |
Definition at line 212 of file Ss_TFT.cpp.
References LCD_Write8x2().
void LCD_Write_DATA8 | ( | unsigned short | data | ) |
Definition at line 219 of file Ss_TFT.cpp.
References LCD_Write8x2().
void Line | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Draw line
x1 | x coordinate of starting point |
y1 | y coordinate of starting point |
x2 | x coordinate of target point |
y2 | y coordinate of target point |
Definition at line 502 of file Ss_TFT.cpp.
References ForeColor, HLine(), LCD_Write_DATA8(), SetXY(), and VLine().
void LineHS | ( | int | x, |
int | y, | ||
int | l | ||
) |
Definition at line 491 of file Ss_TFT.cpp.
References Line().
void LineVS | ( | int | x, |
int | y, | ||
int | l | ||
) |
Definition at line 487 of file Ss_TFT.cpp.
References Line().
void Pixel | ( | int | x, |
int | y | ||
) |
Draw a single dot
x | |
y |
Definition at line 1153 of file Ss_TFT.cpp.
References ForeColor, LCD_Write8x2(), and SetXY().
void plot4points | ( | int | cx, |
int | cy, | ||
int | x, | ||
int | y | ||
) |
void plot4pointsE | ( | int | , |
int | , | ||
int | , | ||
int | |||
) |
unsigned int Read7843 | ( | ) |
Definition at line 1226 of file Ss_TFT.cpp.
References HPulse(), and T_CLK.
void Rect | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1 | ||
) |
Draw empty rectangle
x0 | x coordinate of starting point |
y0 | y coordinate of starting point |
x1 | x coordinate of target point |
y1 | y coordinate of target point |
Definition at line 347 of file Ss_TFT.cpp.
References Line().
void RectFill | ( | int | sx, |
int | sy, | ||
int | ex, | ||
int | ey, | ||
bool | force = 0 |
||
) |
Draw filled rectangle
sx | x coordinate of starting point |
sy | y coordinate of starting point |
ex | x coordinate of target point |
ey | y coordinate of target point |
force | optional 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().
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.
r | red component |
g | green component |
b | blue component |
Definition at line 438 of file Ss_TFT.cpp.
void SetFBcolor | ( | int | FC, |
int | BC | ||
) |
Sets foreground and color using single integer value (for example 0xff00cc
FC | Foreground color |
BC | Background color |
Definition at line 447 of file Ss_TFT.cpp.
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.
r | red component |
g | green component |
b | blue component |
Definition at line 429 of file Ss_TFT.cpp.
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:
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).
Definition at line 881 of file Ss_TFT.cpp.
void SetFontOption | ( | const uint8_t | option | ) |
Definition at line 910 of file Ss_TFT.cpp.
|
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.
|
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.
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().
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.
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.
unsigned int TouchGetX | ( | ) |
Definition at line 1309 of file Ss_TFT.cpp.
References SCR_WW, TouchRawCalibSCR_XX, TouchRawCalibX, and TouchRawX.
unsigned int TouchGetY | ( | ) |
Definition at line 1316 of file Ss_TFT.cpp.
References SCR_HH, TouchRawCalibSCR_YY, TouchRawCalibY, and TouchRawY.
void TouchInitial | ( | ) |
Initialize touch screen capabilities
Definition at line 1191 of file Ss_TFT.cpp.
void Touchpin | ( | int | tclk, |
int | tcs, | ||
int | tdin, | ||
int | dout, | ||
int | irq | ||
) |
bool TouchReady | ( | ) |
Return true if touch sensor was touched
Definition at line 1300 of file Ss_TFT.cpp.
void VLine | ( | short | x, |
short | y, | ||
short | ln | ||
) |
Draw vertical line
x | x coordinate of starting point |
y | y coordinate of starting point |
ln | lenght of line |
Definition at line 473 of file Ss_TFT.cpp.
References ForeColor, LCD_Write8x2(), SCR_YY, and SetXY().
void Write7843 | ( | uint8_t | num | ) |
Definition at line 1199 of file Ss_TFT.cpp.