i2c at 400kHz

This commit is contained in:
Alessandro Mauri 2026-04-21 21:56:23 +02:00
parent 7b1be30a6c
commit 1fdf6d2cca

View File

@ -144,7 +144,7 @@ static inline void setup_i2c(void)
// Enable AFIO (Alternate Function IO) // Enable AFIO (Alternate Function IO)
RCC->APB2PCENR |= RCC_AFIOEN; RCC->APB2PCENR |= RCC_AFIOEN;
// Init I2C // Init I2C
i2c_init(I2C_TARGET, FUNCONF_SYSTEM_CORE_CLOCK, 100000); i2c_init(I2C_TARGET, FUNCONF_SYSTEM_CORE_CLOCK, 400000);
// To utilize the I2C bus we need to disable SWD first, since the pins overlap // To utilize the I2C bus we need to disable SWD first, since the pins overlap
AFIO->PCFR1 &= ~(0b0111 << 24); AFIO->PCFR1 &= ~(0b0111 << 24);