jamesbowman / i2cdriver

I2CDriver open source tools
https://i2cdriver.com/
BSD 3-Clause "New" or "Revised" License
187 stars 57 forks source link

Display erroneous line conditions #58

Open mbenkmann opened 2 years ago

mbenkmann commented 2 years ago

I was using the i2cdriver while developing i2c handling code for a microcontroller and it would have been very useful if the i2cdriver didn't just display correctly decoded transfers but also incorrect conditions, such as an SCL or SDA line that is stuck low or SCL and SDA go high without producing a proper stop condition. Visually this could be presented as a circle similar to S and P with different letters for different conditions. Technically these would all be timeout conditions, i.e. a start condition occurs, some part of data transfer happens and then the SCL and SDA lines don't change for a certain number of milliseconds (SMBus has 35ms has longest timeout in the specs, so that would be a good number) without there having been a stop condition. Different letters (and colors, if possible) could signal different types of conditions, e.g. a red circle with a number 3 could signify the condition that SCL is stuck low after 3 bits (meaning that 3 clocks were properly observed but the 4th is missing). A green circle with 3 could signify the condition that SCL is stuck high after 3 bits, meaning that SCL went high to clock in the 3rd bit but then didn't go low again. A red circle with "A" in it could signify the condition that SDA is stuck low after acknowledge (preventing the generation of a stop condition). And so on.