/* Enables or disables the specified I2C DMA requests.  */
void I2C_DMACmd(I2C_TypeDef *I2Cx, FunctionalState NewState)
/* Enables or disables the specified I2C DMA requests.  */
void I2C_DMACmd(I2C_TypeDef *I2Cx, FunctionalState NewState)
{
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  if (NewState != DISABLE)
  {
    if(I2C_DMA_DIR==TDMAE_SET)
    {
      I2Cx->IC_DMA_CR |= TDMAE_SET;
    }
    else if(I2C_DMA_DIR==RDMAE_SET)
    {
      I2Cx->IC_DMA_CR |= RDMAE_SET;
    }
  }
  else
  {
    I2Cx->IC_DMA_CR &= DMA_CR_TDMAE_RDMAE_Reset;
  }
}