Update 'USB config & command protocol'

Triss 2021-07-24 00:21:28 +00:00
parent 70826340d3
commit 3af2a3e0e2
1 changed files with 21 additions and 2 deletions

@ -38,6 +38,9 @@ These commands work for any mode, and have the same effect across all of them.
A list of all the currently-implemented modes:
1. Default ('misc')
2. (N/A)
3. (N/A: JTAG pinout scanner)
4. SUMP logic analyzer
## Mode 1
@ -54,7 +57,7 @@ A list of all the currently-implemented modes:
* SPI (serprog) command prefix (`0x13`): Perform a SPI command, see below.
* I2C command prefix (`0x14`): Perform an I2C command, see below.
* Temperature sensor command prefix (`0x15`): Perform a temperature sensor command, see below.
* UART↔USB hardware flow control enable/disable (`0x16`): has a single argument byte, `0x00` to disable hardware flow control, any other value to enable. Baud rate and other line control settings are done using the standard USB-CDC line control things.
* UART↔USB hardware flow control enable/disable (`0x16`): has a single argument byte, `0x00` to disable hardware flow control, `0xc3` to read the current value (one byte returned), any other value to enable. Baud rate and other line control settings are done using the standard USB-CDC line control things.
#### SPI commands
@ -136,4 +139,20 @@ The I2C command format used here is based heavily on the one of [I2C-Tiny-USB](h
* Get temperature (`0x02`): returns the 2-byte 8.4 fixed point temperature, little endian.
* Get lower temperature limit (`0x03`): returns the 2-byte minimum temperature fore things start going bad.
* Get upper temperature limit (`0x04`): returns the 2-byte maximum temperature before things start going bad.
* Get critical temperature limit (`0x05`): returns the 2-byte critical temperature when things are going really bad.
* Get critical temperature limit (`0x05`): returns the 2-byte critical temperature when things are going really bad.
## Mode 3 (JTAG pinout scanner) (not yet implemented)
* `0x30`: Get status: no argument bytes, one result byte
* `0x00`: idle
* `0x01`: scan busy
* `0x02`: scan failed
* `0x03`: scan successful
* `0x31`: Get scan result (only if status is `0x03`): no argument bytes, 5 result bytes
* Result: pin numbers of TCK, TMS, TDI, TDO, TRST
* `0x32`: Start scan (only valid if status is not `0x01`): two argument bytes (start and end pin numbers, inclusive), no result bytes
## Mode 4 (SUMP logic analyzer)
* `0x40`: Get overclocking state: no argument bytes, one result byte (overclocking off/on (resp. `0x00` or nonzero) (or amount, device-dependent, depending on what future devices may bring?))
* `0x41`: Set overclocking state: one argument byte, no result bytes (same format as `0x40`)