dn_tpcomm.h
Go to the documentation of this file.
1 #ifndef DN_TPCOMM_H_
2 #define DN_TPCOMM_H_
3 
35 #ifndef _DN_EXP_TPCOMM
36 #define _DN_EXP_TPCOMM
37 #endif /* _DN_EXP_TPCOMM */
38 
39 #include "../dn_common.h"
40 
46 #define TP_CONN_MAX (1)
47 
52 #define TP_RETRY_NAK (2)
53 
58 #define TP_RETRY_TIMEOUT (2)
59 
64 #define TP_ID_CLIENT (0x11)
65 
70 #define TP_ID_SERVER (0x90)
71 
76 #define TP_CMD_REQ_ID (0x0EF0)
77 
82 #define TP_CMD_KEYINFO (0x0C20)
83 
88 #define TP_CMD_TOUTCHINFO (0x0C21)
89 
94 #define TP_CMD_BEEP (0x0C28)
95 
100 #define TP_CMD_LED_ON (0x0C29)
101 
106 #define TP_CMD_LED_OFF (0x0C2A)
107 
112 #define TP_CMD_LED_FLASH (0x0C2B)
113 
118 #define TP_CMD_GET_KEYSTATE (0x0C2D)
119 
124 #define TP_CMD_BKL_ON (0x0C33)
125 
130 #define TP_CMD_LCD (0x0C49)
131 
136 #define TP_CMD_MTP_DRAW (0x0C81)
137 
142 #define TP_CMD_PING (0x0C2F)
143 
149 {
154 };
155 
161 {
173  BTN_FUNC_F5 = 16,
174  BTN_FUNC_F6 = 32,
187  JOG_PLUS_J5 = 16,
188  JOG_PLUS_J6 = 32,
189 };
190 
196 {
197  MODE_TOUCH = 0x54,
198  MODE_RELEASE = 0x52,
199 };
200 
206 {
207  LED_OFF = 0,
210 };
211 
217 {
218  COLOR_FG = 0x10,
219  COLOR_BG = 0x11,
220  COLOR_FILL = 0x12,
221  DRAW_STRING = 0x20,
222  DRAW_LINE = 0x30,
223  DRAW_RECT = 0x31,
224 };
225 
231 {
233  COLOR_WHITE = 0xF,
234  COLOR_TRANS = 0xFF,
244 };
245 
251 {
273 };
274 
280 {
284 };
285 
292 {
293  HRESULT
294  (*Call_TPState)(int state);
295  HRESULT
296  (*Call_TPKeyInfo)(struct TP_KEY_INFO key_info);
297  HRESULT
298  (*Call_TPTouchInfo)(struct TP_TOUCH_INFO touch_info);
299 #if defined(_DEBUG)
300  HRESULT (*Call_TPDefault)(uint16_t command, const uint8_t *data, uint8_t len_data);
301 #endif
302 };
303 
304 #ifdef __cplusplus
305 extern "C"
306 {
307 #endif
308 
315  TPComm_SetCallFunc(const struct CALL_FUNC_TP *func);
316 
326  TPComm_Open(const char *connect, uint32_t timeout, int client, int *pfd);
327 
334  TPComm_Close(int *pfd);
335 
343  TPComm_SetTimeout(int fd, uint32_t timeout);
344 
352  TPComm_GetTimeout(int fd, uint32_t *timeout);
353 
361  TPComm_GetTPState(int fd, int *state);
362 
370  TPComm_BEEP(int fd, int16_t time);
371 
380  TPComm_LED(int fd, int16_t number, int16_t state);
381 
390  TPComm_LCD(int fd, int16_t contrast);
391 
400  TPComm_LCD(int fd, int16_t contrast);
401 
409  TPComm_DrawMiniTP(int fd, VARIANT commands);
410 
425  uint8_t size, uint8_t attr, uint8_t color_fg, uint8_t color_bg);
426 
438  TPComm_DrawLine(int fd, uint8_t start_x, uint8_t start_y, uint8_t end_x,
439  uint8_t end_y, uint8_t color_fg);
440 
453  TPComm_DrawRectangle(int fd, uint8_t start_x, uint8_t start_y, uint8_t end_x,
454  uint8_t end_y, uint8_t color_fg, uint8_t color_bg);
455 
456 #ifdef __cplusplus
457 }
458 #endif
459 
460 #endif /* DN_TPCOMM_H_ */
uint64_t btn_lock
Definition: dn_tpcomm.h:260
short int16_t
Definition: stdint.h:40
unsigned uint32_t
Definition: stdint.h:43
uint64_t btn_stop
Definition: dn_tpcomm.h:253
#define _DN_EXP_TPCOMM
Definition: dn_tpcomm.h:36
_DN_EXP_TPCOMM HRESULT TPComm_GetTPState(int fd, int *state)
Gets TP state.
Definition: dn_tpcomm.c:985
uint64_t dial_dir
Definition: dn_tpcomm.h:267
MINITP_COMMAND
Mini TP command information.
Definition: dn_tpcomm.h:216
TP_TOUCH_ENUM
TP touch information.
Definition: dn_tpcomm.h:195
uint64_t rsv4
Definition: dn_tpcomm.h:268
_DN_EXP_TPCOMM HRESULT TPComm_GetTimeout(int fd, uint32_t *timeout)
Gets timeout.
Definition: dn_tpcomm.c:966
uint16_t pos_x
Definition: dn_tpcomm.h:282
uint16_t pos_y
Definition: dn_tpcomm.h:283
uint64_t btn_speed
Definition: dn_tpcomm.h:263
MINITP_PARAM
Mini TP parameter information.
Definition: dn_tpcomm.h:230
uint64_t rsv1
Definition: dn_tpcomm.h:252
wchar_t * BSTR
Definition: dn_common.h:239
unsigned short uint16_t
Definition: stdint.h:41
unsigned char uint8_t
Definition: stdint.h:39
uint64_t btn_cancel
Definition: dn_tpcomm.h:259
_DN_EXP_TPCOMM HRESULT TPComm_Close(int *pfd)
Ends TP communication.
Definition: dn_tpcomm.c:885
uint64_t btn_m_mod
Definition: dn_tpcomm.h:262
_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.
Definition: dn_tpcomm.c:1311
Callback functions of TP event.
Definition: dn_tpcomm.h:291
uint64_t btn_func
Definition: dn_tpcomm.h:265
LED_STATE
LED state information.
Definition: dn_tpcomm.h:205
int32_t HRESULT
Definition: dn_common.h:61
uint8_t mode
Definition: dn_tpcomm.h:281
uint64_t rsv2
Definition: dn_tpcomm.h:256
unsigned long long uint64_t
Definition: stdint.h:45
uint64_t dial_mode
Definition: dn_tpcomm.h:254
uint64_t rsv3
Definition: dn_tpcomm.h:266
uint64_t btn_r_sel
Definition: dn_tpcomm.h:261
TP_STATE
TP connection state.
Definition: dn_tpcomm.h:148
_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.
Definition: dn_tpcomm.c:1203
uint64_t btn_motor
Definition: dn_tpcomm.h:255
TP touch bit mapping.
Definition: dn_tpcomm.h:279
uint64_t btn_dir
Definition: dn_tpcomm.h:257
uint64_t jog_minus
Definition: dn_tpcomm.h:269
TP_KEY_ENUM
TP key information.
Definition: dn_tpcomm.h:160
uint64_t btn_ok
Definition: dn_tpcomm.h:258
_DN_EXP_TPCOMM HRESULT TPComm_DrawMiniTP(int fd, VARIANT commands)
Sends Draw Mini TP commands.
Definition: dn_tpcomm.c:1062
A type definition for the multi type variable.
Definition: dn_common.h:306
uint64_t rsv5
Definition: dn_tpcomm.h:270
_DN_EXP_TPCOMM HRESULT TPComm_Open(const char *connect, uint32_t timeout, int client, int *pfd)
Starts TP communication.
Definition: dn_tpcomm.c:748
uint64_t rsv6
Definition: dn_tpcomm.h:272
_DN_EXP_TPCOMM HRESULT TPComm_SetTimeout(int fd, uint32_t timeout)
Sets timeout.
Definition: dn_tpcomm.c:935
_DN_EXP_TPCOMM HRESULT TPComm_LCD(int fd, int16_t contrast)
Changes TP LCD.
Definition: dn_tpcomm.c:1047
_DN_EXP_TPCOMM HRESULT TPComm_BEEP(int fd, int16_t time)
TP beeps.
Definition: dn_tpcomm.c:1002
static int connect(SOCKET s, const struct sockaddr *name, int namelen)
_DN_EXP_TPCOMM HRESULT TPComm_LED(int fd, int16_t number, int16_t state)
Changes TP LED.
Definition: dn_tpcomm.c:1017
TP key bit mapping.
Definition: dn_tpcomm.h:250
uint64_t jog_plus
Definition: dn_tpcomm.h:271
uint64_t btn_shift
Definition: dn_tpcomm.h:264
_DN_EXP_TPCOMM HRESULT TPComm_SetCallFunc(const struct CALL_FUNC_TP *func)
Sets callback functions.
Definition: dn_tpcomm.c:737
_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.
Definition: dn_tpcomm.c:1264


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