Tipro API
Communicate with Tipro devices
BF22_IntFn.h
1 #pragma once
2 
3 // BF22_IntFn.h :
5 
6 
8 // FW documentation
9 
10 /*
11 BF22-KBD podžava slijedeæe „0xF0“ komande:
12 
13 typedef enum enum_TtbsMsgKbdType
14 {
15 / * CMD_XXX messages @ KBD ************************************************* /
16 
17 TBS_MSGT_KBD_LED_CTRL = 0x00, / * LED control (WR/RD) * /
18 TBS_MSGT_KBD_LED_LUMINANCE = 0x10, / * LED luminance (WR/RD) * /
19 TBS_MSGT_KBD_LED_LUMINANCE_SYNC = 0x14, / * LED luminance sync (set, update EEP, FW COM-data) * /
20 
21 } TtbsMsgKbdType;
22 
23 
24 TBS_MSGT_KBD_LED_LUMINANCE i TBS_MSGT_KBD_LED_LUMINANCE_SYNC se koriste isto kao SBX,
25 kodiraju se isto, samo je razlika u nazivu(src FW).
26 No, tebi te 2 komande vjerojatno ne trebaju za changeMe.
27 
28 TBS_MSGT_KBD_LED_CTRL ima isti 0xF0 - subCode kao i LED_CTRL za SBX, ali ima drugaèiju LED funkciju, i drugaèije parametre.
29 Evo opis(dalje pišem na engleskom) :
30 
31  data - block parameter
32 
33  0x00 TBS_MSGT_KBD_LED_CTRL(0x00)
34  0x01 LED - mask, low(mask for LEDs to be controlled, refers to more following pars, i.e.green - state, red - state, green - blink, red - blink; #1..16->bits 0..15)
35  0x02 LED - mask, high
36  0x03 green - LED - ctrl, low(control #1..16->bits 0..15; 0 / 1->off / on)
37  0x04 green - LED - ctrl, high
38  0x05 red - LED - ctrl, low(control #1..16->bits 0..15; 0 / 1->off / on)
39  0x06 red - LED - ctrl, high
40  (next block is optional; 0x07..0x0A – LED blinking)
41  0x07 blink - green - LED, low(flags for blikining LEDs; #1..16->bits 0..15; 0 / 1->steady / blink – steady LED in either off or on, blinking LED is aternating on / off with A / B - timing)
42  0x08 blink - green - LED, high
43  0x09 blink - red - LED, low(flags for blikining LEDs; #1..16->bits 0..15; 0 / 1->steady / blink – steady LED in either off or on, blinking LED is aternating on / off with A / B - timing)
44  0x0A blink - red - LED, high
45  (next block is optional; 0x0B..0x0E – LED - blink timing, refers to all blinkng - LEDs)
46  0x0B LED - blink - A - timing, low(in ms; defines duration of on / off blinking phase for a blinkng - LED which is set on / off via LED - ctrl)
47  0x0C LED - blink - A - timing, high
48  0x0D LED - blink - B - timing, low(in ms; defines duration of off / on blinking phase for a blinkng - LED which is set on / off via LED - ctrl)
49  0x0E LED - blink - B - timing, high
50  (next block is optional; 0x0F..0x1A – EEP parameters)
51  0x0F EEP - green - LED - init, low(inital green - LED state)
52  0x10 EEP - green - LED - init, high
53  0x11 EEP - red - LED - init, low(inital red - LED state)
54  0x12 EEP - red - LED - init, high
55  0x13 EEP - green - LED - blink - init, low(inital green - LED blinking)
56  0x14 EEP - green - LED - blink - init, high
57  0x15 EEP - red - LED - blink - init, low(inital red - LED blinking)
58  0x16 EEP - red - LED - blink - init, high
59  0x17 EEP - LED - blink - A - timing - init, low(inital blink - A - timing)
60  0x18 EEP - LED - blink - A - timing - init, high
61  0x19 EEP - LED - blink - B - timing - init, low(inital blink - B - timing)
62  0x1A EEP - LED - blink - B - timing - init, high
63 
64  Ako je data - block toèno 7 / 11 / 15 / 27 bytes; upravljaš sa green & red LEDs, uz eventualne opcijske parametre.
65  Ako je data - block bilo koje druge duljine, dobivaš aktualni LED - status kao odgovor(25 bytes) :
66 
67  0x00 TBS_MSGT_KBD_LED_CTRL(0x00)
68  0x01, 0x02 green - LED - ctrl state
69  0x03, 0x04 red - LED - ctrl state
70  0x05, 0x06 blink - green - LED
71  0x07, 0x08 blink - red - LED
72  0x09, 0x0A LED - blink - A - timing
73  0x0B, 0x0C LED - blink - B - timing
74  0x0D, 0x0E EEP - green - LED - init
75  0x0F, 0x10 EEP - red - LED - init
76  0x11, 0x12 EEP - green - LED - blink - init
77  0x13, 0x14 EEP - red - LED - blink - init
78  0x15, 0x16 EEP - LED - blink - A - timing - init
79  0x17, 0x18 EEP - LED - blink - B - timing - init
80 
81 */
82 
83 
84 /* linekeys commands, functions */
85 
86 #define TBS_MSGT_KBD_LED_CTRL 0x00 /* LED control (WR/RD) */
87 #define TBS_MSGT_XXX_KBD_LED_CTRL_PARAM_LEN 11 //set colors and blinking
88 #define TBS_MSGT_XXX_KBD_LED_CTRL_DEF_PARAMS {TBS_MSGT_KBD_LED_CTRL, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // init value for array of parameters, all LEDs off
89 #define TBS_MSGT_XXX_KBD_LED_CTRL_RESPONSE_LEN 25+0x7F // (1 byte for CMD and 24 bytes for parameters + 128 bytes just in case)
90 #define TBS_MSGT_XXX_KBD_LED_CTRL_PARAM_LEN_RESP 0x01 // Reading current/init parameters requires only command code to be sent
91 #define TBS_MSGT_XXX_KBD_LED_CTRL_DEF_PARAMS_RESP {TBS_MSGT_KBD_LED_CTRL}
92 
93 #define TBS_MSGT_KBD_LED_LUMINANCE 0x10 /* LED luminance (WR/RD) */
94 #define TBS_MSGT_KBD_LED_LUMINANCE_SYNC 0x14 /* LED luminance sync (set, update EEP, FW COM-data) */
95 
96 int intFn_BF22_SetLineKeysLedState(TiproHidDevice *device, int nAddress, int nKey1State, int nKey2State, int nKey3State, int nKey4State, int nKey5State, int nKey6State, int nKey7State,
97  int nKey8State, int nKey9State, int nKey10State, int nKey11State, int nKey12State, int nKey13State, int nKey14State, int nKey15State, int nKey16State);
98 
99 int intFn_BF22_GetLineKeysLedState(TiproHidDevice *device, int nAddress, int *nKey1State, int *nKey2State, int *nKey3State, int *nKey4State, int *nKey5State, int *nKey6State, int *nKey7State,
100  int *nKey8State, int *nKey9State, int *nKey10State, int *nKey11State, int *nKey12State, int *nKey13State, int *nKey14State, int *nKey15State, int *nKey16State);
Definition: TiproHidDevice.h:29