Skip to content

Creating a platform neutral driver #383

@raffaeler

Description

@raffaeler

Not sure if this is already possible, but here is an idea.
Since the drivers already abstract different implementations of the local hardware peripherals such as Gpio, I2C and SPI, I find very valuable having an in-memory driver that lying below the existing drivers.

The goals for this proposal:

  • ability to mock all the devices for testing purposes without having to use Moq or similar frameworks
  • ability to log the sequence of I/O writes
  • ability to create a framework to replay a sequence to simulate a complete I/O handshake without any connected device
  • ability to run the application on a host which doesn't have any device connected. For example, this is useful to test the other parts of the application on Windows and later run the real one on the embedded board.

While it is possible to create a similar abstraction in the application, it would be less invasive at System.Devices.Gpio level.

Furthermore it would be useful to add this driver as an additional layer so that it would be possible to log all the I/Os for later evaluation.

I would opt for a memory only driver in order to avoid any latency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design DiscussionOngoing discussion about design without consensusPriority:3Work that is nice to haveapi-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-System.Device.GpioContains types for using general-purpose I/O (GPIO) pinsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions