File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,13 @@ pub trait GpioExt {
119
119
/// The to split the GPIO into
120
120
type Parts ;
121
121
122
- /// Splits the GPIO block into independent pins and registers
122
+ /// Splits the GPIO block into independent pins and registers.
123
+ ///
124
+ /// This resets the state of the GPIO block.
123
125
fn split ( self ) -> Self :: Parts ;
126
+
127
+ /// Splits the GPIO block into independent pins and registers without resetting its state.
128
+ fn split_without_reset ( self ) -> Self :: Parts ;
124
129
}
125
130
126
131
/// Marker trait for active states.
@@ -391,6 +396,19 @@ macro_rules! gpio {
391
396
) +
392
397
}
393
398
}
399
+
400
+ fn split_without_reset( self ) -> Parts {
401
+ let rcc = unsafe { & ( * RCC :: ptr( ) ) } ;
402
+ $GPIOX:: enable( rcc) ;
403
+
404
+ Parts {
405
+ crl: Cr :: <$port_id, false >( ( ) ) ,
406
+ crh: Cr :: <$port_id, true >( ( ) ) ,
407
+ $(
408
+ $pxi: $PXi:: new( ) ,
409
+ ) +
410
+ }
411
+ }
394
412
}
395
413
396
414
impl <MODE > PartiallyErasedPin <$port_id, MODE > {
You can’t perform that action at this time.
0 commit comments