stm32f1-hal 0.12.3

HAL for the STM32F1 family
Documentation
#![allow(unused_variables)]
use super::*;
use crate::{gpio::*, pac::*};

// table
// Do NOT manually modify the code.
// It's generated by scripts/generate_remap_table.py from scripts/table/stm32f1_remap_peripheral.csv

// Binder types ------------------

pub trait I2cSclPin<REMAP> {
    type P;
    fn into_alternate(self) -> Self::P;
}
pub trait I2cSdaPin<REMAP> {
    type P;
    fn into_alternate(self) -> Self::P;
}

// Bind pins ---------------------

impl I2cSclPin<RemapDefault<I2C1>> for PB6<Input> {
    type P = PB6<Alternate<OpenDrain>>;
    fn into_alternate(self) -> Self::P {
        self.into_mode(&mut Cr)
    }
}
impl I2cSdaPin<RemapDefault<I2C1>> for PB7<Input> {
    type P = PB7<Alternate<OpenDrain>>;
    fn into_alternate(self) -> Self::P {
        self.into_mode(&mut Cr)
    }
}
impl I2cSclPin<RemapFull<I2C1>> for PB8<Input> {
    type P = PB8<Alternate<OpenDrain>>;
    fn into_alternate(self) -> Self::P {
        self.into_mode(&mut Cr)
    }
}
impl I2cSdaPin<RemapFull<I2C1>> for PB9<Input> {
    type P = PB9<Alternate<OpenDrain>>;
    fn into_alternate(self) -> Self::P {
        self.into_mode(&mut Cr)
    }
}
impl I2cSclPin<RemapDefault<I2C2>> for PB10<Input> {
    type P = PB10<Alternate<OpenDrain>>;
    fn into_alternate(self) -> Self::P {
        self.into_mode(&mut Cr)
    }
}
impl I2cSdaPin<RemapDefault<I2C2>> for PB11<Input> {
    type P = PB11<Alternate<OpenDrain>>;
    fn into_alternate(self) -> Self::P {
        self.into_mode(&mut Cr)
    }
}

// Register operations ------------

impl RemapMode<I2C1> for RemapDefault<I2C1> {
    fn remap(afio: &mut Afio) {
        afio.mapr.modify_mapr(|_, w| w.i2c1_remap().clear_bit());
    }
}
impl RemapMode<I2C1> for RemapFull<I2C1> {
    fn remap(afio: &mut Afio) {
        afio.mapr.modify_mapr(|_, w| w.i2c1_remap().set_bit());
    }
}
impl RemapMode<I2C2> for RemapDefault<I2C2> {
    fn remap(afio: &mut Afio) {}
}