From a6c5a324428c9e0c1091165837ae94b0df58595a Mon Sep 17 00:00:00 2001 From: jake-g00dwin Date: Tue, 17 Mar 2026 18:23:07 -0700 Subject: [PATCH] Adding new docs(markdown) for holding thoughts/ideas on design of i2c and multiple mcu support. --- i2c_design.md | 40 ++++++++++++++++++++++++++++++++++++++++ mcu_support.md | 18 ++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 i2c_design.md create mode 100644 mcu_support.md diff --git a/i2c_design.md b/i2c_design.md new file mode 100644 index 0000000..37e9073 --- /dev/null +++ b/i2c_design.md @@ -0,0 +1,40 @@ +# I2C Design + +# API / Interface + +Ideally the interface should be as simple and portable as possible. + +We don't want the consummer/user of the interface to need to worry about all +the details of implimentation. + +For instance the end-user should be able to in one line setup an I2C bus +and on a second line to send or receive data. + + +I have some functions that I think should ideally be "privite" in normal usage. +But I need to still be able to access those functions or methods during the +testing. + + +## Error handling + +Errors need to be handled such that the end-user doesn't miss this information. + +## Timeouts + +Sometimes there is errors in hardware or bus/hardware failures. These need to +be found quickly and handled. + + + +## Sharing + +The I2C bus needs to be shared sometimes. I need to figure out some ways to +ensure safe sharing of the bus/resources. + +I think maybe the sharing should be implimented externally to the HAL. + + + + + diff --git a/mcu_support.md b/mcu_support.md new file mode 100644 index 0000000..7070e63 --- /dev/null +++ b/mcu_support.md @@ -0,0 +1,18 @@ +# MCU Support + +One issue of note is the need to support multiple families and chipsets. + +For the moments I'm assumign I can use the defines from the CH32FUN project's +headers to handle this issue. + +The other point of interest is that the linker file and toolchain file will +need to be modified to conditionally select options. + +Maybe I need to create multiple linker files, I'm unsure. + + +I also don't know if the newer MCUs in the CH32V00X series have alternate boot +modes or what. + + +