40 lines
930 B
Markdown
40 lines
930 B
Markdown
# 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.
|
|
|
|
|
|
|
|
|
|
|