@@ -36,23 +36,25 @@ impl Direction {
36
36
}
37
37
}
38
38
39
+ type Led = Switch < gpioe:: PEx < Output < PushPull > > , ActiveHigh > ;
40
+
39
41
pub struct Leds {
40
42
/// North
41
- pub ld3 : Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > ,
43
+ pub ld3 : Led ,
42
44
/// NorthWest
43
- pub ld4 : Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > ,
45
+ pub ld4 : Led ,
44
46
/// NorthEast
45
- pub ld5 : Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > ,
47
+ pub ld5 : Led ,
46
48
/// West
47
- pub ld6 : Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > ,
49
+ pub ld6 : Led ,
48
50
/// East
49
- pub ld7 : Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > ,
51
+ pub ld7 : Led ,
50
52
/// SouthWest
51
- pub ld8 : Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > ,
53
+ pub ld8 : Led ,
52
54
/// SouthEast
53
- pub ld9 : Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > ,
55
+ pub ld9 : Led ,
54
56
/// South
55
- pub ld10 : Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > ,
57
+ pub ld10 : Led ,
56
58
}
57
59
58
60
impl Leds {
@@ -118,7 +120,7 @@ impl Leds {
118
120
}
119
121
120
122
/// Mutably borrow a LED by the given direction (as noted on the board)
121
- pub fn for_direction ( & mut self , direction : Direction ) -> & mut Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > {
123
+ pub fn for_direction ( & mut self , direction : Direction ) -> & mut Led {
122
124
match direction {
123
125
Direction :: North => & mut self . ld3 ,
124
126
Direction :: NorthEast => & mut self . ld5 ,
@@ -134,7 +136,7 @@ impl Leds {
134
136
/// Consumes the `Leds` struct and returns an array
135
137
/// where index 0 is N and each incrementing index
136
138
/// rotates clockwise around the compass
137
- pub fn into_array ( self ) -> [ Switch < gpioe :: PEx < Output < PushPull > > , ActiveHigh > ; 8 ] {
139
+ pub fn into_array ( self ) -> [ Led ; 8 ] {
138
140
[
139
141
self . ld3 , //N
140
142
self . ld5 , //NE
0 commit comments