-
I need to pass a |
Beta Was this translation helpful? Give feedback.
Answered by
MabezDev
Aug 29, 2024
Replies: 1 comment 1 reply
-
If you pass the pin as let mut pin = io.gpio0;
{
let output0 = Output::new(&mut pin, Level::Low);
// use in driver 0
// output0 dropped here
}
let output1 = Output::new(&mut pin, Level::Low); // could also pass by value here if its not needed again
// use output1 in driver 1 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
yanshay
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you pass the pin as
&mut gpio0
intoOuput
, when you drop thatOutput
you will be able to usegpio0
again in the new driver.