@@ -269,16 +269,16 @@ macro_rules! gpio {
269269 let offset2 = 4 * index;
270270 unsafe {
271271 if offset2 < 32 {
272- & ( * $GPIOX:: ptr( ) ) . afrl. modify( |r, w| {
272+ ( * $GPIOX:: ptr( ) ) . afrl. modify( |r, w| {
273273 w. bits( ( r. bits( ) & !( 0b1111 << offset2) ) | ( mode << offset2) )
274274 } ) ;
275275 } else {
276276 let offset2 = offset2 - 32 ;
277- & ( * $GPIOX:: ptr( ) ) . afrh. modify( |r, w| {
277+ ( * $GPIOX:: ptr( ) ) . afrh. modify( |r, w| {
278278 w. bits( ( r. bits( ) & !( 0b1111 << offset2) ) | ( mode << offset2) )
279279 } ) ;
280280 }
281- & ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
281+ ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
282282 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b10 << offset) )
283283 } ) ;
284284 }
@@ -391,10 +391,10 @@ macro_rules! gpio {
391391 pub fn into_floating_input( self ) -> $PXi<Input <Floating >> {
392392 let offset = 2 * $i;
393393 unsafe {
394- & ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
394+ ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
395395 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b00 << offset) )
396396 } ) ;
397- & ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
397+ ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
398398 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b00 << offset) )
399399 } )
400400 } ;
@@ -406,10 +406,10 @@ macro_rules! gpio {
406406 pub fn into_pull_down_input( self ) -> $PXi<Input <PullDown >> {
407407 let offset = 2 * $i;
408408 unsafe {
409- & ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
409+ ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
410410 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b10 << offset) )
411411 } ) ;
412- & ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
412+ ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
413413 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b00 << offset) )
414414 } )
415415 } ;
@@ -421,10 +421,10 @@ macro_rules! gpio {
421421 pub fn into_pull_up_input( self ) -> $PXi<Input <PullUp >> {
422422 let offset = 2 * $i;
423423 unsafe {
424- & ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
424+ ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
425425 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b01 << offset) )
426426 } ) ;
427- & ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
427+ ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
428428 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b00 << offset) )
429429 }
430430 ) } ;
@@ -436,13 +436,13 @@ macro_rules! gpio {
436436 pub fn into_open_drain_output( self ) -> $PXi<Output <OpenDrain >> {
437437 let offset = 2 * $i;
438438 unsafe {
439- & ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
439+ ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
440440 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b00 << offset) )
441441 } ) ;
442- & ( * $GPIOX:: ptr( ) ) . otyper. modify( |r, w| {
442+ ( * $GPIOX:: ptr( ) ) . otyper. modify( |r, w| {
443443 w. bits( r. bits( ) | ( 0b1 << $i) )
444444 } ) ;
445- & ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
445+ ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
446446 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b01 << offset) )
447447 } )
448448 } ;
@@ -455,13 +455,13 @@ macro_rules! gpio {
455455 let offset = 2 * $i;
456456
457457 unsafe {
458- & ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
458+ ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
459459 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b00 << offset) )
460460 } ) ;
461- & ( * $GPIOX:: ptr( ) ) . otyper. modify( |r, w| {
461+ ( * $GPIOX:: ptr( ) ) . otyper. modify( |r, w| {
462462 w. bits( r. bits( ) & !( 0b1 << $i) )
463463 } ) ;
464- & ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
464+ ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
465465 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b01 << offset) )
466466 } )
467467 } ;
@@ -474,10 +474,10 @@ macro_rules! gpio {
474474 let offset = 2 * $i;
475475
476476 unsafe {
477- & ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
477+ ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
478478 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b00 << offset) )
479479 } ) ;
480- & ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
480+ ( * $GPIOX:: ptr( ) ) . moder. modify( |r, w| {
481481 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( 0b11 << offset) )
482482 }
483483 ) } ;
@@ -492,7 +492,7 @@ macro_rules! gpio {
492492 let offset = 2 * $i;
493493
494494 unsafe {
495- & ( * $GPIOX:: ptr( ) ) . ospeedr. modify( |r, w| {
495+ ( * $GPIOX:: ptr( ) ) . ospeedr. modify( |r, w| {
496496 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( ( speed as u32 ) << offset) )
497497 } )
498498 } ;
@@ -507,7 +507,7 @@ macro_rules! gpio {
507507 let offset = 2 * $i;
508508 let value = if on { 0b01 } else { 0b00 } ;
509509 unsafe {
510- & ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
510+ ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
511511 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( value << offset) )
512512 } )
513513 } ;
@@ -520,7 +520,7 @@ macro_rules! gpio {
520520 let offset = 2 * $i;
521521
522522 unsafe {
523- & ( * $GPIOX:: ptr( ) ) . ospeedr. modify( |r, w| {
523+ ( * $GPIOX:: ptr( ) ) . ospeedr. modify( |r, w| {
524524 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( ( speed as u32 ) << offset) )
525525 } )
526526 } ;
@@ -533,7 +533,7 @@ macro_rules! gpio {
533533 let offset = 2 * $i;
534534 let value = if on { 0b01 } else { 0b00 } ;
535535 unsafe {
536- & ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
536+ ( * $GPIOX:: ptr( ) ) . pupdr. modify( |r, w| {
537537 w. bits( ( r. bits( ) & !( 0b11 << offset) ) | ( value << offset) )
538538 } )
539539 } ;
@@ -547,7 +547,7 @@ macro_rules! gpio {
547547 pub fn set_open_drain( self ) -> Self {
548548 let offset = $i;
549549 unsafe {
550- & ( * $GPIOX:: ptr( ) ) . otyper. modify( |r, w| {
550+ ( * $GPIOX:: ptr( ) ) . otyper. modify( |r, w| {
551551 w. bits( r. bits( ) | ( 1 << offset) )
552552 } )
553553 } ;
0 commit comments