ethercat_controller/lib.rs
1pub mod config;
2pub use config::Config;
3
4pub mod ethercat_controller;
5pub use ethercat_controller::EtherCatController;
6
7use ethercat::{Offset, PdoEntryIdx, SlavePos};
8use std::collections::HashMap;
9
10/// Type alias for the PDO offsets
11///
12/// The PDO offsets are stored in a hashmap with the name of the PDO as the key
13/// and a vector of tuples with the index of the PDO entry, the subindex of the PDO entry and the offset
14/// as the value
15pub type PdoOffsets = HashMap<String, Vec<(PdoEntryIdx, u8, Offset)>>;
16/// Type alias for the slave offsets
17///
18/// The slave offsets are stored in a hashmap with the slave position as the key
19/// and the PDO offsets as the value
20pub type SlaveOffsets = HashMap<SlavePos, PdoOffsets>;
21/// Type alias for the slave names
22pub type SlaveNames = HashMap<String, SlavePos>;
23/// Type alias for the slave setup
24///
25/// The slave setup is stored in a hashmap with the slave position as the key
26pub type SlaveSetup = HashMap<SlavePos, bool>;
27/// Type alias for the mailbox PDO entries
28///
29/// The mailbox PDO entries are stored in a hashmap with the slave position as the key
30/// and a vector of strings as the value
31pub type MailboxPdoEntries = HashMap<SlavePos, Vec<String>>;
32
33pub mod mailboxes;
34pub mod watchdog;
35
36pub mod ethercat_patch;