1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#![no_std]
use core::convert::Into;
pub use protocols::nec;
pub use protocols::rc5;
pub use protocols::rc6;
pub mod trace;
pub mod remote;
pub use remote::RemoteControl;
mod protocols;
#[derive(PartialEq)]
pub enum ReceiverState<CMD, ERR> {
Idle,
Receiving,
Done(CMD),
Err(ERR),
Disabled,
}
pub trait Receiver {
type Command;
type ReceiveError;
fn event(
&mut self,
pinvalue: bool,
timestamp: u32,
) -> ReceiverState<Self::Command, Self::ReceiveError>;
fn reset(&mut self);
fn disable(&mut self);
}
pub enum TransmitterState {
Idle,
Transmit(bool),
Err,
}
pub trait Transmitter {
fn init<CMD: Into<u32>>(&mut self, cmd: CMD);
fn step(&mut self, ts: u32) -> TransmitterState;
fn reset(&mut self);
}