30#if !defined(_CINOSSIOTFT)
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;
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++];
CINOSContainer declaration file.
#define DECLARE_DYNAMIC(aClass)
Definition cinospartitionmemory.h:328
ETftError
Errors of tft display functions.
Definition cinossiotft.h:149
EBlockTextAlignment
Define text alignment in block text output.
Definition cinossiotft.h:134
ETftReply
Type of replies successfully received from tft display.
Definition cinossiotft.h:162
Definition cinosmcmodule.h:1900
Definition cinossiotft.h:355
void SetHeight(uint16 auHeight)
Set the display height e.g. as read from display info.
Definition cinossiotft.h:964
ETftError TFT_HardCopy(STFTHardcopy aInstr)
Stores a hard copy (screenshot) of the current display to the buffer.
static CINOSSioTft * GetAt(uint32 auIndex)
Get display by index.
Definition cinossiotft.h:396
ETftError TFT_TextOutput(ETextAlignment aeAlignment, uint16 auCoordX, uint16 auCoordY, char *apText, uint8 auLength=255, uint8 auEndChar=0)
Write graphical text.
bool GetFontInfo(uint8 auNumber, STFTFontInfo &arInfo)
Get info about font.
void ComHandler()
Communication handler, runs in separate task.
uint8 * m_pHardCopyBuffer
Definition cinossiotft.h:1104
ETftError TFT_GraphicPattern(uint8 auPatternNr)
Select graphical pattern, used for filled objects.
bool GetEvent(STFTEvent &arEvent)
Get display event (pressed/released buttons, touches, keys).
uint32 m_uReadRetries
Number of retries to read data from display.
Definition cinossiotft.h:1112
ETftError TFT_TermCursorEnable(uint8 auSet)
Switch terminal cursor on or off.
ETftError TFT_TouchFontColor(uint8 auColNormal, uint8 auColSelect)
Set touch button font color.
ETftError TFT_TermCursorPos(uint8 auColumn, uint8 auRow)
Set terminal cursor position.
ETftError TFT_RectangleFill(uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY, uint8 auColorNo)
Draw a filled rectangle.
uint32 m_uReplyMask
Mask of successful replies.
Definition cinossiotft.h:1096
ETftError TFT_Beep(uint8 auStopRun)
Set beeper.
uint32 m_uHardCopyBufferSize
Hard copy buffer size.
Definition cinossiotft.h:1109
ETftError TFT_FrameDraw(uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY)
Draw a frame with current definition at given position.
STFTEvent m_EventQueue[16]
Queue of received events from display.
Definition cinossiotft.h:1089
char m_cInputBuffer[128]
Edit value input buffer.
Definition cinossiotft.h:1066
ETftError RetryGetData(uint8 RecBuf[])
Retry to get data from display (see GetData)
ETftError TFT_BitmapLoad(uint16 auStartCoordX, uint16 auStartCoordY, uint8 *apData, uint16 auDataLen)
Transfer and paint a picture.
ETftError TFT_TouchInvert(uint8 auBtnCode, ETouchInvert eSet=eTIToggle)
Invert a touch button.
uint32 SendTest()
Test function.
XMLNode m_xConfigNode
Xml config node.
Definition cinossiotft.h:1052
ETftError TFT_MacroStop(uint8 auStopRun)
Stop/start all macros and animations.
uint16 m_uEditCoordX
Edit field X coord.
Definition cinossiotft.h:1068
ETftError ResetDisplay()
Init display and clear it.
uint8 CalcBcc(uint8 auBuffer[], uint16 auStart, uint16 auLength)
Calculate checksum.
int operator<(CINOSSioTft &aObject)
binary tree operators
Definition cinossiotft.h:925
ETftError TFT_MacroDisable(char acTyp, uint8 auFirst, uint8 auLast)
Disable macro (range).
ETftError TFT_LineDraw(uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY)
Draw a line.
void ActivateKeyboard(XMLNode axKbdLayout, const char *apName)
Show keyboard on screen.
ETftError TFT_GraphicZoom(uint8 auZoomX, uint8 auZoomY)
Set graphical zoom (point and line thickness).
ETftError TFT_DisplayFill(uint8 auColorNr)
Fill display with given color.
uint8 m_uEventRead
Read index in event queue.
Definition cinossiotft.h:1091
uint16 m_uEditSizeY
Edit field Y size.
Definition cinossiotft.h:1074
STFTInternalInfo m_Info
Internal info as read from display.
Definition cinossiotft.h:1100
ETftError TFT_TextFont(uint8 auFontNr)
Set graphical text font.
SComBuffer m_TxBuffer
Transmit buffer.
Definition cinossiotft.h:1079
ETftError SendData(uint16 auLength, bool abSynch=true)
Send data in tx fifo to display.
void ParseReply(uint8 *apRecBuffer, uint16 auRecBufferSize)
Parse buffer for replies.
ETftError TFT_InstrumentClear(uint8 auInstrumentNr=0)
Clear instrument (one or all).
ETftError TFT_TouchFont(uint8 auFontNr)
Set touch button text font.
ETftError GetData(uint8 RecBuf[])
Get data from display.
uint16 m_uEditCoordY
Edit field Y coord.
Definition cinossiotft.h:1070
ETftError TFT_LineContinue(uint16 auEndCoordX, uint16 auEndCoordY)
Draw a line continuing from last end position.
ETftError TFT_PointDraw(uint16 auCoordX, uint16 auCoordY)
Draw a point.
uint8 m_uEditBackCol
Backgound color of "input field".
Definition cinossiotft.h:1076
ETftError TFT_TouchSwitch(uint16 auCoordX, uint16 auCoordY, uint16 auSizeX, uint16 auSizeY, uint8 auUpCode, uint8 auDownCode, char *apText)
Define manually switchable touch button.
ETftError TFT_TouchClearArea(uint16 auCoordX=480, uint16 auCoordY=272, uint8 auValue=1)
Clear touch area surrounding given coordinate.
virtual CINCOObject * GetRegister(CINCOObject *apObject=NULL)
Do inco registration and return pointer to it.
ETftError TFT_GraphicColor(uint8 auForeColor, uint8 auBackColor)
Set graphical colors (text, background).
uint16 GetWidth()
Get number of horizontal pixels.
Definition cinossiotft.h:420
ETftError TFT_LoadMacroFile(const char *sTableName)
Load the .df file from the database to the TFT.
ETftError TFT_TouchKey(uint16 auCoordX, uint16 auCoordY, uint16 auSizeX, uint16 auSizeY, uint8 auUpCode, uint8 auDownCode, char *apText, ETextAlignment aeAlignment=eTACenter)
Define touch button.
ETftError TFT_TouchArea(uint16 auCoordX, uint16 auCoordY, uint16 auSizeX, uint16 auSizeY)
Define free touch area.
ETftError TFT_FrameShape(uint8 auFrameNr, uint8 auFrameOrient)
Define the graphical frame.
ETftError TFT_ProjectName(char *apBuffer, uint16 auSize)
Get name of project burned into display.
ETftError TFT_DisplayClear()
Clear display content (with background color).
uint16 m_uWidth
Number of pixels of whole display width.
Definition cinossiotft.h:1062
XMLNode GetConfig()
Get config node of display.
Definition cinossiotft.h:413
ETftError TFT_InternalInfos(STFTInternalInfo &arInfo)
Get internal info of display (e.g. resolution).
const char * m_pInterface
Display interface name (Sio).
Definition cinossiotft.h:1056
ETftError TFT_TouchFontZoom(uint8 auZoomX, uint8 auZoomY)
Set touch button text font zoom.
SComFifo m_TxFifo
Transmit fifo.
Definition cinossiotft.h:1083
ETftError TFT_TouchFrameColor(uint8 auColNormOut, uint8 auColNormIn, uint8 auColNormFill, uint8 auColSelOut, uint8 auColSelIn, uint8 auColSelFill)
Set touch button frame color.
uint16 GetHeight()
Get number of vertical pixels.
Definition cinossiotft.h:427
static void Create()
Create and initialize display handler.
Definition cinossiotft.h:941
static void Add(CINOSSioTft *apTft)
Add display to list.
Definition cinossiotft.h:375
CINOSSioTft(XMLNode axConfig)
Cconstructor.
const char * GetName()
Get name of display.
Definition cinossiotft.h:406
virtual void PostCreate(void *apParent)
called after creation
Definition cinossiotft.h:934
ETftError TFT_FrameColor(uint8 auColOut, uint8 auColIn, uint8 auColFill)
Set graphical frame colors.
ETftError TFT_TermColor(uint8 auForeColor, uint8 auBackColor)
Set terminal colors (text, background).
const char * m_pName
Display name.
Definition cinossiotft.h:1054
char MapChar(char acChar)
Map char code to lcd code if necessary.
uint16 m_uHeight
Number of pixels of whole display height.
Definition cinossiotft.h:1064
uint16 m_uEditSizeX
Edit field X size.
Definition cinossiotft.h:1072
ETftError TFT_AnimSingle(uint16 auStartCoordX, uint16 auStartCoordY, uint8 auAnimNr, uint8 auPictureNr)
Show a single picture of an animation.
uint8 m_uEventWrite
Write index in event queue.
Definition cinossiotft.h:1093
CINCOObject * m_pRegister
Inco registration object.
Definition cinossiotft.h:1060
virtual bool PreDestroy(bool &bDeleteSelf)
called before destruction (return false if destruction not allowed)
Definition cinossiotft.h:936
ETftError TFT_MatrixSize(uint8 auNrOfInp, uint8 auNrOfOut, uint8 auFilter)
Define matrix of external keyboard.
ETftError TFT_RectangleDraw(uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY)
Draw a rectangle.
ETftError TFT_BitmapInternal(uint16 auStartCoordX, uint16 auStartCoordY, uint8 auPictureNr)
Paint a picture from internal memory.
ETftError TFT_TouchReaction(ETouchReaction aeReaction, uint8 auValue)
Define how display should react on touches.
SComFifo m_RxFifo
Receive fifo.
Definition cinossiotft.h:1081
static uint32 GetNumber()
Get number of displays in list.
Definition cinossiotft.h:385
ETftError TouchButton(STouchButton aBtn)
Define a touch button with all possible properties.
ETftError TFT_TextColor(uint8 auForeColor, uint8 auBackColor)
Set graphic text colors.
ETftError TFT_TextZoom(uint8 auZoomX, uint8 auZoomY)
Set graphical text zoom.
virtual ~CINOSSioTft()
Sio Tft display destructor.
int32 m_iHardCopyDataSize
Definition cinossiotft.h:1107
ETftError TFT_TermOutput(char *apText)
Write text in terminal.
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.
ETftError TFT_TouchClearButton(uint8 auBtnCode=0, uint8 auValue=1)
Clear a touch button.
ETftError ClearDisplay()
Clear whole display.
ETftError GetBufferInfo(uint8 &auSend, uint8 &auReceive, bool abEnableRetry=false, bool abAcceptTimeout=false)
Get number of bytes in display's send and receive buffer.
static CINOSContainer< CINOSSioTft > * m_pTfts
List of available displays.
Definition cinossiotft.h:1050
ETftError TFT_TouchFrameShape(uint8 auFrameNr, uint8 auFrameOrient)
Set touch button frame shape.
char m_cProjectName[256]
Project name as read from display.
Definition cinossiotft.h:1098
CINOSSerialInOut * m_pSio
Interface object.
Definition cinossiotft.h:1058
ETftError TouchClear()
Clear all touch buttons and areas.
void SetWidth(uint16 auWidth)
Set the display width e.g. as read from display info.
Definition cinossiotft.h:957
uint8 SendReceive(bool abSynch=true)
Send out data and wait for acknowledge.
ETftError TFT_DisplayColor(uint8 auForeColor, uint8 auBackColor)
Set graphic colors.
static CINOSSioTft * Find(const char *apName)
Find display object by name.
Definition cinossiotft.h:364
ETftError TFT_Brightness(uint16 auBrightness)
Set display brightness.
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.
Definition cinostask.h:52
#define ASSERT_ALWAYS(f)
Definition inosmacro.h:696
Define a button's font.
Definition cinossiotft.h:254
Define a button's colors.
Definition cinossiotft.h:239
Define a button's frame.
Definition cinossiotft.h:247
Definition cinossiotft.h:300
Communication fifo buffer.
Definition cinossiotft.h:306
uint8 Get()
Get next byte from fifo buffer.
Definition cinossiotft.h:337
void Put(uint8 auByte)
Add byte to fifo buffer.
Definition cinossiotft.h:320
uint8 Level()
Return fifo buffer level.
Definition cinossiotft.h:330
void Reset()
Reset buffer.
Definition cinossiotft.h:313
Structure for mapping ASCII special chars to LCD chars.
Definition cinossiotft.h:182
Definition cinossiotft.h:173
Information about a system font.
Definition cinossiotft.h:276
Definition cinossiotft.h:219
int16 m_iEndXX2
X-Coordinate for hardcopy lower right corner (xx2)
Definition cinossiotft.h:225
int16 m_iStartXX1
X-Coordinate for hardcopy upper left corner (xx1)
Definition cinossiotft.h:221
int16 m_iEndYY2
Y-Coordinate for hardcopy lower right corner (yy2)
Definition cinossiotft.h:227
int16 m_iStartYY1
Y-Coordinate for hardcopy upper left corner (yy1)
Definition cinossiotft.h:223
bool m_bUseRLE
defines whether hardcopy has to be taken with RLE compression
Definition cinossiotft.h:229
Structure for internal display info.
Definition cinossiotft.h:189
uint16 m_uCRCRomS
Supposed CRC of ROM.
Definition cinossiotft.h:205
char m_cHardwareRevision[2]
Hardware revision.
Definition cinossiotft.h:197
uint16 m_uSizeY
Display Y resolution.
Definition cinossiotft.h:193
uint16 m_uCRCDataFlash
CRC of data flash.
Definition cinossiotft.h:207
uint32 m_uDataFlashSize
Complete size of data flash in bytes.
Definition cinossiotft.h:211
uint16 m_uCRCRom
CRC of ROM.
Definition cinossiotft.h:203
char m_cTouchInfoY[2]
Touch info, '+' Y direction recognized ('-' if not).
Definition cinossiotft.h:201
uint32 m_uDataFlashUsed
Used size of data flash in bytes.
Definition cinossiotft.h:213
char m_cTouchInfoX[2]
Touch info, '+' X direction recognized ('-' if not).
Definition cinossiotft.h:199
uint8 m_uSoftwareVersion
Software version.
Definition cinossiotft.h:195
uint16 m_uCRCDataFlashS
Supposed CRC of data flash.
Definition cinossiotft.h:209
uint16 m_uSizeX
Display X resolution.
Definition cinossiotft.h:191