flipperzero/
lib.rs

1//! High-level bindings for the Flipper Zero.
2//!
3//! # Features
4#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
5//!
6
7#![no_std]
8#![cfg_attr(all(test, not(miri)), no_main)]
9#![cfg_attr(all(test, miri), feature(start))]
10#![cfg_attr(docsrs, feature(doc_cfg))]
11#![deny(rustdoc::broken_intra_doc_links)]
12
13#[cfg(any(feature = "alloc", docsrs))]
14#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
15extern crate alloc;
16
17pub mod bluetooth;
18pub mod datetime;
19pub mod dialogs;
20pub mod dolphin;
21pub mod furi;
22pub mod gpio;
23pub mod gui;
24pub mod io;
25pub mod locale;
26pub mod macros;
27pub mod notification;
28pub mod path;
29pub mod prelude;
30pub mod serial;
31pub mod storage;
32pub mod toolbox;
33pub mod version;
34
35#[doc(hidden)]
36pub mod __macro_support {
37    use crate::furi::log::Level;
38
39    // Re-export for use in macros
40    pub use ufmt;
41
42    pub use crate::furi::string::FuriString;
43
44    /// ⚠️ WARNING: This is *not* a stable API! ⚠️
45    ///
46    /// This module, and all code contained in the `__macro_support` module, is a
47    /// *private* API of `flipperzero`. It is exposed publicly because it is used by the
48    /// `flipperzero` macros, but it is not part of the stable versioned API. Breaking
49    /// changes to this module may occur in small-numbered versions without warning.
50    pub use flipperzero_sys as __sys;
51
52    /// ⚠️ WARNING: This is *not* a stable API! ⚠️
53    ///
54    /// This function, and all code contained in the `__macro_support` module, is a
55    /// *private* API of `flipperzero`. It is exposed publicly because it is used by the
56    /// `flipperzero` macros, but it is not part of the stable versioned API. Breaking
57    /// changes to this module may occur in small-numbered versions without warning.
58    pub fn __level_to_furi(level: Level) -> __sys::FuriLogLevel {
59        level.to_furi()
60    }
61}
62
63flipperzero_test::tests_runner!(
64    name = "flipperzero-rs Unit Tests",
65    stack_size = 4096,
66    [
67        crate::furi::log::metadata::tests,
68        crate::furi::message_queue::tests,
69        crate::furi::rng::tests,
70        crate::furi::string::tests,
71        crate::furi::sync::tests,
72        crate::furi::time::tests,
73        crate::gpio::i2c::tests,
74        crate::toolbox::crc32::tests,
75        // crate::toolbox::md5::tests,
76        // crate::toolbox::sha256::tests,
77    ]
78);