@@ -9,10 +9,18 @@ use core::marker::PhantomData;
9
9
10
10
use crate :: dac;
11
11
use crate :: exti:: { Event as ExtiEvent , ExtiExt } ;
12
- use crate :: gpio:: gpioa:: { PA0 , PA1 , PA11 , PA12 , PA2 , PA3 , PA4 , PA5 , PA6 , PA7 } ;
13
- use crate :: gpio:: gpiob:: { PB0 , PB1 , PB14 , PB2 , PB6 , PB7 , PB8 , PB9 } ;
12
+ use crate :: gpio:: gpioa:: { PA0 , PA1 , PA2 , PA3 , PA4 , PA5 , PA7 } ;
13
+ use crate :: gpio:: gpiob:: { PB0 , PB1 , PB2 } ;
14
14
use crate :: gpio:: * ;
15
15
16
+ #[ cfg( any( feature = "stm32g474" ) ) ]
17
+ use crate :: gpio:: {
18
+ gpiob:: { PB6 , PB7 , PB8 , PB9 } ,
19
+ gpioc:: PC2 ,
20
+ gpiof:: PF4 ,
21
+ gpioa:: { PA11 , PA12 , PA6 } ,
22
+ } ;
23
+
16
24
#[ cfg( any(
17
25
feature = "stm32g473" ,
18
26
feature = "stm32g483" ,
@@ -27,7 +35,7 @@ use crate::gpio::gpioa::{PA10, PA8, PA9};
27
35
feature = "stm32g474" ,
28
36
feature = "stm32g484"
29
37
) ) ]
30
- use crate :: gpio:: gpiob:: { PB10 , PB11 , PB12 , PB13 , PB15 } ;
38
+ use crate :: gpio:: gpiob:: { PB10 , PB11 , PB12 , PB13 , PB14 , PB15 } ;
31
39
32
40
#[ cfg( any(
33
41
feature = "stm32g473" ,
@@ -43,12 +51,11 @@ use crate::gpio::gpioc::{PC6, PC7, PC8};
43
51
feature = "stm32g474" ,
44
52
feature = "stm32g484"
45
53
) ) ]
46
- use crate :: gpio:: gpiod:: { PD10 , PD11 , PD12 , PD13 , PD15 } ;
54
+ use crate :: gpio:: gpiod:: { PD10 , PD11 , PD12 , PD13 , PD14 , PD15 } ;
47
55
48
- use crate :: gpio:: gpioc:: { PC0 , PC1 , PC2 } ;
49
- use crate :: gpio:: gpiod:: PD14 ;
56
+ use crate :: gpio:: gpioc:: { PC0 , PC1 } ;
50
57
use crate :: gpio:: gpioe:: { PE7 , PE8 } ;
51
- use crate :: gpio:: gpiof:: { PF1 , PF4 } ;
58
+ use crate :: gpio:: gpiof:: PF1 ;
52
59
use crate :: rcc:: { Clocks , Rcc } ;
53
60
use crate :: stm32:: { COMP , EXTI } ;
54
61
@@ -773,6 +780,7 @@ pub trait OutputPin<COMP> {
773
780
fn setup ( self ) ;
774
781
}
775
782
783
+ #[ allow( unused_macros) ] // TODO: add support for more devices
776
784
macro_rules! output_pin {
777
785
( $COMP: ident, $pin: ident, $AF: ident, $mode_t: ident, $into: ident) => {
778
786
impl OutputPin <$COMP> for $pin<Output <$mode_t>> {
@@ -787,6 +795,9 @@ macro_rules! output_pin {
787
795
) +} ;
788
796
}
789
797
798
+ // TODO: look up alternate functions for more devices than g474
799
+ // https://www.mouser.se/datasheet/2/389/stm32g474cb-1600828.pdf#page=73
800
+ #[ cfg( feature = "stm32g474" ) ]
790
801
output_pin ! {
791
802
COMP1 : PA0 , AF8 ,
792
803
COMP1 : PA6 , AF8 ,
@@ -808,11 +819,13 @@ output_pin! {
808
819
COMP4 : PB14 , AF8 ,
809
820
}
810
821
822
+ // TODO: look up alternate functions for more devices than g474
823
+ // https://www.mouser.se/datasheet/2/389/stm32g474cb-1600828.pdf#page=73
811
824
#[ cfg( any(
812
- feature = "stm32g473" ,
813
- feature = "stm32g483" ,
825
+ // feature = "stm32g473",
826
+ // feature = "stm32g483",
814
827
feature = "stm32g474" ,
815
- feature = "stm32g484"
828
+ // feature = "stm32g484"
816
829
) ) ]
817
830
output_pin ! {
818
831
COMP5 : PA9 , AF8 ,
0 commit comments