Skip to content

Type erase SpiDma once created #381

@MabezDev

Description

@MabezDev

It is currently impossible to declare SpiDma as a type because of its use of private types.

pub type SpiType<'d> = SpiDma<'d, esp32c3_hal::peripherals::SPI2, esp32c3_hal::dma::private::ChannelTx<'d, gdma::private::Channel0TxImpl, gdma::private::Channel0>, esp32c3_hal::dma::private::ChannelRx<'d, gdma::private::Channel0RxImpl, gdma::private::Channel0>, gdma::private::SuitablePeripheral0>;

The easy option is to make these modules public and then seal the traits etc, but it would be better in general if we could completely erase this type information once we've satisfied the trait bounds. Any ideas on how to go about this @bjoernQ?

This is somewhat blocking async SPI as its impossible to pass the spi struct into a embassy task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions