Expand description
no_std embedded-hal input helper for RX480-E-WQ / RX480E-4
decoded output pins.
This crate reads the module’s active-high D0-D3 decoded channel outputs
and VT valid-transmission output through embedded_hal::digital::InputPin.
Pin conventions:
D0-D3are active-high decoded channel outputs.VTis active-high and indicates a valid transmission.- Bits are laid out as
D0=0b0000_0001,D1=0b0000_0010,D2=0b0000_0100,D3=0b0000_1000,VT=0b0001_0000. - Sampling is sequential (
D0,D1,D2,D3,VT), not atomic. poll_changecompares against an initial all-low baseline, so a pin that is already high on the first call is reported as a rising edge.
It reports structured Snapshot and Event values that application
firmware can turn into logs, relay actions, MQTT messages, or other behavior.
It does not decode raw RF, pair remotes, clear learned codes, inspect the RX480 module’s internal learned-code memory, transmit RF, or measure pulse durations.
use rx480e_wq_driver::{ChannelState, Rx480eWq};
let mut rx = Rx480eWq::new(d0, d1, d2, d3, vt);
if let Some(event) = rx.poll_change()? {
if event.vt_rising() {
// A valid RF frame was accepted by the RX480 module.
}
match event.current.channel_state() {
ChannelState::Single(channel) => {
// One of D0-D3 is active. `VT` is handled separately.
let _name = channel.name();
}
ChannelState::None if event.current.vt_only() => {
// VT is active, but no D0-D3 output is active.
}
ChannelState::None => {}
ChannelState::Multiple(mask) => {
// Multiple D0-D3 outputs are active.
let _mask = mask;
}
}
}Structs§
Enums§
- Channel
- One decoded channel output (
D0-D3). - Channel
State - Decoded
D0-D3channel state. - Edge
- Rising/falling transition on a sampled signal.
- Signal
- One sampled signal (
D0-D3orVT).
Constants§
- D0_BIT
- Bit for the active-high
D0channel output. - D1_BIT
- Bit for the active-high
D1channel output. - D2_BIT
- Bit for the active-high
D2channel output. - D3_BIT
- Bit for the active-high
D3channel output. - VT_BIT
- Bit for the active-high
VTvalid-transmission output.
Functions§
- channel_
state_ from_ bits Deprecated - channel_
state_ from_ channel_ bits - Classify only the
D0-D3channel bits.