#![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> {}
pub trait I2cSdaPin<REMAP> {}

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

impl I2cSclPin<RemapDefault<I2C1>> for PB6<Alternate<OpenDrain>> {}
impl I2cSdaPin<RemapDefault<I2C1>> for PB7<Alternate<OpenDrain>> {}
impl I2cSclPin<RemapFull<I2C1>> for PB8<Alternate<OpenDrain>> {}
impl I2cSdaPin<RemapFull<I2C1>> for PB9<Alternate<OpenDrain>> {}
impl I2cSclPin<RemapDefault<I2C2>> for PB10<Alternate<OpenDrain>> {}
impl I2cSdaPin<RemapDefault<I2C2>> for PB11<Alternate<OpenDrain>> {}

// 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) {}
}
