oxigdal_embedded/lib.rs
1//! # OxiGDAL Embedded
2//!
3//! Embedded systems support for OxiGDAL providing no_std compatible geospatial processing
4//! for ARM, RISC-V, ESP32, and other embedded targets.
5//!
6//! ## Features
7//!
8//! - `no_std` compatibility with optional `alloc` support
9//! - Static memory pools for predictable allocation behavior
10//! - Target-specific optimizations (ARM, RISC-V, ESP32)
11//! - Low-power operation modes
12//! - Real-time constraints support
13//! - Minimal binary footprint
14//!
15//! ## Usage
16//!
17//! ```rust
18//! use oxigdal_embedded::memory_pool::StaticPool;
19//! use oxigdal_embedded::minimal::MinimalRasterMeta;
20//!
21//! // Create a static memory pool for no_std environments
22//! static POOL: StaticPool<4096> = StaticPool::new();
23//!
24//! // Use minimal raster metadata for constrained resources
25//! let meta = MinimalRasterMeta::new(256, 256, 3, 1);
26//! assert_eq!(meta.total_size(), 256 * 256 * 3);
27//! ```
28//!
29//! ## Architecture
30//!
31//! The crate is organized into:
32//! - `alloc/` - Custom allocators for no_std environments
33//! - `memory_pool` - Static memory pool implementations
34//! - `target/` - Target-specific optimizations
35//! - `power` - Power management utilities
36//! - `realtime` - Real-time scheduling support
37//! - `minimal` - Minimal feature set for ultra-constrained environments
38
39#![cfg_attr(not(feature = "std"), no_std)]
40#![warn(missing_docs)]
41#![warn(rustdoc::missing_crate_level_docs)]
42// Allow unsafe code - embedded systems require unsafe for memory pools, allocators,
43// and target-specific operations (GlobalAlloc, assembly, atomic operations)
44#![allow(unsafe_code)]
45
46#[cfg(feature = "alloc")]
47extern crate alloc;
48
49pub mod error;
50
51#[cfg(feature = "alloc")]
52pub mod alloc_utils;
53
54pub mod memory_pool;
55pub mod target;
56
57#[cfg(feature = "low-power")]
58pub mod power;
59
60#[cfg(feature = "realtime")]
61pub mod realtime;
62
63pub mod buffer;
64pub mod config;
65pub mod minimal;
66pub mod sync;
67
68/// Prelude module containing commonly used types and traits
69pub mod prelude {
70 pub use crate::buffer::FixedBuffer;
71 pub use crate::error::{EmbeddedError, Result};
72 pub use crate::memory_pool::{MemoryPool, StaticPool};
73 pub use crate::minimal::{MinimalBounds, MinimalCoordinate};
74 pub use crate::sync::AtomicCounter;
75
76 #[cfg(feature = "alloc")]
77 pub use crate::alloc_utils::BumpAllocator;
78
79 #[cfg(feature = "realtime")]
80 pub use crate::realtime::RealtimeScheduler;
81
82 #[cfg(feature = "low-power")]
83 pub use crate::power::PowerMode;
84}
85
86#[cfg(test)]
87mod unit_tests {
88
89 #[test]
90 fn test_basic_functionality() {
91 // Basic sanity check that the crate compiles
92 use crate::prelude::*;
93 let _pool = StaticPool::<1024>::new();
94 }
95}