1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! # stepper-motion
//!
//! Configuration-driven stepper motor motion control with embedded-hal 1.0 support.
//!
//! ## Features
//!
//! - **Configuration-driven**: Define motors and trajectories in TOML files
//! - **embedded-hal 1.0**: Uses `OutputPin` for STEP/DIR, `DelayNs` for timing
//! - **no_std compatible**: Core library works without standard library
//! - **Asymmetric profiles**: Independent acceleration and deceleration rates
//! - **Position tracking**: Absolute position tracked at all times
//! - **Type-state safety**: Compile-time motor state verification
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use stepper_motion::{StepperMotor, SystemConfig};
//!
//! // Load configuration from TOML
//! let config: SystemConfig = stepper_motion::load_config("motion.toml")?;
//!
//! // Create motor with embedded-hal pins
//! let mut motor = StepperMotor::builder()
//! .from_config(&config, "x_axis")?
//! .step_pin(step_pin)
//! .dir_pin(dir_pin)
//! .delay(delay)
//! .build()?;
//!
//! // Execute named trajectory
//! motor.execute("home")?;
//! ```
//!
//! ## Feature Flags
//!
//! - `std` (default): Enables file I/O and TOML parsing
//! - `alloc`: Enables heap allocation for no_std with allocator
//! - `defmt`: Enables defmt logging for embedded targets
// Allow large error types - necessary for no_std with heapless strings
extern crate alloc;
// Core modules
// Re-exports for ergonomic API
pub use ;
pub use ;
pub use ;
pub use ;
pub use TrajectoryRegistry;
// Configuration loading (std only)
pub use load_config;
// Unit types
pub use ;