Skip to content

Commit

Permalink
Merge pull request #618 from Paciente8159/617-bug-stm32f4-fails-to-co…
Browse files Browse the repository at this point in the history
…mpile-when-using-hw-i2c

Fixed STM32F4 I2C pin config
  • Loading branch information
Paciente8159 authored Feb 13, 2024
2 parents 054ac3d + 723384e commit 04b7b98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions uCNC/src/hal/mcus/stm32f4x/mcu_stm32f4x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,10 @@ uint8_t mcu_i2c_receive(uint8_t address, uint8_t *data, uint8_t datalen, uint32_
void mcu_i2c_config(uint32_t frequency)
{
RCC->APB1ENR |= I2C_APBEN;
mcu_config_output_af(I2C_CLK, GPIO_OUTALT_OD_50MHZ);
mcu_config_output_af(I2C_DATA, GPIO_OUTALT_OD_50MHZ);
mcu_config_opendrain(I2C_CLK);
mcu_config_opendrain(I2C_DATA);
mcu_config_af(I2C_CLK, GPIO_AF);
mcu_config_af(I2C_DATA, GPIO_AF);
#ifdef SPI_REMAP
AFIO->MAPR |= I2C_REMAP;
#endif
Expand Down

0 comments on commit 04b7b98

Please sign in to comment.