i2c-raspberry: split testcode into functions