Skip to content

Instantly share code, notes, and snippets.

@Charlie-Sumorok
Created June 22, 2023 01:27
Show Gist options
  • Save Charlie-Sumorok/bb4c2730e3f2b6a8f49f17e5feb183a2 to your computer and use it in GitHub Desktop.
Save Charlie-Sumorok/bb4c2730e3f2b6a8f49f17e5feb183a2 to your computer and use it in GitHub Desktop.
Universal Serial Connector

Universal Serial Connector

Connector

Pins

name source action data
ss0 sender send 0
sc0 sender confirm 0
ss1 sender send 1
sc1 sender confirm 1
rs0 reciever send 0
rc0 reciever confirm 0
rs1 reciever send 1
rc1 reciever confirm 1

Layout

/-----------\
|ss0|sc0|ss1|
|---|---|---|
|rc1|gnd|sc1|
|---|---|---|
|rs1|rc0|rs0|
\-----------/

Protocol

USC has 2 independent channels in opposite directions.

sending 0:
	sender: pulse ss0
	reciever: pulse sc0 (rc0)
	sender: wait for rc0 to be pulsed
sending 1:
	sender: pulse ss1
	reciever: pulse sc1 (rc1)
	sender: wait for rc1 to be pulsed

Data Type Extension

This allows detecting what type of data is being sent.

send 0x1D (GS)
send "USC-mime:"
send mime
send '\r' if request else '\n'
send "Content-Length:"
send the length of the content as an infinity int
if the length is 0, the content ends at 0x04 (EOT)
send content

See Infinity Ints

Example mimes: dev/mouse dev/kbd video/ram;color-space=rgb

Multi Bit Extension

This allows more than 1 bit to be sent before confirming.

send 0x05 ENQ
switch recieve:
	case NAK (0x15):
		done (Multi Bit Extension is not avaliable)
	case ACK (0x06):
		recieve avaliable packet size count as infinity_int<1>
		recieve avaliable packet sizes as infinity_int<1>[]
		send selected size as mask (0 exits)
		communicate over USC
		send 0x04 EOT to exit 1 layer of the multi-bit extention
	default:
		done (Multi Bit Extension is not avaliable)

use +5V for 1 pulses and -5V for 0 pulses to communicate.

Sending NAK is reccomended if the multi-bit extension is not avaliable.

Analog Extension

This allows the wires to carry any signal.

Entered when packet size count is 0x0324. Exit with 4s of silence.

Infinity Ints

infinity_int<1>:
	0??????? => value
	1???????... => size, infinity_int<size>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment