Skip to content

v2_compat does not provide shims for ToggleableOutputPin #137

@little-arhat

Description

@little-arhat
error[E0599]: no method named `toggle` found for type `alt_stm32f30x_hal::gpio::PA1<alt_stm32f30x_hal::gpio::PullDown, alt_stm32f30x_hal::gpio::Output<alt_stm32f30x_hal::gpio::PushPull, alt_stm32f30x_hal::gpio::HighSpeed>>` in the current scope
  --> pin_sensors/main.rs:54:21
   |
54 |         let _ = pa1.toggle();
   |                     ^^^^^^
   |
   = note: the method `toggle` exists but the following trait bounds were not satisfied:
           `alt_stm32f30x_hal::gpio::PA1<alt_stm32f30x_hal::gpio::PullDown, alt_stm32f30x_hal::gpio::Output<alt_stm32f30x_hal::gpio::PushPull, alt_stm32f30x_hal::gpio::HighSpeed>> : embedded_hal::digital::v2::ToggleableOutputPin`
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
   |
6  | use embedded_hal::digital::v1::ToggleableOutputPin;

Can be solved in hal implementation by providing v2::toggleable implementation:

impl<PT: PullType, OT:OutputType, OS:OutputSpeed> v2::toggleable::Default
    for $PXi<PT, Output<OT, OS>> {}

But would be nice to have it provided by this crate.

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