TP communication API file. More...
#include "../dn_common.h"
Go to the source code of this file.
Classes | |
struct | CALL_FUNC_TP |
Callback functions of TP event. More... | |
struct | TP_KEY_INFO |
TP key bit mapping. More... | |
struct | TP_TOUCH_INFO |
TP touch bit mapping. More... | |
Macros | |
#define | _DN_EXP_TPCOMM |
#define | TP_CMD_BEEP (0x0C28) |
A definition for the ROBOTalk command which means requests BEEP. More... | |
#define | TP_CMD_BKL_ON (0x0C33) |
A definition for the ROBOTalk command which means requests backlight on. More... | |
#define | TP_CMD_GET_KEYSTATE (0x0C2D) |
A definition for the ROBOTalk command which means requests key state. More... | |
#define | TP_CMD_KEYINFO (0x0C20) |
A definition for the ROBOTalk command which means requests or raised key event. More... | |
#define | TP_CMD_LCD (0x0C49) |
A definition for the ROBOTalk command which means requests change LCD. More... | |
#define | TP_CMD_LED_FLASH (0x0C2B) |
A definition for the ROBOTalk command which means requests LED flash. More... | |
#define | TP_CMD_LED_OFF (0x0C2A) |
A definition for the ROBOTalk command which means requests LED off. More... | |
#define | TP_CMD_LED_ON (0x0C29) |
A definition for the ROBOTalk command which means requests LED on. More... | |
#define | TP_CMD_MTP_DRAW (0x0C81) |
A definition for the ROBOTalk command which means requests draw Mini TP. More... | |
#define | TP_CMD_PING (0x0C2F) |
A definition for the ROBOTalk command which means requests check wire. More... | |
#define | TP_CMD_REQ_ID (0x0EF0) |
A definition for the ROBOTalk command which means requests ID. More... | |
#define | TP_CMD_TOUTCHINFO (0x0C21) |
A definition for the ROBOTalk command which means requests or raised touch event. More... | |
#define | TP_CONN_MAX (1) |
A definition for the maximum count of TP connections. More... | |
#define | TP_ID_CLIENT (0x11) |
A definition for the client ID. More... | |
#define | TP_ID_SERVER (0x90) |
A definition for the server ID. More... | |
#define | TP_RETRY_NAK (2) |
A definition for the retry count of sending and receiving NAK packet. More... | |
#define | TP_RETRY_TIMEOUT (2) |
A definition for the retry count of communication timeout. More... | |
TP communication API file.
Defines TP communication APIs.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file dn_tpcomm.h.
#define _DN_EXP_TPCOMM |
Definition at line 36 of file dn_tpcomm.h.
#define TP_CMD_BEEP (0x0C28) |
A definition for the ROBOTalk command which means requests BEEP.
Definition at line 94 of file dn_tpcomm.h.
#define TP_CMD_BKL_ON (0x0C33) |
A definition for the ROBOTalk command which means requests backlight on.
Definition at line 124 of file dn_tpcomm.h.
#define TP_CMD_GET_KEYSTATE (0x0C2D) |
A definition for the ROBOTalk command which means requests key state.
Definition at line 118 of file dn_tpcomm.h.
#define TP_CMD_KEYINFO (0x0C20) |
A definition for the ROBOTalk command which means requests or raised key event.
Definition at line 82 of file dn_tpcomm.h.
#define TP_CMD_LCD (0x0C49) |
A definition for the ROBOTalk command which means requests change LCD.
Definition at line 130 of file dn_tpcomm.h.
#define TP_CMD_LED_FLASH (0x0C2B) |
A definition for the ROBOTalk command which means requests LED flash.
Definition at line 112 of file dn_tpcomm.h.
#define TP_CMD_LED_OFF (0x0C2A) |
A definition for the ROBOTalk command which means requests LED off.
Definition at line 106 of file dn_tpcomm.h.
#define TP_CMD_LED_ON (0x0C29) |
A definition for the ROBOTalk command which means requests LED on.
Definition at line 100 of file dn_tpcomm.h.
#define TP_CMD_MTP_DRAW (0x0C81) |
A definition for the ROBOTalk command which means requests draw Mini TP.
Definition at line 136 of file dn_tpcomm.h.
#define TP_CMD_PING (0x0C2F) |
A definition for the ROBOTalk command which means requests check wire.
Definition at line 142 of file dn_tpcomm.h.
#define TP_CMD_REQ_ID (0x0EF0) |
A definition for the ROBOTalk command which means requests ID.
Definition at line 76 of file dn_tpcomm.h.
#define TP_CMD_TOUTCHINFO (0x0C21) |
A definition for the ROBOTalk command which means requests or raised touch event.
Definition at line 88 of file dn_tpcomm.h.
#define TP_CONN_MAX (1) |
A definition for the maximum count of TP connections.
Definition at line 46 of file dn_tpcomm.h.
#define TP_ID_CLIENT (0x11) |
A definition for the client ID.
Definition at line 64 of file dn_tpcomm.h.
#define TP_ID_SERVER (0x90) |
A definition for the server ID.
Definition at line 70 of file dn_tpcomm.h.
#define TP_RETRY_NAK (2) |
A definition for the retry count of sending and receiving NAK packet.
Definition at line 52 of file dn_tpcomm.h.
#define TP_RETRY_TIMEOUT (2) |
A definition for the retry count of communication timeout.
Definition at line 58 of file dn_tpcomm.h.
enum LED_STATE |
LED state information.
Enumerator | |
---|---|
LED_OFF |
LED off. |
LED_ON |
LED on. |
LED_FLASH |
LED flash. |
Definition at line 205 of file dn_tpcomm.h.
enum MINITP_COMMAND |
Mini TP command information.
Enumerator | |
---|---|
COLOR_FG |
Sets character color. |
COLOR_BG |
Sets background color. |
COLOR_FILL |
Sets fill color. |
DRAW_STRING |
Draws a string. |
DRAW_LINE |
Draws a line. |
DRAW_RECT |
Draws a rectangle. |
Definition at line 216 of file dn_tpcomm.h.
enum MINITP_PARAM |
Mini TP parameter information.
Definition at line 230 of file dn_tpcomm.h.
enum TP_KEY_ENUM |
TP key information.
Definition at line 160 of file dn_tpcomm.h.
enum TP_STATE |
TP connection state.
Enumerator | |
---|---|
TP_DISCONNECT |
Disconnected. |
TP_CONNECT |
Connected. |
TP_TPLESS |
TP less. |
TP_TPERROR |
Error. |
Definition at line 148 of file dn_tpcomm.h.
enum TP_TOUCH_ENUM |
TP touch information.
Enumerator | |
---|---|
MODE_TOUCH |
TP touched. |
MODE_RELEASE |
TP released. |
Definition at line 195 of file dn_tpcomm.h.
TP beeps.
[in] | fd | File descriptor. |
[in] | time | Beeping time. |
Definition at line 1002 of file dn_tpcomm.c.
HRESULT TPComm_Close | ( | int * | pfd | ) |
Ends TP communication.
[in,out] | pfd | The pointer of File descriptor. |
Definition at line 885 of file dn_tpcomm.c.
HRESULT TPComm_DrawLine | ( | int | fd, |
uint8_t | start_x, | ||
uint8_t | start_y, | ||
uint8_t | end_x, | ||
uint8_t | end_y, | ||
uint8_t | color_fg | ||
) |
Draws a line to Mini TP.
[in] | fd | File descriptor. |
[in] | start_x | The start position for axis X. |
[in] | start_y | The start position for axis Y. |
[in] | end_x | The end position for axis X. |
[in] | end_y | The end position for axis Y. |
[in] | color_fg | The color of drawing line. |
Definition at line 1264 of file dn_tpcomm.c.
Sends Draw Mini TP commands.
[in] | fd | File descriptor. |
[in] | commands | Mini TP commands. |
Definition at line 1062 of file dn_tpcomm.c.
HRESULT TPComm_DrawRectangle | ( | int | fd, |
uint8_t | start_x, | ||
uint8_t | start_y, | ||
uint8_t | end_x, | ||
uint8_t | end_y, | ||
uint8_t | color_fg, | ||
uint8_t | color_bg | ||
) |
Draws a rectangle to Mini TP.
[in] | fd | File descriptor. |
[in] | start_x | The start position for axis X. |
[in] | start_y | The start position for axis Y. |
[in] | end_x | The end position for axis X. |
[in] | end_y | The end position for axis Y. |
[in] | color_fg | The color of drawing rectangle. |
[in] | color_fg | The background color of drawing rectangle. |
Definition at line 1311 of file dn_tpcomm.c.
HRESULT TPComm_DrawString | ( | int | fd, |
BSTR | bstr, | ||
uint8_t | pos_x, | ||
uint8_t | pos_y, | ||
uint8_t | size, | ||
uint8_t | attr, | ||
uint8_t | color_fg, | ||
uint8_t | color_bg | ||
) |
Draws a string to Mini TP.
[in] | fd | File descriptor. |
[in] | bstr | The drawing string. |
[in] | pos_x | The drawing position for axis X. |
[in] | pos_y | The drawing position for axis Y. |
[in] | size | The size of drawing string. |
[in] | attr | The attribute of drawing string. |
[in] | color_fg | The color of drawing string. |
[in] | color_bg | The background color of drawing string. |
Definition at line 1203 of file dn_tpcomm.c.
Gets timeout.
[in] | fd | File descriptor. |
[out] | timeout | The gotten timeout value. |
Definition at line 966 of file dn_tpcomm.c.
HRESULT TPComm_GetTPState | ( | int | fd, |
int * | state | ||
) |
Gets TP state.
[in] | fd | File descriptor. |
[out] | state | The gotten TP state. |
Definition at line 985 of file dn_tpcomm.c.
_DN_EXP_TPCOMM HRESULT TPComm_LCD | ( | int | fd, |
int16_t | contrast | ||
) |
Changes TP LCD.
[in] | fd | File descriptor. |
[in] | contrast | The LCD value. (0: The most darken, 7: The most brightest) note It will take 2 or more seconds to reflect the set LDC value completely. |
Definition at line 1047 of file dn_tpcomm.c.
Changes TP LED.
[in] | fd | File descriptor. |
[in] | number | The LED number. (1: MORTOR, 2: LOCK, -1: Both) |
[in] | state | State to be changed. (0: OFF, 1: ON, 2: FLASH) |
Definition at line 1017 of file dn_tpcomm.c.
Starts TP communication.
[in] | connect | Connection parameters. |
[in] | timeout | Timeout value. |
[in] | client | TP mode flag. (Client: = 1, Server: 0) |
[out] | pfd | The pointer of File descriptor. |
Definition at line 748 of file dn_tpcomm.c.
HRESULT TPComm_SetCallFunc | ( | const struct CALL_FUNC_TP * | func | ) |
Sets callback functions.
[in] | func | Callback functions to be set. |
Definition at line 737 of file dn_tpcomm.c.
Sets timeout.
[in] | fd | File descriptor. |
[in] | timeout | Timeout value to be set. |
Definition at line 935 of file dn_tpcomm.c.