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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
use crate::iomuxc::{
gpio::{
GPIO_B0_10, GPIO_B0_11, GPIO_B1_00, GPIO_B1_01, GPIO_EMC_04, GPIO_EMC_05, GPIO_EMC_06,
GPIO_EMC_08,
},
Alt1, Alt2, Alt6,
};
pub mod output {
pub trait Output {}
pub struct A;
impl Output for A {}
pub struct B;
impl Output for B {}
}
pub mod module {
pub trait Module {}
pub struct _1;
impl Module for _1 {}
pub struct _2;
impl Module for _2 {}
pub struct _3;
impl Module for _3 {}
pub struct _4;
impl Module for _4 {}
}
pub mod submodule {
use crate::pac::pwm1;
pub trait Submodule {
const IDX: usize;
fn submodule(pwm: &pwm1::RegisterBlock) -> &pwm1::SM;
}
pub struct _0;
impl Submodule for _0 {
const IDX: usize = 0;
fn submodule(pwm: &pwm1::RegisterBlock) -> &pwm1::SM {
&pwm.sm0
}
}
pub struct _1;
impl Submodule for _1 {
const IDX: usize = 1;
fn submodule(pwm: &pwm1::RegisterBlock) -> &pwm1::SM {
&pwm.sm1
}
}
pub struct _2;
impl Submodule for _2 {
const IDX: usize = 2;
fn submodule(pwm: &pwm1::RegisterBlock) -> &pwm1::SM {
&pwm.sm2
}
}
pub struct _3;
impl Submodule for _3 {
const IDX: usize = 3;
fn submodule(pwm: &pwm1::RegisterBlock) -> &pwm1::SM {
&pwm.sm3
}
}
}
pub trait Pin {
type Output: output::Output;
type Module: module::Module;
type Submodule: submodule::Submodule;
}
impl Pin for GPIO_B0_10<Alt2> {
type Output = output::A;
type Module = module::_2;
type Submodule = submodule::_2;
}
impl Pin for GPIO_B0_11<Alt2> {
type Output = output::B;
type Module = module::_2;
type Submodule = submodule::_2;
}
impl Pin for GPIO_B1_01<Alt6> {
type Output = output::B;
type Module = module::_1;
type Submodule = submodule::_3;
}
impl Pin for GPIO_B1_00<Alt6> {
type Output = output::A;
type Module = module::_1;
type Submodule = submodule::_3;
}
impl Pin for GPIO_EMC_04<Alt1> {
type Output = output::A;
type Module = module::_4;
type Submodule = submodule::_2;
}
impl Pin for GPIO_EMC_05<Alt1> {
type Output = output::B;
type Module = module::_4;
type Submodule = submodule::_2;
}
impl Pin for GPIO_EMC_06<Alt1> {
type Output = output::A;
type Module = module::_2;
type Submodule = submodule::_0;
}
impl Pin for GPIO_EMC_08<Alt1> {
type Output = output::A;
type Module = module::_2;
type Submodule = submodule::_1;
}