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
pub trait Signal: private::Sealed {}
pub enum SCK {}
pub enum SDO {}
pub enum SDI {}
pub enum PCS0 {}
impl Signal for SCK {}
impl Signal for SDO {}
impl Signal for SDI {}
impl Signal for PCS0 {}
mod private {
pub trait Sealed {}
impl Sealed for super::SCK {}
impl Sealed for super::SDO {}
impl Sealed for super::SDI {}
impl Sealed for super::PCS0 {}
}
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() };
}