autd3_driver/firmware/transmission/
option.rs

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