| Crates.io | peak-can-sys |
| lib.rs | peak-can-sys |
| version | 0.2.0 |
| created_at | 2025-03-24 08:19:12.498859+00 |
| updated_at | 2025-12-19 02:05:29.246848+00 |
| description | FFI bindings for the API by PEAK-System Technik GmbH |
| homepage | |
| repository | https://github.com/TuEmb/peak-can-sys |
| max_upload_size | |
| id | 1603552 |
| size | 83,122 |
peak-can-sys provides Rust FFI bindings to the PEAK-System PCAN-Basic API, enabling interaction with PEAK CAN interfaces in Rust applications.
To use peak-can-sys, ensure that you have the PCAN-Basic library installed on your system.
PCANBasic.dll is available in your system path.libpcanbasic.so from PEAK-System's official drivers.Add peak-can-sys to your Cargo.toml:
[dependencies]
peak-can-sys = "0.1"
Include it in your Rust code:
use peak_can_sys::*;
bindgen src/binding/PCANBasic.h \
-o src/bindings.rs \
--no-layout-tests \
--dynamic-loading Pcan \
--allowlist-function "^CAN_.*" \
--allowlist-type "^TPCAN.*" \
--allowlist-var "^PCAN_.*" \
--allowlist-var "^LOG_.*" \
--allowlist-var "^TRACE_.*" \
--allowlist-var "^FEATURE_.*" \
--allowlist-var "^SERVICE_.*" \
--allowlist-var "^MAX_LENGTH_.*" \
--allowlist-var "^LOOKUP_.*"
The following additional flags must be provided if generating on Linux
-- --target=x86_64-pc-windows-gnu -I/usr/x86_64-w64-mingw32/include
Finally, run the following command to rename identifiers to be license compliant.
sed -i 's/PCAN/PEAK/g' src/bindings.rs
This project is not affiliated with PEAK-System. The PCAN-Basic API is owned and maintained by PEAK-System.
For support related to this Rust binding, please contact the maintainer of this repository, not PEAK-System.