Initial commit
This commit is contained in:
39
i2c-over-tcp/plans.md
Normal file
39
i2c-over-tcp/plans.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# TCP → I2C bridge
|
||||
|
||||
## Authorship
|
||||
|
||||
This document was generated using ChatGPT (OpenAI), version 5.2.
|
||||
It has not been independently reviewed or validated yet.
|
||||
|
||||
# Translation units
|
||||
|
||||
## `i2c_controller.c`
|
||||
|
||||
* `i2c_handle_frame(cmd, payload, len, reply_buf, *reply_len)`
|
||||
* No transport knowledge.
|
||||
* Pure logic + hardware calls.
|
||||
|
||||
|
||||
## `usb_transport.c`
|
||||
|
||||
* Parses frames from CDC.
|
||||
* Calls `i2c_handle_frame()`.
|
||||
* Writes reply back over USB.
|
||||
|
||||
## `tcp_transport.c`
|
||||
|
||||
* Same framing.
|
||||
* Calls same `i2c_handle_frame()`.
|
||||
* Writes reply over TCP.
|
||||
|
||||
|
||||
# Notes
|
||||
|
||||
* The framing + transport layer is swappable.
|
||||
* The I²C logic is isolated.
|
||||
|
||||
# Result
|
||||
|
||||
* USB for development/debug.
|
||||
* TCP for deployment.
|
||||
* Zero duplication of protocol logic.
|
||||
Reference in New Issue
Block a user