autd3_driver/firmware/driver/
option.rs

1use std::time::Duration;
2
3pub use super::parallel_mode::ParallelMode;
4
5/// The option used in Sender.
6#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub struct SenderOption {
8    /// The duration between sending operations.
9    pub send_interval: Duration,
10    /// The duration between receiving operations.
11    pub receive_interval: Duration,
12    /// Timeout for data transmission check for each frame. If `None`, [`Datagram::option`] is used.
13    ///
14    /// [`Datagram::option`]: autd3_core::datagram::Datagram::option
15    pub timeout: Option<Duration>,
16    /// The parallel processing mode.
17    pub parallel: ParallelMode,
18    /// If `true`, force firmware error checking.
19    pub strict: bool,
20}
21
22impl Default for SenderOption {
23    fn default() -> Self {
24        Self {
25            send_interval: Duration::from_millis(1),
26            receive_interval: Duration::from_millis(1),
27            timeout: None,
28            parallel: ParallelMode::Auto,
29            strict: true,
30        }
31    }
32}