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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! # Function Blocks
//!
//! Reusable function blocks for control program development, inspired by the
//! IEC 61131-3 standard. Each block is a stateful struct that you call
//! cyclically (once per scan) from your [`ControlProgram::process_tick`](crate::ControlProgram::process_tick)
//! implementation.
//!
//! ## Available Blocks
//!
//! | Block | Description |
//! |-------|-------------|
//! | [`RTrig`](crate::fb::RTrig) | Rising edge detector (false → true) |
//! | [`FTrig`](crate::fb::FTrig) | Falling edge detector (true → false) |
//! | [`Ton`](crate::fb::Ton) | Timer On Delay — output activates after a duration |
//! | [`SimpleTimer`](crate::fb::SimpleTimer) | One-shot timer for imperative start/check patterns |
//! | [`StateMachine`](crate::fb::StateMachine) | State machine helper with automatic timer management |
//! | [`BitResetOnDelay`](crate::fb::BitResetOnDelay) | Resets a boolean after it has been true for a duration |
//! | [`RunningAverage`](crate::fb::RunningAverage) | Accumulates values and computes their arithmetic mean |
//! | [`Beeper`](crate::fb::Beeper) | Audible beeper controller with configurable beep sequences |
//! | [`Heartbeat`](crate::fb::Heartbeat) | Monitors a remote heartbeat counter for connection loss |
//! | [`Shutdown`](crate::fb::Shutdown) | Non-blocking system shutdown initiation and cancellation via IPC |
//! | [`ni::DaqCapture`](crate::fb::ni::DaqCapture) | NI DAQ triggered capture: arm, wait, read data via IPC |
//!
//! ## Usage Pattern
//!
//! All function blocks follow the same pattern:
//!
//! 1. **Create** the block once (typically in your program struct)
//! 2. **Call** it every scan cycle with the current inputs
//! 3. **Read** its outputs to drive your logic
//!
//! ```ignore
//! use autocore_std::fb::{RTrig, Ton};
//! use std::time::Duration;
//!
//! struct MyProgram {
//! start_trigger: RTrig,
//! start_delay: Ton,
//! }
//!
//! impl MyProgram {
//! fn new() -> Self {
//! Self {
//! start_trigger: RTrig::new(),
//! start_delay: Ton::new(),
//! }
//! }
//! }
//! ```
//!
//! ## IEC 61131-3 Naming
//!
//! | IEC 61131-3 Name | Rust Name |
//! |------------------|-----------|
//! | `R_TRIG` | [`RTrig`](crate::fb::RTrig) |
//! | `F_TRIG` | [`FTrig`](crate::fb::FTrig) |
//! | `TON` | [`Ton`](crate::fb::Ton) |
//! | `FB_StateMachine` | [`StateMachine`](crate::fb::StateMachine) |
//! | `FB_BitResetOnDelay` | [`BitResetOnDelay`](crate::fb::BitResetOnDelay) |
//! | `FB_RunningAverage` | [`RunningAverage`](crate::fb::RunningAverage) |
//! | `FB_Beeper` | [`Beeper`](crate::fb::Beeper) |
//! | `FB_Heartbeat` | [`Heartbeat`](crate::fb::Heartbeat) |
//! | `FB_Shutdown` | [`Shutdown`](crate::fb::Shutdown) |
pub use RTrig;
pub use FTrig;
pub use Ton;
pub use SimpleTimer;
pub use StateMachine;
pub use BitResetOnDelay;
pub use ;
pub use Beeper;
pub use Heartbeat;
pub use Shutdown;