components:cr-d-tgp_app:comm
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| components:cr-d-tgp_app:comm [2026/03/16 11:36] – removed - external edit (Unknown date) 127.0.0.1 | components:cr-d-tgp_app:comm [2026/03/16 11:36] (current) – ↷ Page moved from hiq_components:cr-d-tgp_app:comm to components:cr-d-tgp_app:comm goran.kocjancic | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== TGP communication protocol ====== | ||
| + | |||
| + | ===== Data model ===== | ||
| + | |||
| + | * project consists of multiple pages | ||
| + | * each page contains a list of objects | ||
| + | * each object may have one or more associated parameters | ||
| + | * a parameter can be of type: bit, nibble, byte, integer, or long | ||
| + | |||
| + | * sending page command displays the page with objects and their values | ||
| + | * changing an object sends event with parameter index and new value | ||
| + | |||
| + | ===== Message frame ===== | ||
| + | |||
| + | * uart parameters: 115200 8n1 | ||
| + | * integers are little endian (low byte first) | ||
| + | |||
| + | ^ A0h ^ device | ||
| + | | 0 | ||
| + | |||
| + | * A0h - page frame, cybro-to-display | ||
| + | * device - device receiving the message (00h-broadcast, | ||
| + | * page - request to display specified page | ||
| + | * pp0..pp2 - parameters (optional) | ||
| + | * checksum - sum of all bytes before the checksum mod 256 | ||
| + | |||
| + | ^ A1h ^ device | ||
| + | | 0 | ||
| + | |||
| + | * A1h - event frame, display-to-cybro | ||
| + | * device - device sending the message (00h-not defined, 01h..FFh-device number) | ||
| + | * event - event triggered by user | ||
| + | * ep0..ep2 - parameters (optional) | ||
| + | * checksum - sum of all bytes before the checksum mod 256 | ||
| + | |||
| + | |||
| + | ===== Parameter encoding===== | ||
| + | |||
| + | |<500px 100px >| | ||
| + | ^ 1x long | long0 = pp0 + pp1<< | ||
| + | ^ 3x int | int0 = pp0, \\ int1 = pp1, \\ int2 = pp2 | | ||
| + | ^ 6x byte | byte0 = pp0lo, \\ byte1 = pp0hi, \\ byte2 = pp1lo, \\ byte3 = pp1hi, \\ byte4 = pp2lo, \\ byte5 = pp2hi | | ||
| + | ^ 12x nib | nib0 = pp0n0, \\ nib1 = pp0n1, \\ nib2 = pp0n2, \\ nib3 = pp0n3, \\ nib4 = pp1n0, \\ nib5 = pp1n1,\\ ... | | ||
| + | ^ 48x bit | bit0 = pp0b0, \\ bit1 = pp0b1, \\ bit2 = pp0b2, \\ bit3 = pp0b3, \\ bit4 = pp0b4, \\ bit5 = pp0b5,\\ ... | | ||
| + | |||
| + | Any combination of types can be used. | ||
| + | |||
| + | ===== Object specifications ===== | ||
| + | |||
| + | | ^ page ^ event ^ | ||
| + | ^ decimal number | ||
| + | ^ multi-state indicator | ||
| + | ^ push button | ||
| + | ^ toggle button | ||
| + | ^ slider input | enable, value | value (on change, max 200ms) | ||
| + | ^ numeric input | enable, value | value (update on enter) | ||
| + | |||
| + | ===== Cybro-to-Display ===== | ||
| + | |||
| + | ^ page ^ pp0 ^ pp1 ^ pp2 ^ description | ||
| + | ^ 0 | ||
| + | ^ 1 | ||
| + | ^ 2 | ||
| + | ^ 10+ | ||
| + | |||
| + | |||
| + | ===== Display-to-Cybro ===== | ||
| + | |||
| + | ^ event | ||
| + | ^ 0 | ||
| + | ^ 1 | ||
| + | ^ 2 | ||
| + | ^ 10+\\ page | object index | object value | 0 | object change | ||
| + | |||
| + | |||
| + | ===== Example ===== | ||
| + | |||
| + | | A0 | 00 | page=22 | ||
| + | |||
| + | => set page 22, setpoint 22.0°C, disable fan, disable ventilator | ||
| + | |||
| + | | A1 | 00 | page=22 | ||
| + | |||
| + | => setpoint changed to 22.5°C | ||
