inre / cupi Goto Github PK
View Code? Open in Web Editor NEWCuprum Pi is a GPIO access library for the Raspberry Pi
License: MIT License
Cuprum Pi is a GPIO access library for the Raspberry Pi
License: MIT License
Is there any documentation?
I've read the examples, there are parts I don't fully understand.
For instance, is this comment supposed to enlighten the reader about some functionality or has it been put here for debug purpose (I don't know what export
does)?
let cupi = CuPi::new().unwrap();
let mut pinout = cupi.pin(0).unwrap().high().output();
//let mut pin = cupi.pin_sys(0).unwrap();
//pin.export().unwrap();
//let mut pinout = pin.output().unwrap();
Just wanted to leave a note to let you know that I published https://crates.io/crates/cupi_shift last night which uses your excellent lib. Thanks to you I'll now have a Rust-powered holiday lights display =)
Hello,
I just noticed that the // old way
code at the bottom of cupi/src/board.rs
is wrong.
I'm not a Rust programmer, but it seems to be treating revisions "0005" and "0009" the same (RaspberryModel::B
) but if you look at http://elinux.org/RPi_HardwareHistory you can see that "0005" is indeed a Model B, but "0009" is actually a Model A! And you make a similar mistake with "0007" (again, Model A and not Model B)
And less importantly, "000f" (made by Qisda and not Egoman) and "0014" (made by Embest and not Sony).
Raspberry Pi comes with BCM2835, but CuPi lists BCM2708 and BCM2709.
The enumeration in board.rs
should be expanded to include BCM2835.
I'm trying to compile the blink
example project on my Raspberry Pi Zero W, but the build command fails as it tries to compile cupi
. I'm getting this terminal output:
$ cargo build --verbose
Fresh byteorder v1.2.1
Fresh libc v0.2.39
Fresh winapi-build v0.1.1
Fresh cfg-if v0.1.2
Fresh bitflags v0.3.3
Fresh bitflags v0.4.0
Fresh winapi v0.2.8
Fresh libc v0.1.12
Fresh semver v0.1.20
Fresh void v1.0.2
Fresh bitflags v1.0.1
Fresh iovec v0.1.2
Fresh rand v0.4.2
Fresh rustc_version v0.1.7
Fresh bytes v0.4.6
Fresh nix v0.10.0
Fresh kernel32-sys v0.2.2
Fresh remove_dir_all v0.3.0
Fresh nix v0.6.0
Fresh tempdir v0.3.6
Fresh spidev v0.3.0
Fresh mmap v0.1.1
Compiling cupi v0.1.0
Running `rustc --crate-name cupi /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/cupi-0.1.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=409ed042e1991471 -C extra-filename=-409ed042e1991471 --out-dir /home/pi/cupi-test/target/debug/deps -L dependency=/home/pi/cupi-test/target/debug/deps --extern spidev=/home/pi/cupi-test/target/debug/deps/libspidev-a197c99928c90dc7.rlib --extern bitflags=/home/pi/cupi-test/target/debug/deps/libbitflags-b4df5465fcb6918f.rlib --extern libc=/home/pi/cupi-test/target/debug/deps/liblibc-d67d33f8bf527dba.rlib --extern mmap=/home/pi/cupi-test/target/debug/deps/libmmap-492832427199866f.rlib --extern nix=/home/pi/cupi-test/target/debug/deps/libnix-f1ec6b05c8d84a61.rlib --cap-lints allow`
error[E0432]: unresolved import `nix::sys::ioctl::libc`
--> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/cupi-0.1.0/src/lib.rs:62:22
|
62 | use nix::sys::ioctl::libc::geteuid;
| ^^^^ Could not find `libc` in `ioctl`
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0432"
error: Could not compile `cupi`.
I'm still very much a Rust noob, so does this mean I'm having problems with dependency versions within nix
, libc
, and ioctl
? Should I try to pin one of these versions in my lockfile, or is there something else I should try?
Thanks!
Are you planning on supporting it?
I can't find anywhere in the docs how to change the mode of a pin, which I need for toggling between UART and other modes on Raspberry Pi 3B+.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.