/* Configures the I2C slave own address 2 and mask.  */
void I2C_OwnAddress2Config(I2C_TypeDef *I2Cx, uint16_t Address, uint8_t Mask)
/* Configures the I2C slave own address 2 and mask.  */
void I2C_OwnAddress2Config(I2C_TypeDef *I2Cx, uint16_t Address, uint8_t Mask)
{
    uint32_t tmpreg = 0;
    assert_param(IS_I2C_ALL_PERIPH(I2Cx));
    assert_param(IS_I2C_OWN_ADDRESS2(Address));
    assert_param(IS_I2C_OWN_ADDRESS2_MASK(Mask));
    tmpreg = I2Cx->OAR2;
    tmpreg &= (uint32_t)~((uint32_t)(I2C_OAR2_OA2 | I2C_OAR2_OA2MSK));
    tmpreg |= (uint32_t)(((uint32_t)Address & I2C_OAR2_OA2) | \
                         (((uint32_t)Mask << 8) & I2C_OAR2_OA2MSK)) ;
    I2Cx->OAR2 = tmpreg;
}