/* Get current configured I2C bus frequency. 
This frequency is only of relevance when acting as master. */
uint32_t I2C_BusFreqGet(I2C_TypeDef *i2c)
/* Get current configured I2C bus frequency. 
This frequency is only of relevance when acting as master. */
uint32_t I2C_BusFreqGet(I2C_TypeDef *i2c)
{
  uint32_t hfperclk;
  uint32_t n;
  hfperclk = CMU_ClockFreqGet(cmuClock_HFPER);
  n        = (uint32_t)(i2cNSum[(i2c->CTRL & _I2C_CTRL_CLHR_MASK) >> _I2C_CTRL_CLHR_SHIFT]);
  return(hfperclk / ((n * (i2c->CLKDIV + 1)) + 4));
}