fix codec master mode and improve i2c protocol