rsiot/components/cmp_linux_spi_master/
config.rs

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
use crate::{
    components_config::{master_device::DeviceTrait, spi_master},
    message::MsgDataBound,
};

/// Конфигурация cmp_linux_spi_master
pub struct Config<TMsg>
where
    TMsg: MsgDataBound,
{
    /// Пути к устройствам SPI.
    ///
    /// Пример:
    ///
    /// ```rust
    /// spi_path: vec!["/dev/spidev0.0", "/dev/spidev0.1"]
    /// ```
    pub spi_adapter_path: Vec<&'static str>,

    /// Частота тактов в Гц
    pub baudrate: u32,

    /// Драйвера устройств
    pub devices: Vec<
        Box<dyn DeviceTrait<TMsg, spi_master::FieldbusRequest, spi_master::FieldbusResponse, u8>>,
    >,
}