Skip to content

Commit

Permalink
updated stm32f4 i2c pin config
Browse files Browse the repository at this point in the history
  • Loading branch information
Paciente8159 committed Feb 12, 2024
1 parent f4597e9 commit 723384e
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 723384e

Please sign in to comment.