Hi,
I am new to Rust, probably count as new to embedded but really really old. That out of the way.
I have started on my journey of banning myself from C and C++ so wanted to use rust instead. I have done some rust and understand a few of the concepts but struggling to get going.
I wanted to start with just writing to a TFT as this is relatively easy on my ST32 environment. It's an SPI device but the interface I am using expects a embedded_hal::digital::v2::OutputPin which is from the embedded_hal but I am using the esp32c3-hal which only has hal::prelude::_embedded_hal_digital_v2_OutputPin
When I use this the build fails with
let cs = io.pins.gpio4.into_push_pull_output();
error[E0382]: use of moved value: `cs`
--> gc9a01-test/src/main.rs:71:55
|
58 | let cs = io.pins.gpio4.into_push_pull_output();
| -- move occurs because `cs` has type `GpioPin<Output<esp32c3_hal::gpio::PushPull>, 4>`, which does not implement the `Copy` trait
I could
- move to the other hal
- move to std
but I want to understand what people do as I would prefer to understand and fix the problem rather than avoid it.
Thanks all,
Promise to help when up to speed.