-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt to gpio_cdev #42
Comments
Hello Ohmyarch, But I will try to add an example for it soon |
Thanks, I'm trying it. let line = chip.get_line(8).unwrap(); //CE0
let handle = line.request(LineRequestFlags::OUTPUT, 1, "test").unwrap();
let cs = CdevPin::new(handle).unwrap(); Error(Msg("linehandle request ioctl failed"), State { next_error: Some(Sys(EBUSY)), backtrace: InternalBacktrace { backtrace: None } }) lsgpio | rg CS0
line 8: unnamed "spi0 CS0" [kernel output active-low] It seems that we cannot get a linehandle of gpio8 because the kernel is using it for /dev/spidev0.0. |
A possible solution for you: Use a different pin for the cs pin. The problem at hand is that I am currently handling the CS for spi myself, since the spi trait isn't specifying how it will be handled. There is an ongoing discussion for improving this situation here: rust-embedded/embedded-hal#180 And a bigger quote from the specific current doc (https://docs.rs/embedded-hal/0.2.3/embedded_hal/spi/trait.FullDuplex.html) :
|
It works, thanks. |
Let's leave it open as a reminder for myself to look for a better solution |
Maybe add something like NoOutputPin? |
https://github.com/rust-embedded/gpio-cdev
Sysfs interface for GPIO is now deprecated: rust-embedded/rust-sysfs-gpio#38
I'm using kernel 5.11 and the old way does not work any more.
The text was updated successfully, but these errors were encountered: