From 7f5891e14647387af16c33c73d1e70ee953f03f1 Mon Sep 17 00:00:00 2001 From: Hyeonki Hong Date: Tue, 21 Apr 2020 14:29:08 +0900 Subject: [PATCH] ODROID-N2: set i2c bus number based on detection --- src/adafruit_blinka/board/hardkernel/odroidn2.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/adafruit_blinka/board/hardkernel/odroidn2.py b/src/adafruit_blinka/board/hardkernel/odroidn2.py index 7d23d70..965873b 100644 --- a/src/adafruit_blinka/board/hardkernel/odroidn2.py +++ b/src/adafruit_blinka/board/hardkernel/odroidn2.py @@ -51,8 +51,13 @@ GPIOA0_13 = pin.GPIO509 GPIOA0_14 = pin.GPIO510 GPIOA0_15 = pin.GPIO511 -SDA = pin.I2C3_SDA -SCL = pin.I2C3_SCL +for it in pin.i2cPorts: + globals()["SCL" + str(it[0])] = it[1] + globals()["SDA" + str(it[0])] = it[2] + +# Set second i2c bus as default for backward compatibility. +SCL = pin.i2cPorts[1][1] +SDA = pin.i2cPorts[1][2] SCLK = pin.SPI0_SCLK MOSI = pin.SPI0_MOSI -- 2.49.0