Rust version of the PiControl driver for the Revolution Pi
Use bindgen binary directly:
bash
TARGET=armv7-unknown-linux-gnueabihf bindgen -o src/picontrol.rs kunbus/interface/piControl/wrapper.h -- -I`pwd`/kunbus/interface/piControl
Use bindgen with a build.rs file
See: https://github.com/rust-embedded/cross
See: https://medium.com/@wizofe/cross-compiling-rust-for-arm-e-g-raspberry-pi-using-any-os-11711ebfc52b
```bash source $HOME/.cargo/env
sudo apt-get install -qq gcc-arm-linux-gnueabihf rustup target add armv7-unknown-linux-gnueabihf ```
Configure Cargo for cross-compilation
```bash mkdir -p ~/.cargo
cat >> ~/.cargo/config << EOF [target.armv7-unknown-linux-gnueabihf] linker = "arm-linux-gnueabihf-gcc" EOF
sudo apt-get install g++-multilib libc6-dev-i386 sudo apt-get install -qq gcc-arm-linux-gnueabihf ```
You can now compile:
bash
cargo build --target=armv7-unknown-linux-gnueabihf