pub fn digital_write(pin: &Pin<Output>, value: bool) {
  let peripheral_ptr;
  unsafe {peripheral_ptr = stm32f4::stm32f446::Peripherals::steal();} 

  match pin.block {
    'a' => {
      let gpioa = &peripheral_ptr.GPIOA;
      if value {gpioa.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpioa.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    'b' => {
      let gpiob = &peripheral_ptr.GPIOB;
      if value {gpiob.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpiob.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    'c' => {
      let gpioc = &peripheral_ptr.GPIOC;
      if value {gpioc.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpioc.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    'd' => {
      let gpiod = &peripheral_ptr.GPIOD;
      if value {gpiod.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpiod.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    'h' => {
      let gpioh = &peripheral_ptr.GPIOH;
      if value {gpioh.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpioh.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    _   => unreachable!()
  };
}
/// Sets the state of an output pin.
/// 
/// Takes [pin-struct](crate::gpio::Pin) of an output pin and a boolean value as arguments and sets the pin to that value.
Sets the state of an output pin.
Takes [pin-struct](crate::gpio::Pin) of an output pin and a boolean value as arguments and sets the pin to that value.
Sets the state of an output pin . Takes [ pin - struct ] ( crate :: gpio :: Pin ) of an output pin and a boolean value as arguments and sets the pin to that value .
pub fn digital_write(pin: &Pin<Output>, value: bool) {
  let peripheral_ptr;
  unsafe {peripheral_ptr = stm32f4::stm32f446::Peripherals::steal();} 
  match pin.block {
    'a' => {
      let gpioa = &peripheral_ptr.GPIOA;
      if value {gpioa.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpioa.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    'b' => {
      let gpiob = &peripheral_ptr.GPIOB;
      if value {gpiob.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpiob.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    'c' => {
      let gpioc = &peripheral_ptr.GPIOC;
      if value {gpioc.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpioc.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    'd' => {
      let gpiod = &peripheral_ptr.GPIOD;
      if value {gpiod.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpiod.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    'h' => {
      let gpioh = &peripheral_ptr.GPIOH;
      if value {gpioh.bsrr.write(|w| unsafe {w.bits(1 << pin.number)});}
      else {gpioh.bsrr.write(|w| unsafe {w.bits(1 << (pin.number + 16))});}
    },
    _   => unreachable!()
  };
}
pub fn digital_write ( pin : & Pin < Output > , value : bool ) { let peripheral_ptr ; unsafe { peripheral_ptr = stm32f4 :: stm32f446 :: Peripherals :: steal ( ) ; } match pin . block { 'a' => { let gpioa = & peripheral_ptr . GPIOA ; if value { gpioa . bsrr . write ( | w | unsafe { w . bits ( 1 << pin . number ) } ) ; } else { gpioa . bsrr . write ( | w | unsafe { w . bits ( 1 << ( pin . number + 16 ) ) } ) ; } } , 'b' => { let gpiob = & peripheral_ptr . GPIOB ; if value { gpiob . bsrr . write ( | w | unsafe { w . bits ( 1 << pin . number ) } ) ; } else { gpiob . bsrr . write ( | w | unsafe { w . bits ( 1 << ( pin . number + 16 ) ) } ) ; } } , 'c' => { let gpioc = & peripheral_ptr . GPIOC ; if value { gpioc . bsrr . write ( | w | unsafe { w . bits ( 1 << pin . number ) } ) ; } else { gpioc . bsrr . write ( | w | unsafe { w . bits ( 1 << ( pin . number + 16 ) ) } ) ; } } , 'd' => { let gpiod = & peripheral_ptr . GPIOD ; if value { gpiod . bsrr . write ( | w | unsafe { w . bits ( 1 << pin . number ) } ) ; } else { gpiod . bsrr . write ( | w | unsafe { w . bits ( 1 << ( pin . number + 16 ) ) } ) ; } } , 'h' => { let gpioh = & peripheral_ptr . GPIOH ; if value { gpioh . bsrr . write ( | w | unsafe { w . bits ( 1 << pin . number ) } ) ; } else { gpioh . bsrr . write ( | w | unsafe { w . bits ( 1 << ( pin . number + 16 ) ) } ) ; } } , _ => unreachable ! ( ) } ; }
Sets the state of an output pin.
Sets the state of an output pin .
pin
&Pin<Output>
value
bool
pin
&Pin<Output>
value
bool