Skip to content

Abstract device under test peripherals #12

Description

@tdittr

Currently we list out all possible peripherals in a struct. This is not very ergonomic especially when peripherals might not be implemented or parts need to be reused. We should just have a trait to abstract the device under test.

For example:

pub enum Pin {
    D0,
    D1,
    D14,
}

pub trait DeviceUnderTest {
    fn get_output(&mut self, pin: Pin) -> Result<impl OutputPin, ()>;
    fn get_i2c(&mut self) -> Result<impl I2c, ()>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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