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.

Useful for: - FAPs (default features, without all-symbols) - Fw modules, services and built-in apps because there are building from source, so includes all symbols (use feature all-symbols)

State

Maintenance Status

Current state of the project is WiP. Highlly & dirty work-in-progress. Any contribution are appreciated, you know.

Supported (means "tested with") fw version: 0.68.1 but should work normally with any 0.68.x without prebuild feature.

Prerequisites

Add this as dependency to your cargo manifest file: [dependencies.flipper0] version = "0.1" default-features = false # disable prebuild

To build just add FLIPPER_REPO_PATH to your ENV anyhow (config, build-script, shell-rc, etc..), for example run: FLIPPER_REPO_PATH=~/path/to/flipperzero-firmware/ cargo build Or without SDK, that will be downloaded from the official repository: FLIPPER_REPO_BRANCH=release cargo build

Build Configuration

Environment variables:

| Feature | Required | Description | Use with feature | | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | | FLIPPER_REPO_PATH | required | Needed to build from source in local working copy of firmware repo, points to root of the repo. | use-local-sdk | | ARM_TOOLCHAIN | optional | If omitted build-script will search it in the working copy of the firmware repo. Typically should points to "arm-none-eabi" directory. | use-local-sdk, use-remote-sdk | | FLIPPER_REPO_REV | optional | Revision or tag. | use-remote-sdk | | FLIPPER_REPO_BRANCH | optional | Name of branch. | use-remote-sdk | | FLIPPER_REPO_CLONE_PATH | optional | Path points to directory where the SDK repository will be cloned. Default is OUT_DIR/flipperzero-firmware. | use-remote-sdk |

Features:

Build methods features:

| Feature | Deafault | Description | Used ENV vars | | ---------------- | -------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | prebuild | + | use pre-generated bindings | | | use-local-sdk | + | look at FLIPPER_REPO_PATH, build from source | FLIPPER_REPO_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) |

prebuild is default feature just for ability to build crate out-of-the-box.