11mod h7;
22pub use h7:: * ;
33
4+ macro_rules! extipin {
5+ ( $( $( #[ $attr: meta] ) * $PX: ident, ) * ) => {
6+ fn make_interrupt_source( & mut self , _syscfg: & mut $crate:: pac:: SYSCFG ) {
7+ match self {
8+ $(
9+ $( #[ $attr] ) *
10+ Self :: $PX( p) => p. make_interrupt_source( _syscfg) ,
11+ ) *
12+ _ => { } ,
13+ }
14+
15+ }
16+
17+ fn trigger_on_edge( & mut self , _exti: & mut $crate:: pac:: EXTI , _level: $crate:: gpio:: Edge ) {
18+ match self {
19+ $(
20+ $( #[ $attr] ) *
21+ Self :: $PX( p) => p. trigger_on_edge( _exti, _level) ,
22+ ) *
23+ _ => { } ,
24+ }
25+ }
26+
27+ fn enable_interrupt( & mut self , _exti: & mut $crate:: pac:: EXTI ) {
28+ match self {
29+ $(
30+ $( #[ $attr] ) *
31+ Self :: $PX( p) => p. enable_interrupt( _exti) ,
32+ ) *
33+ _ => { } ,
34+ }
35+ }
36+ fn disable_interrupt( & mut self , _exti: & mut $crate:: pac:: EXTI ) {
37+ match self {
38+ $(
39+ $( #[ $attr] ) *
40+ Self :: $PX( p) => p. disable_interrupt( _exti) ,
41+ ) *
42+ _ => { } ,
43+ }
44+ }
45+ fn clear_interrupt_pending_bit( & mut self ) {
46+ match self {
47+ $(
48+ $( #[ $attr] ) *
49+ Self :: $PX( p) => p. clear_interrupt_pending_bit( ) ,
50+ ) *
51+ _ => { } ,
52+ }
53+ }
54+ fn check_interrupt( & self ) -> bool {
55+ match self {
56+ $(
57+ $( #[ $attr] ) *
58+ Self :: $PX( p) => p. check_interrupt( ) ,
59+ ) *
60+ _ => false ,
61+ }
62+ }
63+ } ;
64+ }
65+ use extipin;
66+
467macro_rules! pin {
568 ( $( $( #[ $docs: meta] ) * <$name: ident, $Otype: ident> for $( no: $NoPin: ident, ) ? [ $(
669 $( #[ $attr: meta] ) * $PX: ident<$A: literal $( , Speed :: $Speed: ident) ?>,
@@ -60,6 +123,11 @@ macro_rules! pin {
60123 }
61124 }
62125
126+ #[ allow( unreachable_patterns) ]
127+ impl $crate:: gpio:: ExtiPin for $name {
128+ extipin! { $( $( #[ $attr] ) * $PX, ) * }
129+ }
130+
63131 $(
64132 impl From <$NoPin<$Otype>> for $name {
65133 fn from( p: $NoPin<$Otype>) -> Self {
@@ -108,7 +176,7 @@ macro_rules! pin {
108176 } ;
109177
110178 ( $( $( #[ $docs: meta] ) * <$name: ident> default : $DefaultOtype: ident for $( no: $NoPin: ident, ) ? [ $(
111- $( #[ $attr: meta] ) * $PX: ident<$A: literal $( , Speed :: $Speed: ident) ?>,
179+ $( #[ $attr: meta] ) * $PX: ident<$A: literal $( , Speed :: $Speed: ident) ?>,
112180 ) * ] , ) * ) => {
113181 $(
114182 #[ derive( Debug ) ]
@@ -165,6 +233,11 @@ macro_rules! pin {
165233 }
166234 }
167235
236+ #[ allow( unreachable_patterns) ]
237+ impl <Otype > $crate:: gpio:: ExtiPin for $name<Otype > {
238+ extipin! { $( $( #[ $attr] ) * $PX, ) * }
239+ }
240+
168241 $(
169242 impl <Otype > From <$NoPin<Otype >> for $name<Otype > {
170243 fn from( p: $NoPin<Otype >) -> Self {
@@ -274,7 +347,7 @@ pub trait I2cCommon {
274347
275348// I2S pins
276349pub trait I2sCommon {
277- type Ck ;
350+ type Ck : crate :: gpio :: PinSpeed ;
278351 type Sd ;
279352 type Ws : crate :: gpio:: ReadPin + crate :: gpio:: ExtiPin ;
280353}
@@ -286,6 +359,13 @@ pub trait I2sExtPin {
286359}
287360
288361// QuadSPI pins
362+
363+ #[ cfg( feature = "gpio-h747" ) ]
364+ pub trait QuadSpiBanks {
365+ type Bank1 ;
366+ type Bank2 ;
367+ }
368+ #[ cfg( feature = "gpio-h747" ) ]
289369pub trait QuadSpiBank {
290370 type Io0 : crate :: gpio:: PinSpeed ;
291371 type Io1 : crate :: gpio:: PinSpeed ;
@@ -294,6 +374,7 @@ pub trait QuadSpiBank {
294374 type Ncs : crate :: gpio:: PinSpeed ;
295375}
296376
377+ #[ cfg( any( feature = "gpio-h72" , feature = "gpio-h7a2" ) ) ]
297378pub trait OctospiPort {
298379 type Clk ;
299380 type Nclk ;
@@ -330,7 +411,6 @@ pub trait SaiPdm {
330411}
331412
332413// SPDIFRX pins
333-
334414pub trait SPdifIn < const C : u8 > {
335415 type In ;
336416}
@@ -364,8 +444,7 @@ pub trait TimCPin<const C: u8> {
364444 type Ch < Otype > ;
365445}
366446
367- /// This trait marks which GPIO pins may be used as complementary PWM channels; it should not be directly used.
368- /// See the device datasheet 'Pin descriptions' chapter for which pins can be used with which timer PWM channels (or look at Implementors)
447+ /// Complementary output channel `C`
369448pub trait TimNCPin < const C : u8 > {
370449 type ChN < Otype > ;
371450}
0 commit comments