]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/esp8266/pin.py
Moved ports declarations into microcontroller.pin package, and used pin references...
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / esp8266 / pin.py
index 9f4e0d67d08622193038f3c9794d2cc8885fb78c..647ac7512536c2c01c4bbbeae6e36d1cb7effd37 100644 (file)
@@ -1,18 +1,17 @@
 from microcontroller import Pin
 
-GPIO0=Pin(0)
-GPIO1=Pin(1)
-GPIO2=Pin(2)
-GPIO3=Pin(3)
-GPIO4=Pin(4)
-GPIO5=Pin(5)
-GPIO12=Pin(12)
-GPIO13=Pin(13)
-GPIO14=Pin(14)
-GPIO15=Pin(15)
-GPIO16=Pin(16)
-TOUT=Pin("TOUT")
-
+GPIO0 = Pin(0)
+GPIO1 = Pin(1)
+GPIO2 = Pin(2)
+GPIO3 = Pin(3)
+GPIO4 = Pin(4)
+GPIO5 = Pin(5)
+GPIO12 = Pin(12)
+GPIO13 = Pin(13)
+GPIO14 = Pin(14)
+GPIO15 = Pin(15)
+GPIO16 = Pin(16)
+TOUT = Pin("TOUT")
 """
 From introspection of microcontroller.pin on Feather Huzzah running CircuitPython
 >>> dir(microcontroller.pin)
@@ -20,10 +19,20 @@ From introspection of microcontroller.pin on Feather Huzzah running CircuitPytho
 >>> dir(board)
 ['ADC', 'GPIO16', 'GPIO14', 'SCK', 'GPIO12', 'MISO', 'GPIO13', 'MOSI', 'GPIO15', 'GPIO2', 'GPIO0', 'GPIO4', 'SDA', 'RX', 'TX', 'GPIO5', 'SCL']
 """
-
 """
 class cpu():
     def frequency(self):
         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