Browse Source

stm32: i2c: drop i2c_reset()

It's simply a wrapper around rcc_reset_pulse already.
Just drop it. See 034dbf20ff for the same deletion for timers.

Signed-off-by: Karl Palsson <karlp@tweak.au>
pull/1461/head
Karl Palsson 2 years ago
parent
commit
b3bdf025d7
  1. 1
      include/libopencm3/stm32/common/i2c_common_v1.h
  2. 1
      include/libopencm3/stm32/common/i2c_common_v2.h
  3. 34
      lib/stm32/common/i2c_common_v1.c
  4. 36
      lib/stm32/common/i2c_common_v2.c

1
include/libopencm3/stm32/common/i2c_common_v1.h

@ -385,7 +385,6 @@ enum i2c_speeds {
BEGIN_DECLS
void i2c_reset(uint32_t i2c);
void i2c_peripheral_enable(uint32_t i2c);
void i2c_peripheral_disable(uint32_t i2c);
void i2c_send_start(uint32_t i2c);

1
include/libopencm3/stm32/common/i2c_common_v2.h

@ -402,7 +402,6 @@ enum i2c_speeds {
BEGIN_DECLS
void i2c_reset(uint32_t i2c);
void i2c_peripheral_enable(uint32_t i2c);
void i2c_peripheral_disable(uint32_t i2c);
void i2c_send_start(uint32_t i2c);

34
lib/stm32/common/i2c_common_v1.c

@ -41,40 +41,6 @@ register access, Error conditions
/**@{*/
/*---------------------------------------------------------------------------*/
/** @brief I2C Reset.
The I2C peripheral and all its associated configuration registers are placed in
the reset condition. The reset is effected via the RCC peripheral reset system.
@param[in] i2c Unsigned int32. I2C peripheral identifier @ref i2c_reg_base.
*/
void i2c_reset(uint32_t i2c)
{
switch (i2c) {
case I2C1:
rcc_periph_reset_pulse(RST_I2C1);
break;
#if defined(I2C2_BASE)
case I2C2:
rcc_periph_reset_pulse(RST_I2C2);
break;
#endif
#if defined(I2C3_BASE)
case I2C3:
rcc_periph_reset_pulse(RST_I2C3);
break;
#endif
#if defined(I2C4_BASE)
case I2C4:
rcc_periph_reset_pulse(RST_I2C4);
break;
#endif
default:
break;
}
}
/*---------------------------------------------------------------------------*/
/** @brief I2C Peripheral Enable.

36
lib/stm32/common/i2c_common_v2.c

@ -24,42 +24,6 @@
/**@{*/
/*---------------------------------------------------------------------------*/
/** @brief I2C Reset.
*
* The I2C peripheral and all its associated configuration registers are placed
* in the reset condition. The reset is effected via the RCC peripheral reset
* system.
*
* @param[in] i2c Unsigned int32. I2C peripheral identifier @ref i2c_reg_base.
*/
void i2c_reset(uint32_t i2c)
{
switch (i2c) {
case I2C1:
rcc_periph_reset_pulse(RST_I2C1);
break;
#if defined(I2C2_BASE)
case I2C2:
rcc_periph_reset_pulse(RST_I2C2);
break;
#endif
#if defined(I2C3_BASE)
case I2C3:
rcc_periph_reset_pulse(RST_I2C3);
break;
#endif
#if defined(I2C4_BASE)
case I2C4:
rcc_periph_reset_pulse(RST_I2C4);
break;
#endif
default:
break;
}
}
/*---------------------------------------------------------------------------*/
/** @brief I2C Peripheral Enable.
*

Loading…
Cancel
Save