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