Skip to main content

Crate rx480e_wq_driver

Crate rx480e_wq_driver 

Source
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-D3 are active-high decoded channel outputs.
  • VT is 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_change compares 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§

Event
Rx480eWq
Snapshot

Enums§

Channel
One decoded channel output (D0-D3).
ChannelState
Decoded D0-D3 channel state.
Edge
Rising/falling transition on a sampled signal.
Signal
One sampled signal (D0-D3 or VT).

Constants§

D0_BIT
Bit for the active-high D0 channel output.
D1_BIT
Bit for the active-high D1 channel output.
D2_BIT
Bit for the active-high D2 channel output.
D3_BIT
Bit for the active-high D3 channel output.
VT_BIT
Bit for the active-high VT valid-transmission output.

Functions§

channel_state_from_bitsDeprecated
channel_state_from_channel_bits
Classify only the D0-D3 channel bits.