rsiot/components_config/uart_general/
parity.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! Добавлять бит четности

/// Добавлять бит четности
#[allow(missing_docs)]
#[derive(Clone, Debug, Default)]
pub enum Parity {
    #[default]
    None,
    Even,
    Odd,
}

#[cfg(feature = "cmp_esp")]
impl From<Parity> for esp_idf_svc::hal::uart::config::Parity {
    fn from(value: Parity) -> Self {
        match value {
            Parity::None => Self::ParityNone,
            Parity::Even => Self::ParityEven,
            Parity::Odd => Self::ParityOdd,
        }
    }
}