From: Hyeonki Hong Date: Tue, 21 Apr 2020 05:29:08 +0000 (+0900) Subject: ODROID-N2: set i2c bus number based on detection X-Git-Tag: 4.6.0~1^2~1 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/7f5891e14647387af16c33c73d1e70ee953f03f1 ODROID-N2: set i2c bus number based on detection --- 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