pub fn end(self) {
    let peripheral_ptr;
    unsafe {peripheral_ptr = stm32f4::stm32f446::Peripherals::steal();}
    let rcc = &peripheral_ptr.RCC;

    match self.core {
      1 => {
        let i2c1 = &peripheral_ptr.I2C1;
        rcc.apb1enr.modify(|_, w| w.i2c1en().disabled());
        i2c1.cr1.reset();
        i2c1.cr2.reset();
        i2c1.ccr.reset();
        i2c1.trise.reset();
        i2c1.oar1.reset(); 
      },
      2 => {
        let i2c2 = &peripheral_ptr.I2C2;
        rcc.apb1enr.modify(|_, w| w.i2c2en().disabled());
        i2c2.cr1.reset();
        i2c2.cr2.reset();
        i2c2.ccr.reset();
        i2c2.trise.reset();
        i2c2.oar1.reset(); 
      },
      3 => {
        let i2c3 = &peripheral_ptr.I2C3;
        rcc.apb1enr.modify(|_, w| w.i2c3en().disabled());
        i2c3.cr1.reset();
        i2c3.cr2.reset();
        i2c3.ccr.reset();
        i2c3.trise.reset();
        i2c3.oar1.reset(); 
      },
      _ => panic!("I2C{} is not a valid core! | I2C::new()", self.core)
    };

    drop(self);
  }
/// Deacitivates the I2C peripheral and destroys the struct, freeing the core and pins.
Deacitivates the I2C peripheral and destroys the struct, freeing the core and pins.
Deacitivates the I2C peripheral and destroys the struct freeing the core and pins .
pub fn end(self) {
    let peripheral_ptr;
    unsafe {peripheral_ptr = stm32f4::stm32f446::Peripherals::steal();}
    let rcc = &peripheral_ptr.RCC;
    match self.core {
      1 => {
        let i2c1 = &peripheral_ptr.I2C1;
        rcc.apb1enr.modify(|_, w| w.i2c1en().disabled());
        i2c1.cr1.reset();
        i2c1.cr2.reset();
        i2c1.ccr.reset();
        i2c1.trise.reset();
        i2c1.oar1.reset(); 
      },
      2 => {
        let i2c2 = &peripheral_ptr.I2C2;
        rcc.apb1enr.modify(|_, w| w.i2c2en().disabled());
        i2c2.cr1.reset();
        i2c2.cr2.reset();
        i2c2.ccr.reset();
        i2c2.trise.reset();
        i2c2.oar1.reset(); 
      },
      3 => {
        let i2c3 = &peripheral_ptr.I2C3;
        rcc.apb1enr.modify(|_, w| w.i2c3en().disabled());
        i2c3.cr1.reset();
        i2c3.cr2.reset();
        i2c3.ccr.reset();
        i2c3.trise.reset();
        i2c3.oar1.reset(); 
      },
      _ => panic!("I2C{} is not a valid core! | I2C::new()", self.core)
    };
    drop(self);
  }
pub fn end ( self ) { let peripheral_ptr ; unsafe { peripheral_ptr = stm32f4 :: stm32f446 :: Peripherals :: steal ( ) ; } let rcc = & peripheral_ptr . RCC ; match self . core { 1 => { let i2c1 = & peripheral_ptr . I2C1 ; rcc . apb1enr . modify ( | _ , w | w . i2c1en ( ) . disabled ( ) ) ; i2c1 . cr1 . reset ( ) ; i2c1 . cr2 . reset ( ) ; i2c1 . ccr . reset ( ) ; i2c1 . trise . reset ( ) ; i2c1 . oar1 . reset ( ) ; } , 2 => { let i2c2 = & peripheral_ptr . I2C2 ; rcc . apb1enr . modify ( | _ , w | w . i2c2en ( ) . disabled ( ) ) ; i2c2 . cr1 . reset ( ) ; i2c2 . cr2 . reset ( ) ; i2c2 . ccr . reset ( ) ; i2c2 . trise . reset ( ) ; i2c2 . oar1 . reset ( ) ; } , 3 => { let i2c3 = & peripheral_ptr . I2C3 ; rcc . apb1enr . modify ( | _ , w | w . i2c3en ( ) . disabled ( ) ) ; i2c3 . cr1 . reset ( ) ; i2c3 . cr2 . reset ( ) ; i2c3 . ccr . reset ( ) ; i2c3 . trise . reset ( ) ; i2c3 . oar1 . reset ( ) ; } , _ => panic ! ( " " self core ) } ; drop ( self ) ; }
Deacitivates the I2C peripheral and destroys the struct, freeing the core and pins.
Deacitivates the I2C peripheral and destroys the struct freeing the core and pins .
self
self