None
None
// setup the pins
palSetPadMode(GPIOB, 8,
PAL_MODE_ALTERNATE(4) | PAL_STM32_PUDR_PULLUP |
PAL_STM32_OTYPE_OPENDRAIN); // SCL
palSetPadMode(GPIOB, 9,
PAL_MODE_ALTERNATE(4) | PAL_STM32_PUDR_PULLUP |
PAL_STM32_OTYPE_OPENDRAIN); // SDA
static const I2CConfig i2cfg = {
OPMODE_I2C,
400000,
FAST_DUTY_CYCLE_2,
};
i2cStart(&I2CD1, &i2cfg);
i2cStop(&I2CD1);
palSetPadMode(GPIOB, 8, PAL_MODE_INPUT_ANALOG);
palSetPadMode(GPIOB, 9, PAL_MODE_INPUT_ANALOG);