pub enum PartState {
Led {
lit: bool,
},
Button {
pressed: bool,
},
Switch {
on: bool,
},
Segments {
mask: u8,
},
Tone {
sounding: bool,
hz: u32,
},
Servo {
degrees: u16,
},
Knob {
permille: u16,
},
Radio {
tx_count: u32,
rx_count: u32,
last_bytes: [u8; 32],
last_len: u8,
},
None,
}Expand description
The externally observable state of a part.
Variants§
Led
Button
Switch
A two-position switch and which way it is thrown.
Segments
A seven-segment display: one bit per segment, a..g then dp, least
significant bit first.
Tone
A buzzer or speaker: whether it is being driven, and the rate measured from the edges its pins actually saw.
Servo
A servo: the angle the incoming pulse train asks for.
Knob
A continuous control such as a potentiometer, in permille of its travel.
Radio
A packet radio: frames it has sent and received, and the first
RADIO_LAST_BYTES bytes of the most recent payload (transmitted or
received). last_len says how much of last_bytes is meaningful.
None
Trait Implementations§
impl Copy for PartState
impl Eq for PartState
impl StructuralPartialEq for PartState
Auto Trait Implementations§
impl Forget for PartState
impl Freeze for PartState
impl Move for PartState
impl RefUnwindSafe for PartState
impl Send for PartState
impl Sync for PartState
impl Unpin for PartState
impl UnsafeUnpin for PartState
impl UnwindSafe for PartState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more