outsource i2c_start, i2c_idle and i2c_stop

move i2c_start, i2c_idle and i2c_stop to separate procedures