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
use thiserror::Error;
#[derive(Error, Debug)]
pub enum DriverError {
#[error(
"{} transducer{} connected, but you try to use {}", a, if *a == 1 {" is"} else {"s are"}, b)]
NumberOfTransducerMismatch { a: usize, b: usize },
#[error(
"Maximum size is {}, but {0} data are to be send",
crate::MOD_BUF_SIZE_MAX
)]
ModulationSizeOutOfRange(usize),
#[error(
"Minimum modulation frequency division is {}, but {0} is used",
crate::MOD_SAMPLING_FREQ_DIV_MIN
)]
ModFreqDivOutOfRange(u32),
#[error(
"Minimum silencer cycle is {}, but {0} is used",
crate::SILENCER_CYCLE_MIN
)]
SilencerCycleOutOfRange(u16),
#[error("STM index is out of range")]
STMStartIndexOutOfRange,
#[error("STM finish is out of range")]
STMFinishIndexOutOfRange,
#[error("Maximum size is {}, but {0} is used", crate::FOCUS_STM_BUF_SIZE_MAX)]
FocusSTMPointSizeOutOfRange(usize),
#[error(
"FocusSTM frequency division is {}, but {0} is used",
crate::FOCUS_STM_SAMPLING_FREQ_DIV_MIN
)]
FocusSTMFreqDivOutOfRange(u32),
#[error(
"Maximum size is {}, but {0} is used",
crate::GAIN_STM_LEGACY_BUF_SIZE_MAX
)]
GainSTMLegacySizeOutOfRange(usize),
#[error("Maximum size is {}, but {0} is used", crate::GAIN_STM_BUF_SIZE_MAX)]
GainSTMSizeOutOfRange(usize),
#[error(
"GainSTM frequency division is {}, but {0} is used",
crate::GAIN_STM_LEGACY_SAMPLING_FREQ_DIV_MIN
)]
GainSTMLegacyFreqDivOutOfRange(u32),
#[error(
"GainSTM frequency division is {}, but {0} is used",
crate::GAIN_STM_SAMPLING_FREQ_DIV_MIN
)]
GainSTMFreqDivOutOfRange(u32),
#[error("PhaseHalf is not supported in Normal mode")]
PhaseHalfNotSupported,
}