hermes_five/hardware/mod.rs
1//! Defines pieces of hardware that can be remotely controlled through IO exchange messages.
2
3mod board;
4mod pca9685;
5
6use crate::io::{IoProtocol, IO};
7pub use board::Board;
8pub use board::BoardEvent;
9pub use pca9685::PCA9685;
10
11/// You most likely don't need this function (outside this crate).
12pub trait Hardware: IO {
13 /// Returns the protocol name.
14 fn get_protocol_name(&self) -> &str {
15 self.get_protocol().get_name()
16 }
17
18 /// Returns the protocol used.
19 fn get_protocol(&self) -> Box<dyn IoProtocol>;
20
21 /// Sets the protocol.
22 /// @todo remove this when hermes_studio finds a way around.
23 fn set_protocol(&mut self, protocol: Box<dyn IoProtocol>);
24}
25
26pub trait Expander: Hardware + IoProtocol {}