]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/hfu540/pin.py
feat: add I2C and SPI
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / hfu540 / pin.py
index 985d4297f747dafee458f1dc0f7bc4028588164f..63c85bd45d35f93c62c8e20659335c19a01f5e50 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Hifive Unleashed pin names"""
 
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
@@ -5,11 +8,11 @@ from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 UART0_TXD = Pin(5)
 UART0_RXD = Pin(7)
 SPI0_SCLK = Pin(8)
-SPI0_DIN  = Pin(10)
+SPI0_DIN = Pin(10)
 UART1_TXD = Pin(11)
-SPI0_CS   = Pin(12)
+SPI0_CS = Pin(12)
 UART1_RXD = Pin(13)
-SPIO0_DOUT = Pin(14)
+SPI0_DOUT = Pin(14)
 I2C0_SCL = Pin(15)
 I2C0_SDA = Pin(17)
 GPIO0 = Pin(23)
@@ -25,14 +28,14 @@ GPIO9 = Pin(32)
 GPIO15 = Pin(33)
 
 # ordered as spiId, sckId, mosiId, misoId
-SPI_PORTS = ((1, SPI0_SCLK, SPI0_DOUT, SPI0_DIN))
+SPI_PORTS = (1, SPI0_SCLK, SPI0_DOUT, SPI0_DIN)
 
 # ordered as uartId, txId, rxId
 UART_PORTS = (
     (0, UART0_TXD, UART0_RXD),
     # (0, GPIO15, GPIO13)
-    (1, UART1_TXD, UART1_RXD))
+    (1, UART1_TXD, UART1_RXD),
+)
 
-# ordered as spiId, spiSCA, spiSCL 
-I2C_PORTS = (
-    (0, I2C0_SCA, I2C0_SCL))
+# ordered as i2cId, sclId, sdaId
+I2C_PORTS = (0, I2C0_SDA, I2C0_SCL)