rsiot/components_config/uart_general/
stop_bits.rs1#[allow(missing_docs)]
5#[derive(Clone, Debug, Default)]
6pub enum StopBits {
7 #[default]
8 _1,
9 _1p5,
10 _2,
11}
12
13impl From<StopBits> for f64 {
14 fn from(value: StopBits) -> Self {
15 match value {
16 StopBits::_1 => 1.0,
17 StopBits::_1p5 => 1.5,
18 StopBits::_2 => 2.0,
19 }
20 }
21}
22
23#[cfg(feature = "cmp_esp")]
24impl From<StopBits> for esp_idf_svc::hal::uart::config::StopBits {
25 fn from(value: StopBits) -> Self {
26 match value {
27 StopBits::_1 => Self::STOP1,
28 StopBits::_1p5 => Self::STOP1P5,
29 StopBits::_2 => Self::STOP2,
30 }
31 }
32}