Skip to content

Commit a175de6

Browse files
authored
Merge pull request #40 from stm32-rs/gpiob-full-range
Added all gpiob pins from 0-15
2 parents b76ac90 + f70b413 commit a175de6

File tree

2 files changed

+134
-27
lines changed

2 files changed

+134
-27
lines changed

src/gpio.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,10 @@ gpio!(GPIOB, gpiob, gpiob, gpioben, gpiobrst, PBx, [
591591
PB9: (pb9, 9, Input<Floating>, AFRH),
592592
PB10: (pb10, 10, Input<Floating>, AFRH),
593593
PB11: (pb11, 11, Input<Floating>, AFRH),
594+
PB12: (pb12, 12, Input<Floating>, AFRH),
595+
PB13: (pb13, 13, Input<Floating>, AFRH),
596+
PB14: (pb14, 14, Input<Floating>, AFRH),
597+
PB15: (pb15, 15, Input<Floating>, AFRH),
594598
]);
595599

596600
gpio!(GPIOD, gpiod, gpioc, gpioden, gpiodrst, PDx, [
@@ -603,6 +607,13 @@ gpio!(GPIOD, gpiod, gpioc, gpioden, gpiodrst, PDx, [
603607
PD6: (pd6, 6, Input<Floating>, AFRL),
604608
PD7: (pd7, 7, Input<Floating>, AFRL),
605609
PD8: (pd8, 8, Input<Floating>, AFRH),
610+
PD9: (pd9, 9, Input<Floating>, AFRH),
611+
PD10: (pd10, 10, Input<Floating>, AFRH),
612+
PD11: (pd11, 11, Input<Floating>, AFRH),
613+
PD12: (pd12, 12, Input<Floating>, AFRH),
614+
PD13: (pd13, 13, Input<Floating>, AFRH),
615+
PD14: (pd14, 14, Input<Floating>, AFRH),
616+
PD15: (pd15, 15, Input<Floating>, AFRH),
606617
]);
607618

608619
gpio!(GPIOE, gpioe, gpioc, gpioeen, gpioerst, PEx, [
@@ -615,4 +626,11 @@ gpio!(GPIOE, gpioe, gpioc, gpioeen, gpioerst, PEx, [
615626
PE6: (pe6, 6, Input<Floating>, AFRL),
616627
PE7: (pe7, 7, Input<Floating>, AFRL),
617628
PE8: (pe8, 8, Input<Floating>, AFRH),
629+
PE9: (pe9, 9, Input<Floating>, AFRH),
630+
PE10: (pe10, 10, Input<Floating>, AFRH),
631+
PE11: (pe11, 11, Input<Floating>, AFRH),
632+
PE12: (pe12, 12, Input<Floating>, AFRH),
633+
PE13: (pe13, 13, Input<Floating>, AFRH),
634+
PE14: (pe14, 14, Input<Floating>, AFRH),
635+
PE15: (pe15, 15, Input<Floating>, AFRH),
618636
]);

src/lib.rs

Lines changed: 116 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
feature = "stm32l4x4",
1818
feature = "stm32l4x5",
1919
feature = "stm32l4x6",
20-
)))]
20+
)))]
2121
compile_error!("This crate requires one of the following features enabled: stm32l4x1, stm32l4x2, stm32l4x3, stm32l4x4, stm32l4x5 or stm32l4x6");
2222

2323
pub use embedded_hal as hal;
2424

2525
pub use stm32l4;
26-
2726
#[cfg(feature = "stm32l4x1")]
2827
pub use stm32l4::stm32l4x1 as stm32;
2928

@@ -42,34 +41,124 @@ pub use stm32l4::stm32l4x6 as stm32;
4241
#[cfg(feature = "rt")]
4342
pub use self::stm32::interrupt;
4443

45-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
44+
pub mod datetime;
45+
#[cfg(any(
46+
feature = "stm32l4x1",
47+
feature = "stm32l4x2",
48+
feature = "stm32l4x3",
49+
feature = "stm32l4x5",
50+
feature = "stm32l4x6"
51+
))]
52+
pub mod delay;
53+
#[cfg(any(
54+
feature = "stm32l4x1",
55+
feature = "stm32l4x2",
56+
feature = "stm32l4x3",
57+
feature = "stm32l4x5",
58+
feature = "stm32l4x6"
59+
))]
4660
pub mod dma;
47-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
61+
#[cfg(any(
62+
feature = "stm32l4x1",
63+
feature = "stm32l4x2",
64+
feature = "stm32l4x3",
65+
feature = "stm32l4x5",
66+
feature = "stm32l4x6"
67+
))]
68+
pub mod flash;
69+
#[cfg(any(
70+
feature = "stm32l4x1",
71+
feature = "stm32l4x2",
72+
feature = "stm32l4x3",
73+
feature = "stm32l4x5",
74+
feature = "stm32l4x6"
75+
))]
76+
pub mod gpio;
77+
#[cfg(any(
78+
feature = "stm32l4x1",
79+
feature = "stm32l4x2",
80+
feature = "stm32l4x3",
81+
feature = "stm32l4x5",
82+
feature = "stm32l4x6"
83+
))]
84+
pub mod i2c;
85+
#[cfg(any(
86+
feature = "stm32l4x1",
87+
feature = "stm32l4x2",
88+
feature = "stm32l4x3",
89+
feature = "stm32l4x5",
90+
feature = "stm32l4x6"
91+
))]
4892
pub mod prelude;
49-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
93+
#[cfg(any(
94+
feature = "stm32l4x1",
95+
feature = "stm32l4x2",
96+
feature = "stm32l4x3",
97+
feature = "stm32l4x5",
98+
feature = "stm32l4x6"
99+
))]
100+
pub mod pwr;
101+
#[cfg(any(
102+
feature = "stm32l4x1",
103+
feature = "stm32l4x2",
104+
feature = "stm32l4x3",
105+
feature = "stm32l4x5",
106+
feature = "stm32l4x6"
107+
))]
108+
pub mod rcc;
109+
#[cfg(any(
110+
feature = "stm32l4x1",
111+
feature = "stm32l4x2",
112+
feature = "stm32l4x3",
113+
feature = "stm32l4x5",
114+
feature = "stm32l4x6"
115+
))]
116+
pub mod rng;
117+
#[cfg(any(
118+
feature = "stm32l4x1",
119+
feature = "stm32l4x2",
120+
feature = "stm32l4x3",
121+
feature = "stm32l4x5",
122+
feature = "stm32l4x6"
123+
))]
124+
pub mod rtc;
125+
#[cfg(any(
126+
feature = "stm32l4x1",
127+
feature = "stm32l4x2",
128+
feature = "stm32l4x3",
129+
feature = "stm32l4x5",
130+
feature = "stm32l4x6"
131+
))]
50132
pub mod serial;
51-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
133+
#[cfg(any(
134+
feature = "stm32l4x1",
135+
feature = "stm32l4x2",
136+
feature = "stm32l4x3",
137+
feature = "stm32l4x5",
138+
feature = "stm32l4x6"
139+
))]
140+
pub mod spi;
141+
#[cfg(any(
142+
feature = "stm32l4x1",
143+
feature = "stm32l4x2",
144+
feature = "stm32l4x3",
145+
feature = "stm32l4x5",
146+
feature = "stm32l4x6"
147+
))]
52148
pub mod time;
53-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
54-
pub mod rcc;
55-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
56-
pub mod flash;
57-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
58-
pub mod gpio;
59-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
60-
pub mod delay;
61-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
149+
#[cfg(any(
150+
feature = "stm32l4x1",
151+
feature = "stm32l4x2",
152+
feature = "stm32l4x3",
153+
feature = "stm32l4x5",
154+
feature = "stm32l4x6"
155+
))]
62156
pub mod timer;
63-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
64-
pub mod spi;
65-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
66-
pub mod rtc;
67-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
68-
pub mod pwr;
69-
pub mod datetime;
70-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
157+
#[cfg(any(
158+
feature = "stm32l4x1",
159+
feature = "stm32l4x2",
160+
feature = "stm32l4x3",
161+
feature = "stm32l4x5",
162+
feature = "stm32l4x6"
163+
))]
71164
pub mod tsc;
72-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
73-
pub mod i2c;
74-
#[cfg(any(feature = "stm32l4x1", feature = "stm32l4x2", feature = "stm32l4x3", feature = "stm32l4x5", feature = "stm32l4x6"))]
75-
pub mod rng;

0 commit comments

Comments
 (0)