bbremote: implement i2c read/write support
Extend the bbremote script with operations to perform binary i2c
read/write operations.

E.g.:

    barebox:/ i2c_read -b 0 -a 0x68 -r 0x06A0 -c 4 -w
    0x8f 0x30 0x00 0x00

    barebox:/ i2c_write -b 0 -a 0x68 -r 0x06A0 -w 0x87 0x30 0x00 0x00

    barebox:/ i2c_read -b 0 -a 0x68 -r 0x06A0 -c 4 -w
    0x87 0x30 0x00 0x00

    barebox:/ i2c_write -b 0 -a 0x68 -r 0x06A0 -w 0x8f 0x30 0x00 0x00

    barebox:/ i2c_read -b 0 -a 0x68 -r 0x06A0 -c 4 -w
    0x8f 0x30 0x00 0x00

    ===================================================================

    $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-read 0x00 0x68 0x06A0 0x01 4
    8f300000

    $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-write 0x00 0x68 0x06A0 0x01 "87300000"
    4 bytes written

    $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-read 0x00 0x68 0x06A0 0x01 4
    87300000

    $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-write 0x00 0x68 0x06A0 0x01 "8f300000"
    4 bytes written

    $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-read 0x00 0x68 0x06A0 0x01 4
    8f300000

Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 2d2daa3 commit de6d3aeec9a590c4eb53a953c8758f183ffeba1e
@Aleksander Morgado Aleksander Morgado authored on 12 Sep 2018
Sascha Hauer committed on 17 Sep 2018
Showing 3 changed files
View
scripts/remote/controller.py
View
scripts/remote/main.py
View
scripts/remote/messages.py