Skip to content

Support for don't care writes in I2C #135

Description

@simonsso

Motivation

I have a test case where there are a ton of I²C writes which I don't care about in this specific test. I still want to mock execute them but the data written is not relevant.

Implementation

I have some ideas how this could be implemented.

  1. The impl Transaction block 1 could be extended with a function write_ignore then either implemented by extending the enum Mode2 with WriteIgnore or a new field in the Transaction struct3

  2. Another way would be to add an option to write()4 but that would break all tests for every user of the I²C whether they want this feature or not, so I don't think that is the path forward.

  3. The same builder style interface as with_error5 could be used to modify Transaction

  • Are there any negative implications I did not consider?
  • Any preferred implementation style?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions