Classes | Macros | Enumerations | Functions
dn_tpcomm.h File Reference

TP communication API file. More...

#include "../dn_common.h"
Include dependency graph for dn_tpcomm.h:
This graph shows which files directly or indirectly include this file:

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...
 

Enumerations

enum  LED_STATE { LED_OFF = 0, LED_ON, LED_FLASH }
 LED state information. More...
 
enum  MINITP_COMMAND {
  COLOR_FG = 0x10, COLOR_BG = 0x11, COLOR_FILL = 0x12, DRAW_STRING = 0x20,
  DRAW_LINE = 0x30, DRAW_RECT = 0x31
}
 Mini TP command information. More...
 
enum  MINITP_PARAM {
  COLOR_BLACK = 0, COLOR_WHITE = 0xF, COLOR_TRANS = 0xFF, SIZE_SMALL = 0,
  SIZE_MIDDLE = 1, SIZE_LARGE = 2, SIZE_LARGE_H = 3, ATTR_NORMAL = 0,
  ATTR_REVERSE = 1, ATTR_FLASH = 2, ATTR_EMPHASIS = 4, ATTR_UNDERLINE = 8
}
 Mini TP parameter information. More...
 
enum  TP_KEY_ENUM {
  DIAL_MODE_AUTO = 1, DIAL_MODE_MANUAL = 2, DIAL_MODE_TEACH = 4, BTN_DIR_UP = 1,
  BTN_DIR_DOWN = 2, BTN_DIR_LEFT = 4, BTN_DIR_RIGHT = 8, BTN_FUNC_F1 = 1,
  BTN_FUNC_F2 = 2, BTN_FUNC_F3 = 4, BTN_FUNC_F4 = 8, BTN_FUNC_F5 = 16,
  BTN_FUNC_F6 = 32, DIAL_DIR_MINUS = 1, DIAL_DIR_PLUS = 2, JOG_MINUS_J1 = 1,
  JOG_MINUS_J2 = 2, JOG_MINUS_J3 = 4, JOG_MINUS_J4 = 8, JOG_MINUS_J5 = 16,
  JOG_MINUS_J6 = 32, JOG_PLUS_J1 = 1, JOG_PLUS_J2 = 2, JOG_PLUS_J3 = 4,
  JOG_PLUS_J4 = 8, JOG_PLUS_J5 = 16, JOG_PLUS_J6 = 32
}
 TP key information. More...
 
enum  TP_STATE { TP_DISCONNECT = 0, TP_CONNECT, TP_TPLESS, TP_TPERROR }
 TP connection state. More...
 
enum  TP_TOUCH_ENUM { MODE_TOUCH = 0x54, MODE_RELEASE = 0x52 }
 TP touch information. More...
 

Functions

_DN_EXP_TPCOMM HRESULT TPComm_BEEP (int fd, int16_t time)
 TP beeps. More...
 
_DN_EXP_TPCOMM HRESULT TPComm_Close (int *pfd)
 Ends TP communication. More...
 
_DN_EXP_TPCOMM 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. More...
 
_DN_EXP_TPCOMM HRESULT TPComm_DrawMiniTP (int fd, VARIANT commands)
 Sends Draw Mini TP commands. More...
 
_DN_EXP_TPCOMM 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. More...
 
_DN_EXP_TPCOMM 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. More...
 
_DN_EXP_TPCOMM HRESULT TPComm_GetTimeout (int fd, uint32_t *timeout)
 Gets timeout. More...
 
_DN_EXP_TPCOMM HRESULT TPComm_GetTPState (int fd, int *state)
 Gets TP state. More...
 
_DN_EXP_TPCOMM HRESULT TPComm_LCD (int fd, int16_t contrast)
 Changes TP LCD. More...
 
_DN_EXP_TPCOMM HRESULT TPComm_LED (int fd, int16_t number, int16_t state)
 Changes TP LED. More...
 
_DN_EXP_TPCOMM HRESULT TPComm_Open (const char *connect, uint32_t timeout, int client, int *pfd)
 Starts TP communication. More...
 
_DN_EXP_TPCOMM HRESULT TPComm_SetCallFunc (const struct CALL_FUNC_TP *func)
 Sets callback functions. More...
 
_DN_EXP_TPCOMM HRESULT TPComm_SetTimeout (int fd, uint32_t timeout)
 Sets timeout. More...
 

Detailed Description

TP communication API file.

Defines TP communication APIs.

Version
1.1
Date
2014/11/06
2015/01/21 Adds Mini TP functions.
Author
DENSO WAVE

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.

Macro Definition Documentation

#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.

Note
You can change this parameter to 1 or more.

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.

Enumeration Type Documentation

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.

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.

Mini TP parameter information.

Enumerator
COLOR_BLACK 

Color black.

COLOR_WHITE 

Color white.

COLOR_TRANS 

Color transparent.

SIZE_SMALL 

String size to small.

SIZE_MIDDLE 

String size to middle.

SIZE_LARGE 

String size to large.

SIZE_LARGE_H 

String size to large and half width character.

ATTR_NORMAL 

String attribute to normal.

ATTR_REVERSE 

String attribute to reverse.

ATTR_FLASH 

String attribute to flash.

ATTR_EMPHASIS 

String attribute to emphasis.

ATTR_UNDERLINE 

String attribute to underline.

Definition at line 230 of file dn_tpcomm.h.

TP key information.

Enumerator
DIAL_MODE_AUTO 

Auto mode.

DIAL_MODE_MANUAL 

Manual mode.

DIAL_MODE_TEACH 

Teach check mode.

BTN_DIR_UP 

Up button pressed.

BTN_DIR_DOWN 

Down button pressed.

BTN_DIR_LEFT 

Left button pressed.

BTN_DIR_RIGHT 

Right button pressed.

BTN_FUNC_F1 

F1 button pressed.

BTN_FUNC_F2 

F2 button pressed.

BTN_FUNC_F3 

F3 button pressed.

BTN_FUNC_F4 

F4 button pressed.

BTN_FUNC_F5 

F5 button pressed.

BTN_FUNC_F6 

F6 button pressed.

DIAL_DIR_MINUS 

Dial minus

DIAL_DIR_PLUS 

Dial plus

JOG_MINUS_J1 

J1 minus button pressed.

JOG_MINUS_J2 

J2 minus button pressed.

JOG_MINUS_J3 

J3 minus button pressed.

JOG_MINUS_J4 

J4 minus button pressed.

JOG_MINUS_J5 

J5 minus button pressed.

JOG_MINUS_J6 

J6 minus button pressed.

JOG_PLUS_J1 

J1 plus button pressed.

JOG_PLUS_J2 

J2 plus button pressed.

JOG_PLUS_J3 

J3 plus button pressed.

JOG_PLUS_J4 

J4 plus button pressed.

JOG_PLUS_J5 

J5 plus button pressed.

JOG_PLUS_J6 

J6 plus button pressed.

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.

TP touch information.

Enumerator
MODE_TOUCH 

TP touched.

MODE_RELEASE 

TP released.

Definition at line 195 of file dn_tpcomm.h.

Function Documentation

HRESULT TPComm_BEEP ( int  fd,
int16_t  time 
)

TP beeps.

Parameters
[in]fdFile descriptor.
[in]timeBeeping time.

Definition at line 1002 of file dn_tpcomm.c.

HRESULT TPComm_Close ( int *  pfd)

Ends TP communication.

Parameters
[in,out]pfdThe 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.

Parameters
[in]fdFile descriptor.
[in]start_xThe start position for axis X.
[in]start_yThe start position for axis Y.
[in]end_xThe end position for axis X.
[in]end_yThe end position for axis Y.
[in]color_fgThe color of drawing line.

Definition at line 1264 of file dn_tpcomm.c.

HRESULT TPComm_DrawMiniTP ( int  fd,
VARIANT  commands 
)

Sends Draw Mini TP commands.

Parameters
[in]fdFile descriptor.
[in]commandsMini 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.

Parameters
[in]fdFile descriptor.
[in]start_xThe start position for axis X.
[in]start_yThe start position for axis Y.
[in]end_xThe end position for axis X.
[in]end_yThe end position for axis Y.
[in]color_fgThe color of drawing rectangle.
[in]color_fgThe 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.

Parameters
[in]fdFile descriptor.
[in]bstrThe drawing string.
[in]pos_xThe drawing position for axis X.
[in]pos_yThe drawing position for axis Y.
[in]sizeThe size of drawing string.
[in]attrThe attribute of drawing string.
[in]color_fgThe color of drawing string.
[in]color_bgThe background color of drawing string.

Definition at line 1203 of file dn_tpcomm.c.

HRESULT TPComm_GetTimeout ( int  fd,
uint32_t timeout 
)

Gets timeout.

Parameters
[in]fdFile descriptor.
[out]timeoutThe gotten timeout value.

Definition at line 966 of file dn_tpcomm.c.

HRESULT TPComm_GetTPState ( int  fd,
int *  state 
)

Gets TP state.

Parameters
[in]fdFile descriptor.
[out]stateThe 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.

Parameters
[in]fdFile descriptor.
[in]contrastThe 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.

HRESULT TPComm_LED ( int  fd,
int16_t  number,
int16_t  state 
)

Changes TP LED.

Parameters
[in]fdFile descriptor.
[in]numberThe LED number. (1: MORTOR, 2: LOCK, -1: Both)
[in]stateState to be changed. (0: OFF, 1: ON, 2: FLASH)

Definition at line 1017 of file dn_tpcomm.c.

HRESULT TPComm_Open ( const char *  connect,
uint32_t  timeout,
int  client,
int *  pfd 
)

Starts TP communication.

Parameters
[in]connectConnection parameters.
[in]timeoutTimeout value.
[in]clientTP mode flag. (Client: = 1, Server: 0)
[out]pfdThe 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.

Parameters
[in]funcCallback functions to be set.

Definition at line 737 of file dn_tpcomm.c.

HRESULT TPComm_SetTimeout ( int  fd,
uint32_t  timeout 
)

Sets timeout.

Parameters
[in]fdFile descriptor.
[in]timeoutTimeout value to be set.

Definition at line 935 of file dn_tpcomm.c.



bcap_core
Author(s): DENSO WAVE INCORPORATED
autogenerated on Mon Jun 10 2019 13:12:20