oxstack_ir/lib.rs
1//! Infrared remote-control protocols, as hardware-independent timings.
2//!
3//! An encoder produces [`Pulse`]s, each a carrier-on "mark" followed by a
4//! carrier-off "space", in microseconds. The board layer turns them into
5//! its pulse generator's format (RMT on ESP32) and adds the carrier.
6#![no_std]
7#![deny(unsafe_code)]
8#![warn(missing_docs)]
9
10#[cfg(doctest)]
11#[doc = include_str!("../README.md")]
12struct ReadmeDoctests;
13
14pub mod nec;
15
16/// One carrier burst (`mark_us`) followed by silence (`space_us`).
17#[derive(Clone, Copy, Debug, PartialEq, Eq)]
18#[cfg_attr(feature = "defmt", derive(defmt::Format))]
19pub struct Pulse {
20 /// Carrier-on time in microseconds.
21 pub mark_us: u16,
22 /// Carrier-off time in microseconds (0 for the final mark).
23 pub space_us: u16,
24}