Root/
| Source at commit 45f14d214ab31fe28644ef8f61552a3e25330ccf created 11 years 17 days ago. By Werner Almesberger, tornado/fw/tornado.c: experimental code to log ADC samples to memory card | |
|---|---|
| 1 | Protocol |
| 2 | ======== |
| 3 | |
| 4 | <Type> <Seq> <MaxSeq> |
| 5 | |
| 6 | 0 0 X Ping (no further payload) |
| 7 | |
| 8 | 1 0 0 Pong (maybe return version string in the future) |
| 9 | |
| 10 | 2 0 0 Reset (64 bytes reset secret) |
| 11 | |
| 12 | 4 0 N Unlock secret (64 bytes payload) |
| 13 | 4 1..N-1 N Firmware binary (64 bytes payload) |
| 14 | 4 N N First half of hash |
| 15 | |
| 16 | 5 n N Firmware ACK |
| 17 | |
| 18 | 6 0..N-1 N+3 Image binary (64 bytes payload) |
| 19 | 6 N N+3 Salt A |
| 20 | 6 N+1 N+3 Salt B |
| 21 | 6 N+2 N+3 Hash A |
| 22 | 6 N+3 N+3 Hash B |
| 23 | |
| 24 | 7 n 0 Image ACK |
| 25 | |
| 26 | 8 0 4 Parameter block (64 bytes payload) |
| 27 | 8 1 4 Salt A |
| 28 | 8 2 4 Salt B |
| 29 | 8 3 4 Hash A |
| 30 | 8 4 4 Hash B |
| 31 | |
| 32 | 9 n 0 Parameter ACK |
| 33 | |
| 34 | 10 0 0 Sample (64 bytes payload) |
| 35 | |
| 36 | 11 0 0 Sample ACK |
| 37 | |
| 38 | 13 n 0 Samples |
| 39 | |
| 40 | 14 0 4 Diagnostic request (64 bytes payload) |
| 41 | 14 1 4 Salt A |
| 42 | 14 2 4 Salt B |
| 43 | 14 3 4 Hash A |
| 44 | 14 4 4 Hash B |
| 45 | |
| 46 | 15 n 0 Diagnostic response (with payload) |
| 47 | |
| 48 | Unlock, firmware, image, and parameter packets all have a fixed-size |
| 49 | 64 bytes payload. Pings and acknowledgements have no payload. Pongs |
| 50 | may have a variable-size payload. |
| 51 | |
| 52 | Even numbered packet types correspond to packets sent from the remote |
| 53 | controller to the device. Odd numbered packet types correspond to |
| 54 | responses. The device never initiates communication. |
| 55 | |
| 56 | |
| 57 | Image format |
| 58 | ============ |
| 59 | |
| 60 | Two bytes per line. LSB of first byte is LED A1, MSB of last byte is B8. |
| 61 | Unused lines must be set to zero. |
| 62 | |
| 63 | |
| 64 | Sample format |
| 65 | ============= |
| 66 | |
| 67 | Each sample packet has the following structure: |
| 68 | |
| 69 | Offset Size |
| 70 | 0 2 Absolute time of X sample, high 16 bits |
| 71 | 2 8*N N samples |
| 72 | |
| 73 | Where each sample is |
| 74 | |
| 75 | Offset Size |
| 76 | 0 2 Absolute time of X sample, lower 16 bits |
| 77 | 2 2 X sample (0-1023) |
| 78 | 4 2 Absolute time of Y sample, lower 16 bits |
| 79 | 6 2 Y sample (0-1023) |
| 80 | |
| 81 | Byte order is little-endian. |
| 82 | |
Branches:
master
tornado-v1
