]> Repositories - Adafruit_Blinka-hackapet.git/blob - src/adafruit_blinka/microcontroller/esp8266/pin.py
647ac7512536c2c01c4bbbeae6e36d1cb7effd37
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / esp8266 / pin.py
1 from microcontroller import Pin
2
3 GPIO0 = Pin(0)
4 GPIO1 = Pin(1)
5 GPIO2 = Pin(2)
6 GPIO3 = Pin(3)
7 GPIO4 = Pin(4)
8 GPIO5 = Pin(5)
9 GPIO12 = Pin(12)
10 GPIO13 = Pin(13)
11 GPIO14 = Pin(14)
12 GPIO15 = Pin(15)
13 GPIO16 = Pin(16)
14 TOUT = Pin("TOUT")
15 """
16 From introspection of microcontroller.pin on Feather Huzzah running CircuitPython
17 >>> dir(microcontroller.pin)
18 ['TOUT', 'XPD_DCDC', 'MTMS', 'MTDI', 'MTCK', 'MTDO', 'GPIO2', 'GPIO0', 'GPIO4', 'SD_DATA_2', 'SD_DATA_3', 'SD_CMD', 'SD_CLK', 'SD_DATA_0', 'SD_DATA_1', 'DVDD', 'U0RXD', 'U0TXD']
19 >>> dir(board)
20 ['ADC', 'GPIO16', 'GPIO14', 'SCK', 'GPIO12', 'MISO', 'GPIO13', 'MOSI', 'GPIO15', 'GPIO2', 'GPIO0', 'GPIO4', 'SDA', 'RX', 'TX', 'GPIO5', 'SCL']
21 """
22 """
23 class cpu():
24     def frequency(self):
25         from machine import freq
26         return freq()
27 """
28
29 # ordered as spiId, sckId, mosiId, misoId
30 spiPorts = ((1, GPIO14, GPIO13, GPIO12))
31
32 # ordered as uartId, txId, rxId
33 uartPorts = (
34     (0, GPIO1, GPIO3),
35     # (0, GPIO15, GPIO13) # TODO secondary pins for UART0 configurable from Micropython? How to flag?
36     (1, GPIO2, None))
37
38 i2cPorts = ()