]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Moved ports declarations into microcontroller.pin package, and used pin references...
authorCefn Hoile <github.com@cefn.com>
Mon, 26 Feb 2018 19:48:58 +0000 (19:48 +0000)
committerCefn Hoile <github.com@cefn.com>
Mon, 26 Feb 2018 19:48:58 +0000 (19:48 +0000)
src/adafruit_blinka/microcontroller/esp8266/__init__.py
src/adafruit_blinka/microcontroller/esp8266/pin.py
src/adafruit_blinka/microcontroller/stm32/__init__.py
src/adafruit_blinka/microcontroller/stm32/pin.py
test/src/testing/board/__init__.py

index 1ead4c5eaa7377a1039f4addb6062773f6b9f363..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 (file)
@@ -1,8 +1 @@
-# ordered as spiId, sckId, mosiId, misoId
-spiPorts = ((1, 14, 13, 12))
 
 
-# ordered as uartId, txId, rxId
-uartPorts = (
-    (0, 1, 3),
-    # (0, 15, 13) # TODO secondary pins for UART0 configurable from Micropython?
-    (1, 2, None))
index fd2910cb5b4ee3a51fda22c7b77d171758a3c11c..647ac7512536c2c01c4bbbeae6e36d1cb7effd37 100644 (file)
@@ -25,3 +25,14 @@ class cpu():
         from machine import freq
         return freq()
 """
         from machine import freq
         return freq()
 """
+
+# ordered as spiId, sckId, mosiId, misoId
+spiPorts = ((1, GPIO14, GPIO13, GPIO12))
+
+# ordered as uartId, txId, rxId
+uartPorts = (
+    (0, GPIO1, GPIO3),
+    # (0, GPIO15, GPIO13) # TODO secondary pins for UART0 configurable from Micropython? How to flag?
+    (1, GPIO2, None))
+
+i2cPorts = ()
\ No newline at end of file
index 72fba02ad23267dc686c6da83cfec450420ea67e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,13 +0,0 @@
-from microcontroller import pin
-
-# ordered as spiId, sckId, mosiId, misoId
-spiPorts = ((1, "B13", "B15", "B14"), (2, "A5", "A6", "A7"))
-
-# ordered as uartId, txId, rxId
-uartPorts = (
-    (1, "B6", "B7"),
-    (2, "A2", "A3"),
-    (3, "B10", "B11"),
-    (4, "A0", "A1"),
-    (6, "C6", "C7"),
-)
index 711383a709f39ebbd8091feab8329d26a287b3c3..3f46781bf36f0b319f083a1fc1acb2da25d44044 100644 (file)
@@ -47,3 +47,21 @@ C11 = Pin('C11')
 C12 = Pin('C12')
 C13 = Pin('C13')
 D2 = Pin('D2')
 C12 = Pin('C12')
 C13 = Pin('C13')
 D2 = Pin('D2')
+
+# ordered as spiId, sckId, mosiId, misoId
+spiPorts = ((1, B13, B15, B14), (2, A5, A6, A7))
+
+# ordered as uartId, txId, rxId
+uartPorts = (
+    (1, B6, B7),
+    (2, A2, A3),
+    (3, B10, B11),
+    (4, A0, A1),
+    (6, C6, C7),
+)
+
+i2cPorts = (
+    (1, B6, B7),
+    (2, B10, B11),
+)
+
index 0732f78b4954c69486ea33d27b6bb80e7a9440f9..03f6f31a30b2ab8dcbe94359fbb6c89d2a020f68 100644 (file)
@@ -1,22 +1,24 @@
 """Configuration of testing fixtures depending on the board layout"""
 from adafruit_blinka import agnostic
 
 """Configuration of testing fixtures depending on the board layout"""
 from adafruit_blinka import agnostic
 
+import board
+
 if agnostic.board == "feather_m0_express":
 if agnostic.board == "feather_m0_express":
-    default_pin = feather_m0_express.D5
-    led_pin = feather_m0_express.D13
+    default_pin = board.D5
+    led_pin = board.D13
     led_hardwired = True
     led_inverted = False
 elif agnostic.board == "feather_huzzah":
     led_hardwired = True
     led_inverted = False
 elif agnostic.board == "feather_huzzah":
-    from adafruit_blinka.board import feather_huzzah
-
-    default_pin = feather_huzzah.GPIO4
-    led_pin = feather_huzzah.GPIO0 # red led
+    default_pin = board.GPIO4
+    led_pin = board.GPIO0 # red led
     led_hardwired = True
     led_inverted = True
 elif agnostic.board == "pyboard":
     led_hardwired = True
     led_inverted = True
 elif agnostic.board == "pyboard":
-    default_pin = pyboard.X1
-    led_pin = adafruit_blinka.board.pyboard.LED_BLUE
+    default_pin = board.X1
+    led_pin = board.LED_BLUE
     led_hardwired = True
     led_inverted = False
     led_hardwired = True
     led_inverted = False
+    uartTxId = "B6"
+    uartRXId = "B7"
 else:
 else:
-    raise NotImplementedError("Board not supported")
+    raise NotImplementedError("Board not supported")
\ No newline at end of file