Bindings for Flipper Zero

Automatically generated bindings (or "externs") for Flipper Zero Fw with some little hand-crafted wrappers and additions as upper abstraction layer.

This can be built with: - __without Flipper fw sources using default features 'prebuild__ - __with modified or alt fw using featuresuse-local-sdk__ - with enabled featureuse-remote-sdkofficial fw will be downloaded, then build as withuse-local-sdk` feature.

Compatibility

Minimal supported fw version is 0.69.0 but should work normally with any 0.69.x without prebuild feature.

Latest supported version can be determined by git tags starting with fw-.

Prerequisites

For build using pre-generated bindings (prebuild feature) just Rust toolchain is required, nightly channel.

For build using non-modified official fw just Rust toolchain and firmware sources are required.

For other cases see documentation and examples.

Hello-world

Just add dependency to your cargo manifest file: toml [dependencies] flipper0-sys = "*"

And follow instructions for examples.

```rust

![cratetype = "staticlib"] #![nomain] #![no_std]

extern crate flipper0sys; use flipper0sys::ffi::*;

[no_mangle]

pub unsafe extern "C" fn init(: *mut u8) -> i32 { static MESSAGE: &[u8] = b"Hello, World!"; furithreadstdoutwrite(MESSAGE.as_ptr() as _, MESSAGE.len()); 0 } ```

Features:

Bindings gen customization features:

Can be used with use-local-sdk or use-remote-sdk features.

All of these derive-features are used for bindgen configuration.

Build methods features:

By default prebuild is turned on. It uses pre-generated bindings, so fw not needed.

| Feature | Default | Description | Used ENV vars | | ---------------- | ------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | prebuild | + | use pre-generated bindings | | | use-local-sdk | + | look at FLIPPER_FW_SRC_PATH, build from source | FLIPPER_FW_SRC_PATH (required), ARM_TOOLCHAIN (optional) | | use-remote-sdk | - | clone remote git repo, initial setup with fbt, then build from source. | FLIPPER_REPO_REV, FLIPPER_REPO_BRANCH, FLIPPER_REPO_CLONE_PATH, ARM_TOOLCHAIN (all vars optional) |