Crates.io | hitde-sys |
lib.rs | hitde-sys |
version | 0.1.9 |
source | src |
created_at | 2019-11-09 07:22:00.114446 |
updated_at | 2020-08-26 09:59:51.521007 |
description | Hi35XX TDE API for Rust unsafe bindings. |
homepage | https://github.com/varphone/hitde-sys |
repository | |
max_upload_size | |
id | 179660 |
size | 20,157 |
Hi35XX TDE API for Rust unsafe bindings.
PATH
:
arm-himix100-linux
.hi3516ev200
.hi3516ev200
.hi3516ev200
.arm-himix200-linux
.arm-hisiv100nptl-linux
.aarch64-himix100-linux
.armv7-unknown-linux-musleabihf
.hi3516ev200
.hi3516ev200
.hi3516ev200
.aarch64-unknown-linux-gnu
.arm-unknown-linux-musleabi
.aarch64-unknown-linux-gnu
.MPP_DIR
to directory that contains the mpp-lib
.SYS_INCLUDE
to the directory that contains the system headers.SYS_LIBDIR
to the directory that contains the system libraries.The toolchain and the mpp-lib you can get from the BSP sdk.
The Hi3616EV300、Hi3616EV200、Hi3618EV300 use the same SDK.
export PATH=/opt/hisi-linux/x86-arm/arm-himix100-linux/bin:$PATH
export MPP_DIR=vendor/mpp-lib-Hi3516EV200_V1.0.1.0
export SYS_INCLUDE=/opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/include
export PATH=/opt/hisi-linux/x86-arm/arm-himix200-linux/bin:$PATH
export MPP_DIR=vendor/mpp-lib-Hi3519AV100_V2.0.2.0
export SYS_INCLUDE=/opt/hisi-linux/x86-arm/arm-himix200-linux/target/usr/include
export PATH=/opt/hisi-linux-nptl/arm-hisiv100-linux/target/bin:$PATH
export MPP_DIR=vendor/mpp-lib-Hi3531V100_V1.0.D.0
export SYS_INCLUDE=/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/include
export PATH=/opt/hisi-linux/x86-arm/aarch64-himix100-linux/bin:$PATH
export MPP_DIR=vendor/mpp-lib-Hi3559AV100_V2.0.2.0
export SYS_INCLUDE=/opt/hisi-linux/x86-arm/aarch64-himix100-linux/aarch64-linux-gnu/sys-include
To build the package, you must set cross compile environments first.
There is some preset in .cargo/
can help you fasten setup the cross compile.
Example:
# Setup for Hi3559AV100 boards
cp .cargo/hi3559av100.toml .cargo/config
# or for link static libraries
cp .cargo/hi3559av100-static.toml .cargo/config
# Build the package ...
cargo b
Make sure the
hi3559av100
feature is enabled in the Cargo.toml, Thehi3559av100
specified the target board, you can change to others, like:hi3531v100
use hitde_sys::{HI_SUCCESS, HI_TDE2_Open, HI_TDE2_Close};
fn main() {
unsafe {
let err = HI_TDE2_Open();
assert_eq!(err, HI_SUCCESS as HI_S32);
// Add your code here
HI_TDE2_Close();
}
}