Skip to content

embedded-hal-bus devices cannot be destroyed/freed #735

@phansel

Description

@phansel

In certain applications, a user may want to create an SPI bus, do some operation with the SPI, then destroy it to free the pins and peripheral.

For example, they may be working with an ADC where the parallel interface shares a clock pin with the SPI interface. To later re-use the clock pin to synchronously extract data from the parallel interface, they need to actually recover ownership of the clock pin.

I'm thinking something like rp2040-hal's Spi free():

pub fn free(self) -> (D, P)
Releases the underlying device and pins.

Is this plausible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions