@@ -637,25 +637,14 @@ static uint32_t i2c_getTiming(i2c_t *obj, uint32_t frequency)
637637 return ret ;
638638}
639639
640- /**
641- * @brief Default init and setup GPIO and I2C peripheral
642- * @param obj : pointer to i2c_t structure
643- * @retval none
644- */
645- void i2c_init (i2c_t * obj )
646- {
647- i2c_custom_init (obj , 100000 , I2C_ADDRESSINGMODE_7BIT , 0x33 );
648- }
649-
650640/**
651641 * @brief Initialize and setup GPIO and I2C peripheral
652642 * @param obj : pointer to i2c_t structure
653643 * @param timing : one of the i2c_timing_e
654- * @param addressingMode : I2C_ADDRESSINGMODE_7BIT or I2C_ADDRESSINGMODE_10BIT
655644 * @param ownAddress : device address
656645 * @retval none
657646 */
658- void i2c_custom_init (i2c_t * obj , uint32_t timing , uint32_t addressingMode , uint32_t ownAddress )
647+ void i2c_init (i2c_t * obj , uint32_t timing , uint32_t ownAddress )
659648{
660649 if (obj != NULL ) {
661650
@@ -771,7 +760,7 @@ void i2c_custom_init(i2c_t *obj, uint32_t timing, uint32_t addressingMode, uint3
771760#endif
772761 handle -> Init .OwnAddress1 = ownAddress ;
773762 handle -> Init .OwnAddress2 = 0 ;
774- handle -> Init .AddressingMode = addressingMode ;
763+ handle -> Init .AddressingMode = I2C_ADDRESSINGMODE_7BIT ;
775764 handle -> Init .DualAddressMode = I2C_DUALADDRESS_DISABLE ;
776765 handle -> Init .GeneralCallMode = (obj -> generalCall == 0 ) ? I2C_GENERALCALL_DISABLE : I2C_GENERALCALL_ENABLE ;
777766 handle -> Init .NoStretchMode = (obj -> NoStretchMode == 0 ) ? I2C_NOSTRETCH_DISABLE : I2C_NOSTRETCH_ENABLE ;
0 commit comments