@@ -10,24 +10,10 @@ use crate::{
10
10
time:: Hertz ,
11
11
} ;
12
12
13
- #[ cfg( not( any(
14
- feature = "stm32f303x6" ,
15
- feature = "stm32f303x8" ,
16
- feature = "stm32f334" ,
17
- feature = "stm32f328" ,
18
- ) ) ) ]
13
+ #[ cfg( not( feature = "gpio-f333" ) ) ]
19
14
use crate :: { gpio:: gpiof, pac:: I2C2 } ;
20
- #[ cfg( any(
21
- feature = "stm32f301" ,
22
- feature = "stm32f302x6" ,
23
- feature = "stm32f302x8" ,
24
- feature = "stm32f302xd" ,
25
- feature = "stm32f302xe" ,
26
- feature = "stm32f303xd" ,
27
- feature = "stm32f303xe" ,
28
- feature = "stm32f318" ,
29
- feature = "stm32f398" ,
30
- ) ) ]
15
+
16
+ #[ cfg( any( feature = "gpio-f302" , feature = "gpio-f303e" ) ) ]
31
17
use crate :: {
32
18
gpio:: { gpioc, AF3 , AF8 } ,
33
19
pac:: I2C3 ,
@@ -68,12 +54,7 @@ unsafe impl SdaPin<I2C1> for gpiob::PB7<AF4> {}
68
54
unsafe impl SdaPin < I2C1 > for gpiob:: PB9 < AF4 > { }
69
55
70
56
cfg_if ! {
71
- if #[ cfg( not( any(
72
- feature = "stm32f303x6" ,
73
- feature = "stm32f303x8" ,
74
- feature = "stm32f334" ,
75
- feature = "stm32f328" ,
76
- ) ) ) ] {
57
+ if #[ cfg( not( feature = "gpio-f333" ) ) ] {
77
58
unsafe impl SclPin <I2C2 > for gpioa:: PA9 <AF4 > { }
78
59
unsafe impl SclPin <I2C2 > for gpiof:: PF1 <AF4 > { }
79
60
#[ cfg( any( feature = "gpio-f303" , feature = "gpio-f303e" , feature = "gpio-f373" ) ) ]
@@ -86,17 +67,7 @@ cfg_if! {
86
67
}
87
68
88
69
cfg_if ! {
89
- if #[ cfg( any(
90
- feature = "stm32f301" ,
91
- feature = "stm32f302x6" ,
92
- feature = "stm32f302x8" ,
93
- feature = "stm32f302xd" ,
94
- feature = "stm32f302xe" ,
95
- feature = "stm32f303xd" ,
96
- feature = "stm32f303xe" ,
97
- feature = "stm32f318" ,
98
- feature = "stm32f398" ,
99
- ) ) ] {
70
+ if #[ cfg( any( feature = "gpio-f302" , feature = "gpio-f303e" ) ) ] {
100
71
unsafe impl SclPin <I2C3 > for gpioa:: PA8 <AF3 > { }
101
72
unsafe impl SdaPin <I2C3 > for gpiob:: PB5 <AF8 > { }
102
73
unsafe impl SdaPin <I2C3 > for gpioc:: PC9 <AF3 > { }
@@ -479,34 +450,11 @@ macro_rules! i2c {
479
450
} ;
480
451
}
481
452
482
- #[ cfg( any(
483
- feature = "stm32f303x6" ,
484
- feature = "stm32f303x8" ,
485
- feature = "stm32f334" ,
486
- feature = "stm32f328" ,
487
- ) ) ]
453
+ #[ cfg( feature = "gpio-f333" ) ]
488
454
i2c ! ( [ 1 ] ) ;
489
455
490
- #[ cfg( any(
491
- feature = "stm32f302xb" ,
492
- feature = "stm32f302xc" ,
493
- feature = "stm32f303xb" ,
494
- feature = "stm32f303xc" ,
495
- feature = "stm32f358" ,
496
- feature = "stm32f373" ,
497
- feature = "stm32f378" ,
498
- ) ) ]
456
+ #[ cfg( any( feature = "gpio-f303" , feature = "gpio-f373" ) ) ]
499
457
i2c ! ( [ 1 , 2 ] ) ;
500
458
501
- #[ cfg( any(
502
- feature = "stm32f301" ,
503
- feature = "stm32f302x6" ,
504
- feature = "stm32f302x8" ,
505
- feature = "stm32f302xd" ,
506
- feature = "stm32f302xe" ,
507
- feature = "stm32f303xd" ,
508
- feature = "stm32f303xe" ,
509
- feature = "stm32f318" ,
510
- feature = "stm32f398" ,
511
- ) ) ]
459
+ #[ cfg( any( feature = "gpio-f302" , feature = "gpio-f303e" ) ) ]
512
460
i2c ! ( [ 1 , 2 , 3 ] ) ;
0 commit comments