Go to the documentation of this file.
30 #if !defined(_CINOSSIOTFT)
39 #include <xmlparser.h>
41 class CINOSSerialInOut;
49 #define DF_SIO_TFT_MOD_XDB "xcfg-mod-sio-tft"
52 #define DF_SIOTFT_KEY_NOP 0
53 #define DF_SIOTFT_KEY_ENTER 1
54 #define DF_SIOTFT_KEY_DELETE 2
55 #define DF_SIOTFT_KEY_UP 3
56 #define DF_SIOTFT_KEY_DOWN 4
57 #define DF_SIOTFT_KEY_LEFT 5
58 #define DF_SIOTFT_KEY_RIGHT 6
59 #define DF_SIOTFT_KEY_CLEAR 7
60 #define DF_SIOTFT_KEY_ESCAPE 8
61 #define DF_SIOTFT_KEY_LAYOUT 9
63 #define DF_SIOTFT_EVENT_QUEUE_SIZE 16
66 #define DF_SIOTFT_NORMAL 0x00000000
67 #define DF_SIODIS_STRETCHX 0x00000001
68 #define DF_SIODIS_STRETCHY 0x00000002
69 #define DF_SIOTFT_STRETCH (DF_SIODIS_STRETCHX|DF_SIODIS_STRETCHY)
70 #define DF_SIODIS_INVERT 0x00000004
72 #define DF_SIOTFT_Pix_X 480
73 #define DF_SIOTFT_Pix_Y 272
76 #define DF_SIOTFT_DC1 0x11
77 #define DF_SIOTFT_DC2 0x12
78 #define DF_SIOTFT_ESC 0x1B
79 #define DF_SIOTFT_ACK 0x06
80 #define DF_SIOTFT_NAK 0x15
83 #define DF_SIOTFT_CMD_AREA 0xD0
86 #define DF_SIOTFT_Col_transparent 0
87 #define DF_SIOTFT_Col_black 1
88 #define DF_SIOTFT_Col_blue 2
89 #define DF_SIOTFT_Col_red 3
90 #define DF_SIOTFT_Col_green 4
91 #define DF_SIOTFT_Col_magenta 5
92 #define DF_SIOTFT_Col_cyan 6
93 #define DF_SIOTFT_Col_yellow 7
94 #define DF_SIOTFT_Col_white 8
95 #define DF_SIOTFT_Col_dark_gray 9
96 #define DF_SIOTFT_Col_orange 10
97 #define DF_SIOTFT_Col_purple 11
98 #define DF_SIOTFT_Col_light_red 12
99 #define DF_SIOTFT_Col_dark_cyan 13
100 #define DF_SIOTFT_Col_light_green 14
101 #define DF_SIOTFT_Col_light_blue 15
102 #define DF_SIOTFT_Col_gray 16
105 #define DF_SIOTFT_Cursor_OFF 0
106 #define DF_SIOTFT_Cursor_ON 1
163 eTftRplAnaTouch = 0x00000001
164 , eTftRplMatrix = 0x00000002
165 , eTftRplTouchArea = 0x00000004
166 , eTftRplProjectName = 0x00000008
167 , eTftRplInternalInfo = 0x00000010
168 , eTftRplHardCopy = 0x00000020
255 uint8 m_uColorNormal;
256 uint8 m_uColorSelected;
284 m_uNumber=0;m_iWidth=-1;m_uHeight=0;m_uZoomX=0;m_uZoomY=0;
287 uint8 GetRealWidth() {
290 return m_iWidth*m_uZoomX;
293 uint8 GetRealHeight() {
294 return m_uHeight*m_uZoomY;
301 uint16 m_uFrameLength;
302 uint8 m_uBuffer[259];
309 uint8 m_uBuffer[256];
322 if ((uint16)m_uAddrIn<
sizeof(m_uBuffer)) {
323 m_uBuffer[m_uAddrIn++]=auByte;
331 return m_uAddrIn-m_uAddrOut;
338 return m_uBuffer[m_uAddrOut++];
466 const char* apDefaultText,
char* apInputText, uint32 auBufferSize,
467 const char* apKbdDef=NULL,
const char* apKbdLayoutName=NULL,
468 uint32 auReqKeyBoard= 0);
554 uint16 auCoordY,
char* apText, uint8 auLength=255, uint8 auEndChar=0);
569 char* apText, uint8 auLength=255, uint8 auEndChar=0);
586 uint16 auEndCoordX, uint16 auEndCoordY);
596 uint16 auEndCoordX, uint16 auEndCoordY);
634 uint16 auEndCoordX, uint16 auEndCoordY, uint8 auColorNo);
659 uint16 auEndCoordX, uint16 auEndCoordY);
688 uint8* apData, uint16 auDataLen);
705 uint8 auAnimNr, uint8 auPictureNr);
799 uint8 auColNormFill, uint8 auColSelOut, uint8 auColSelIn,
841 uint16 auSizeY, uint8 auUpCode, uint8 auDownCode,
char* apText,
842 ETextAlignment aeAlignment=eTACenter);
855 uint16 auSizeY, uint8 auUpCode, uint8 auDownCode,
char* apText);
895 uint16 auCoordY=DF_SIOTFT_Pix_Y, uint8 auValue=1);
913 ETftError SendData(uint8* apData, uint8 auLength);
930 {
return (strcmp(
GetName(), aName)<0);}
931 int operator == (
const char* aName)
932 {
return (strcmp(
GetName(), aName)==0);}
952 virtual CINCOObject*
GetRegister(CINCOObject* apObject=NULL);
1002 bool abEnableRetry=
false,
bool abAcceptTimeout=
false);
1008 void ParseReply(uint8* apRecBuffer, uint16 auRecBufferSize);
1028 uint8
CalcBcc(uint8 auBuffer[], uint16 auStart, uint16 auLength);
1041 ETftError SendData(uint16 auLength,
bool abSynch=
true);
1121 #endif // _CINOSSIOTFT
char m_cProjectName[256]
Project name as read from display.
Definition: cinossiotft.h:1098
static CINOSContainer< CINOSSioTft > * m_pTfts
List of available displays.
Definition: cinossiotft.h:1050
int operator<(CINOSSioTft &aObject)
binary tree operators
Definition: cinossiotft.h:925
uint8 Level()
Return fifo buffer level.
Definition: cinossiotft.h:330
ETftError TFT_TextColor(uint8 auForeColor, uint8 auBackColor)
Set graphic text colors.
ETftError TFT_LoadMacroFile(const char *sTableName)
Load the .df file from the database to the TFT.
static void Create()
Create and initialize display handler.
Definition: cinossiotft.h:941
CINOSSerialInOut * m_pSio
Interface object.
Definition: cinossiotft.h:1058
ETftError TouchButton(STouchButton aBtn)
Define a touch button with all possible properties.
char m_cInputBuffer[128]
Edit value input buffer.
Definition: cinossiotft.h:1066
ETftError ResetDisplay()
Init display and clear it.
int32 m_iHardCopyDataSize
Definition: cinossiotft.h:1107
bool GetEvent(STFTEvent &arEvent)
Get display event (pressed/released buttons, touches, keys).
uint32 m_uReplyMask
Mask of successful replies.
Definition: cinossiotft.h:1096
uint32 m_uDataFlashUsed
Used size of data flash in bytes.
Definition: cinossiotft.h:213
Information about a system font.
Definition: cinossiotft.h:275
Communication fifo buffer.
Definition: cinossiotft.h:306
Define a button's font.
Definition: cinossiotft.h:253
void SetWidth(uint16 auWidth)
Set the display width e.g. as read from display info.
Definition: cinossiotft.h:957
uint8 m_uEventRead
Read index in event queue.
Definition: cinossiotft.h:1091
void SetHeight(uint16 auHeight)
Set the display height e.g. as read from display info.
Definition: cinossiotft.h:964
bool m_bUseRLE
defines whether hardcopy has to be taken with RLE compression
Definition: cinossiotft.h:229
EBlockTextAlignment
Define text alignment in block text output.
Definition: cinossiotft.h:133
ETftError TFT_InstrumentClear(uint8 auInstrumentNr=0)
Clear instrument (one or all).
uint32 SendTest()
Test function.
ETftError TFT_TouchSwitch(uint16 auCoordX, uint16 auCoordY, uint16 auSizeX, uint16 auSizeY, uint8 auUpCode, uint8 auDownCode, char *apText)
Define manually switchable touch button.
ETftError TFT_MacroDisable(char acTyp, uint8 auFirst, uint8 auLast)
Disable macro (range).
uint8 CalcBcc(uint8 auBuffer[], uint16 auStart, uint16 auLength)
Calculate checksum.
bool GetFontInfo(uint8 auNumber, STFTFontInfo &arInfo)
Get info about font.
Define a button's colors.
Definition: cinossiotft.h:238
ETftError TFT_TouchFrameColor(uint8 auColNormOut, uint8 auColNormIn, uint8 auColNormFill, uint8 auColSelOut, uint8 auColSelIn, uint8 auColSelFill)
Set touch button frame color.
ETftError RetryGetData(uint8 RecBuf[])
Retry to get data from display (see GetData)
uint16 m_uHeight
Number of pixels of whole display height.
Definition: cinossiotft.h:1064
virtual T * GetAt(uint32 auIndex)
return pointer to entity auIndex
Definition: cinoscontainer.h:453
uint32 m_uHardCopyBufferSize
Hard copy buffer size.
Definition: cinossiotft.h:1109
ETftError TFT_Brightness(uint16 auBrightness)
Set display brightness.
ETftError TFT_LineDraw(uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY)
Draw a line.
uint16 m_uCRCRomS
Supposed CRC of ROM.
Definition: cinossiotft.h:205
XMLNode m_xConfigNode
Xml config node.
Definition: cinossiotft.h:1052
ETftError TFT_BitmapInternal(uint16 auStartCoordX, uint16 auStartCoordY, uint8 auPictureNr)
Paint a picture from internal memory.
uint32 m_uDataFlashSize
Complete size of data flash in bytes.
Definition: cinossiotft.h:211
ETftError GetBufferInfo(uint8 &auSend, uint8 &auReceive, bool abEnableRetry=false, bool abAcceptTimeout=false)
Get number of bytes in display's send and receive buffer.
ETftError TFT_TouchClearButton(uint8 auBtnCode=0, uint8 auValue=1)
Clear a touch button.
void Put(uint8 auByte)
Add byte to fifo buffer.
Definition: cinossiotft.h:320
int16 m_iStartYY1
Y-Coordinate for hardcopy upper left corner (yy1)
Definition: cinossiotft.h:223
int16 m_iStartXX1
X-Coordinate for hardcopy upper left corner (xx1)
Definition: cinossiotft.h:221
CINOSContainer declaration file.
SComBuffer m_TxBuffer
Transmit buffer.
Definition: cinossiotft.h:1079
ETftError TFT_RectangleFill(uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY, uint8 auColorNo)
Draw a filled rectangle.
ETftError TFT_TermCursorPos(uint8 auColumn, uint8 auRow)
Set terminal cursor position.
uint8 SendReceive(bool abSynch=true)
Send out data and wait for acknowledge.
ETftError TFT_AnimSingle(uint16 auStartCoordX, uint16 auStartCoordY, uint8 auAnimNr, uint8 auPictureNr)
Show a single picture of an animation.
ETftError TFT_TouchArea(uint16 auCoordX, uint16 auCoordY, uint16 auSizeX, uint16 auSizeY)
Define free touch area.
ETftError TFT_TouchClearArea(uint16 auCoordX=480, uint16 auCoordY=272, uint8 auValue=1)
Clear touch area surrounding given coordinate.
ETftError TFT_RectangleDraw(uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY)
Draw a rectangle.
uint16 m_uSizeX
Display X resolution.
Definition: cinossiotft.h:191
virtual T * Find(const char *apName)
return pointer to entity 'apName'
Definition: cinoscontainer.h:447
ETftError TFT_FrameDraw(uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY)
Draw a frame with current definition at given position.
Definition: cinossiotft.h:172
static void Add(CINOSSioTft *apTft)
Add display to list.
Definition: cinossiotft.h:375
ETftReply
Type of replies successfully received from tft display.
Definition: cinossiotft.h:161
ETftError TFT_LineContinue(uint16 auEndCoordX, uint16 auEndCoordY)
Draw a line continuing from last end position.
static uint32 GetNumber()
Get number of displays in list.
Definition: cinossiotft.h:385
void ParseReply(uint8 *apRecBuffer, uint16 auRecBufferSize)
Parse buffer for replies.
ETftError TFT_HardCopy(STFTHardcopy aInstr)
Stores a hard copy (screenshot) of the current display to the buffer.
ETftError TFT_TextOutputBlock(uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY, EBlockTextAlignment aeBlockAlignment, char *apText, uint8 auLength=255, uint8 auEndChar=0)
Write graphical text inside a block, filled with back color.
ETftError TFT_ProjectName(char *apBuffer, uint16 auSize)
Get name of project burned into display.
virtual ~CINOSSioTft()
Sio Tft display destructor.
char m_cTouchInfoY[2]
Touch info, '+' Y direction recognized ('-' if not).
Definition: cinossiotft.h:201
uint16 m_uSizeY
Display Y resolution.
Definition: cinossiotft.h:193
uint16 m_uWidth
Number of pixels of whole display width.
Definition: cinossiotft.h:1062
virtual CINCOObject * GetRegister(CINCOObject *apObject=NULL)
Do inco registration and return pointer to it.
const char * GetName()
Get name of display.
Definition: cinossiotft.h:406
virtual void Add(T *apEntity)
add entity to container
Definition: cinoscontainer.h:352
char MapChar(char acChar)
Map char code to lcd code if necessary.
int16 m_iEndYY2
Y-Coordinate for hardcopy lower right corner (yy2)
Definition: cinossiotft.h:227
uint16 m_uEditSizeX
Edit field X size.
Definition: cinossiotft.h:1072
XMLNode GetConfig()
Get config node of display.
Definition: cinossiotft.h:413
ETftError
Errors of tft display functions.
Definition: cinossiotft.h:148
ETftError TFT_GraphicColor(uint8 auForeColor, uint8 auBackColor)
Set graphical colors (text, background).
const char * m_pInterface
Display interface name (Sio).
Definition: cinossiotft.h:1056
ETftError TFT_DisplayFill(uint8 auColorNr)
Fill display with given color.
static CINOSSioTft * GetAt(uint32 auIndex)
Get display by index.
Definition: cinossiotft.h:396
ETftError TFT_MatrixSize(uint8 auNrOfInp, uint8 auNrOfOut, uint8 auFilter)
Define matrix of external keyboard.
virtual bool PreDestroy(bool &bDeleteSelf)
called before destruction (return false if destruction not allowed)
Definition: cinossiotft.h:936
static CINOSSioTft * Find(const char *apName)
Find display object by name.
Definition: cinossiotft.h:364
ETftError TFT_GraphicPattern(uint8 auPatternNr)
Select graphical pattern, used for filled objects.
STFTEvent m_EventQueue[16]
Queue of received events from display.
Definition: cinossiotft.h:1089
uint8 m_uEditBackCol
Backgound color of "input field".
Definition: cinossiotft.h:1076
virtual void PostCreate(void *apParent)
called after creation
Definition: cinossiotft.h:934
uint16 m_uCRCDataFlash
CRC of data flash.
Definition: cinossiotft.h:207
ETftError TFT_TouchFontColor(uint8 auColNormal, uint8 auColSelect)
Set touch button font color.
CINCOObject * GetRegister(bool abLight=false)
get pointer to inco registration
Definition: cinoscontainer.h:634
ETftError TFT_FrameShape(uint8 auFrameNr, uint8 auFrameOrient)
Define the graphical frame.
uint16 m_uEditCoordY
Edit field Y coord.
Definition: cinossiotft.h:1070
ETftError TFT_TermOutput(char *apText)
Write text in terminal.
ETftError TFT_TextOutput(ETextAlignment aeAlignment, uint16 auCoordX, uint16 auCoordY, char *apText, uint8 auLength=255, uint8 auEndChar=0)
Write graphical text.
ETftError TFT_TouchKey(uint16 auCoordX, uint16 auCoordY, uint16 auSizeX, uint16 auSizeY, uint8 auUpCode, uint8 auDownCode, char *apText, ETextAlignment aeAlignment=eTACenter)
Define touch button.
SComFifo m_RxFifo
Receive fifo.
Definition: cinossiotft.h:1081
ETftError TFT_FrameColor(uint8 auColOut, uint8 auColIn, uint8 auColFill)
Set graphical frame colors.
uint16 m_uCRCRom
CRC of ROM.
Definition: cinossiotft.h:203
ETftError TFT_TextFont(uint8 auFontNr)
Set graphical text font.
ETftError TFT_TouchInvert(uint8 auBtnCode, ETouchInvert eSet=eTIToggle)
Invert a touch button.
uint8 m_uSoftwareVersion
Software version.
Definition: cinossiotft.h:195
void ActivateKeyboard(XMLNode axKbdLayout, const char *apName)
Show keyboard on screen.
Structure for internal display info.
Definition: cinossiotft.h:188
char m_cTouchInfoX[2]
Touch info, '+' X direction recognized ('-' if not).
Definition: cinossiotft.h:199
ETftError TFT_TouchFontZoom(uint8 auZoomX, uint8 auZoomY)
Set touch button text font zoom.
ETftError TouchClear()
Clear all touch buttons and areas.
ETftError TFT_DisplayClear()
Clear display content (with background color).
Structure for mapping ASCII special chars to LCD chars.
Definition: cinossiotft.h:181
void ComHandler()
Communication handler, runs in separate task.
ETftError TFT_PointDraw(uint16 auCoordX, uint16 auCoordY)
Draw a point.
virtual uint32 GetNumber()
return number of entities
Definition: cinoscontainer.h:459
const char * m_pName
Display name.
Definition: cinossiotft.h:1054
ETftError TFT_TouchFont(uint8 auFontNr)
Set touch button text font.
CINOSSioTft(XMLNode axConfig)
Cconstructor.
ETftError ClearDisplay()
Clear whole display.
uint8 * m_pHardCopyBuffer
Definition: cinossiotft.h:1104
ETftError TFT_TouchFrameShape(uint8 auFrameNr, uint8 auFrameOrient)
Set touch button frame shape.
ETftError TFT_BitmapLoad(uint16 auStartCoordX, uint16 auStartCoordY, uint8 *apData, uint16 auDataLen)
Transfer and paint a picture.
ETftError TFT_InternalInfos(STFTInternalInfo &arInfo)
Get internal info of display (e.g. resolution).
ETftError TFT_TermCursorEnable(uint8 auSet)
Switch terminal cursor on or off.
int16 m_iEndXX2
X-Coordinate for hardcopy lower right corner (xx2)
Definition: cinossiotft.h:225
uint16 GetHeight()
Get number of vertical pixels.
Definition: cinossiotft.h:427
uint16 m_uEditSizeY
Edit field Y size.
Definition: cinossiotft.h:1074
ETftError TFT_TouchReaction(ETouchReaction aeReaction, uint8 auValue)
Define how display should react on touches.
uint16 m_uEditCoordX
Edit field X coord.
Definition: cinossiotft.h:1068
uint16 GetWidth()
Get number of horizontal pixels.
Definition: cinossiotft.h:420
ETftError TFT_DisplayColor(uint8 auForeColor, uint8 auBackColor)
Set graphic colors.
ETftError TFT_Beep(uint8 auStopRun)
Set beeper.
ETftError TFT_TermColor(uint8 auForeColor, uint8 auBackColor)
Set terminal colors (text, background).
Define a button's frame.
Definition: cinossiotft.h:246
Definition: cinossiotft.h:354
uint32 EditEnterValue(const char *apName, STFTFontInfo &arFontInfo, const char *apDefaultText, char *apInputText, uint32 auBufferSize, const char *apKbdDef=NULL, const char *apKbdLayoutName=NULL, uint32 auReqKeyBoard=0)
Start editing a value.
uint8 m_uEventWrite
Write index in event queue.
Definition: cinossiotft.h:1093
uint8 Get()
Get next byte from fifo buffer.
Definition: cinossiotft.h:337
ETftError GetData(uint8 RecBuf[])
Get data from display.
Definition: cinossiotft.h:218
ETftError TFT_GraphicZoom(uint8 auZoomX, uint8 auZoomY)
Set graphical zoom (point and line thickness).
Definition: cinossiotft.h:300
ETftError TFT_MacroStop(uint8 auStopRun)
Stop/start all macros and animations.
uint32 m_uReadRetries
Number of retries to read data from display.
Definition: cinossiotft.h:1112
CINCOObject * m_pRegister
Inco registration object.
Definition: cinossiotft.h:1060
STFTInternalInfo m_Info
Internal info as read from display.
Definition: cinossiotft.h:1100
uint16 m_uCRCDataFlashS
Supposed CRC of data flash.
Definition: cinossiotft.h:209
ETftError TFT_TextZoom(uint8 auZoomX, uint8 auZoomY)
Set graphical text zoom.
SComFifo m_TxFifo
Transmit fifo.
Definition: cinossiotft.h:1083
char m_cHardwareRevision[2]
Hardware revision.
Definition: cinossiotft.h:197
#define ASSERT_ALWAYS(f)
Definition: inosmacro.h:696
void Reset()
Reset buffer.
Definition: cinossiotft.h:313
Definition: cinostask.h:51