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
pub enum SCL {}
pub enum SDA {}
pub trait Signal: private::Sealed {}
impl Signal for SCL {}
impl Signal for SDA {}
mod private {
pub trait Sealed {}
impl Sealed for super::SCL {}
impl Sealed for super::SDA {}
}
pub trait Pin: super::IOMUX {
const ALT: u32;
const DAISY: super::Daisy;
type Signal: Signal;
type Module: super::consts::Unsigned;
}
pub fn prepare<P: Pin>(pin: &mut P) {
super::alternate(pin, P::ALT);
super::set_sion(pin);
unsafe { P::DAISY.write() };
}