/* Handles I2Cx communication when starting transfer or during transfer.  */
void I2C_HandlingTransfer(I2C_T *i2c, uint16_t address, uint8_t number, I2C_RELOAD_MODE_T reloadend, I2C_GENERATE_T generates)
/* Handles I2Cx communication when starting transfer or during transfer.  */
void I2C_HandlingTransfer(I2C_T *i2c, uint16_t address, uint8_t number, I2C_RELOAD_MODE_T reloadend, I2C_GENERATE_T generates)
{
    uint32_t temp = 0;
    temp = i2c->CTRL2;
    temp &= (uint32_t)~((uint32_t)(I2C_CTRL2_SADD | I2C_CTRL2_NUMBYT | I2C_CTRL2_MASK));
    temp |= (uint32_t)(((uint32_t)address & I2C_CTRL2_SADD) | (((uint32_t)number << 16 ) & I2C_CTRL2_NUMBYT) | \
                       (uint32_t)reloadend | (uint32_t)generates);
    i2c->CTRL2 = temp;
}