Skip to content

Assigning non aligned pins #4

@tobozo

Description

@tobozo

Hi and thanks for this great project!

It works out of the box on a Waveshare RP2040-LCD-0.96.
That device has an onboard display connected to pins [8..12] though, and I'm worried that the readings on those pins may be incorrect.

I have tried to modify the source to assign a different set of pins but I'm only discovering rust and obviously didn't get the expected results.

        pins.gpio0.into_mode::<FunctionPio0>();
        pins.gpio1.into_mode::<FunctionPio0>();
        pins.gpio2.into_mode::<FunctionPio0>();
        pins.gpio3.into_mode::<FunctionPio0>();
        pins.gpio4.into_mode::<FunctionPio0>();
        pins.gpio5.into_mode::<FunctionPio0>();
        pins.gpio6.into_mode::<FunctionPio0>();
        pins.gpio7.into_mode::<FunctionPio0>();
        // pins.gpio8.into_mode::<FunctionPio0>();  // TFT DC
        // pins.gpio9.into_mode::<FunctionPio0>();  // TFT CS
        // pins.gpio10.into_mode::<FunctionPio0>(); // TFT SCLK
        // pins.gpio11.into_mode::<FunctionPio0>(); // TFT MOSI
        // pins.gpio12.into_mode::<FunctionPio0>(); // TFT RST
        pins.gpio13.into_mode::<FunctionPio0>();
        pins.gpio14.into_mode::<FunctionPio0>();
        pins.gpio15.into_mode::<FunctionPio0>();
        // added this
        pins.gpio16.into_mode::<FunctionPio0>();
        pins.gpio17.into_mode::<FunctionPio0>();
        pins.gpio18.into_mode::<FunctionPio0>();
        pins.gpio19.into_mode::<FunctionPio0>();
        pins.gpio20.into_mode::<FunctionPio0>();

I understand this breaks the pins alignment and may affect any logic using the pins array index as an offset information, but I haven't spotted where this could happen (triggers.rs?), and I'm not even sure core logic would allow it.

Is that idea even realistic?

Sorry about the dumb questions, feel free to close if this is out of scope for this project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions