| 1 | /* |
|---|
| 2 | * GAINER I/O module command list |
|---|
| 3 | * version: 1.0.0.15 |
|---|
| 4 | * date: 2006.5.27 |
|---|
| 5 | * original: io-module_protocol.xls |
|---|
| 6 | * |
|---|
| 7 | * format: |
|---|
| 8 | * command result comments |
|---|
| 9 | */ |
|---|
| 10 | |
|---|
| 11 | /* |
|---|
| 12 | * Configuration |
|---|
| 13 | */ |
|---|
| 14 | |
|---|
| 15 | KONFIGURATION_n KONFIGURATION_n* n: configuration (1~8) |
|---|
| 16 | |
|---|
| 17 | /* |
|---|
| 18 | * I/O |
|---|
| 19 | */ |
|---|
| 20 | Dxxxx Dxxxx* set all digital outputs, xx: value |
|---|
| 21 | Hn Hn* set specified digital output high, n: port number |
|---|
| 22 | Ln Ln* set specified digital output low, n: port number |
|---|
| 23 | R Rxxxx* get all digital inputs, xx: value |
|---|
| 24 | r rxxxx*rxxxx*… get all digital inputs (continuous mode), xx: value |
|---|
| 25 | E E* exit continuous mode |
|---|
| 26 | |
|---|
| 27 | Tx Tx* set sensitivity for capacitive sensing inputs |
|---|
| 28 | |
|---|
| 29 | Axx…xx A* set all analog outputs, xx: value |
|---|
| 30 | anxx anxx* set specified analog output, n: port number, xx: value (00~FF, 8bit) |
|---|
| 31 | anx…x a* set specified analog output, n: row number, x: value (0~F, 4bit) |
|---|
| 32 | I Ixx…xx* get all analog inputs, xx: value |
|---|
| 33 | i ixx…xx* get all analog inputs (continuous mode), xx: value |
|---|
| 34 | E E* exit continuous mode |
|---|
| 35 | |
|---|
| 36 | Sx Sxx* get specified analog input (continuous mode), xx: value |
|---|
| 37 | E E* exit continuous mode |
|---|
| 38 | |
|---|
| 39 | Mx Mx* ain sampling mode, x:mode (0: scan all channles, 1: scan ain 0/4 only) |
|---|
| 40 | |
|---|
| 41 | /* |
|---|
| 42 | * Button/LED |
|---|
| 43 | */ |
|---|
| 44 | (button pressed) N* the on-board button is pressed (no need to send a get command) |
|---|
| 45 | (button released) F* the on-board button is released (no need to send a get command) |
|---|
| 46 | h h* turn the on-board LED on |
|---|
| 47 | l l* turn the on-board LED off |
|---|
| 48 | |
|---|
| 49 | /* |
|---|
| 50 | * PGA |
|---|
| 51 | */ |
|---|
| 52 | Gxy Gxy* set PGA gain and PGA reference, x: gain, y: reference |
|---|
| 53 | |
|---|
| 54 | /* |
|---|
| 55 | * Misc. |
|---|
| 56 | */ |
|---|
| 57 | Q Q* reboot |
|---|
| 58 | Vx Vx* verbose mode, x: mode (0: disabled, 1: enabled) |
|---|
| 59 | ? ?1.0.0.xx* version number, xx: build number |
|---|
| 60 | |
|---|
| 61 | /* |
|---|
| 62 | General Notes |
|---|
| 63 | all values are in hex and should be in upper case (e.g. 0A, F8...) |
|---|
| 64 | |
|---|
| 65 | Configurations |
|---|
| 66 | configuration ain/din/aout/dout comments |
|---|
| 67 | 0 0/ 0/ 0/ 0 initial configuration just after rebooting |
|---|
| 68 | 1 4/ 4/ 4/ 4 default configuration |
|---|
| 69 | 2 8/ 0/ 4/ 4 |
|---|
| 70 | 3 4/ 4/ 8/ 0 |
|---|
| 71 | 4 8/ 0/ 8/ 0 |
|---|
| 72 | 5 0/16/ 0/ 0 |
|---|
| 73 | 6 0/ 0/ 0/16 |
|---|
| 74 | 7 0/ 8/ 8/ 0 matrix LED control mode |
|---|
| 75 | 8 0/ 8/ 0/ 8 capacitive sensing switch mode (first 4 ports only) |
|---|
| 76 | */ |
|---|