]> Repositories - Adafruit_Blinka-hackapet.git/blob - src/adafruit_blinka/microcontroller/raspi_23/pin.py
matches other boards nicer
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / raspi_23 / pin.py
1 # Pins dont exist in CPython so...lets make our own!
2 class Pin:
3     def __init__(self, name, bcm_number):
4         self._name = name
5         self._number = bcm_number
6
7 SDA = Pin("SDA/D2", 2)
8 SCL = Pin("SCL/D3", 3)
9 D2 = Pin("SDA/D2", 2)
10 D3 = Pin("SCL/D3", 3)
11 D4 = Pin("BCM 4", 4)
12 D9 = Pin("MISO/D9", 9)
13 D10 = Pin("MOSI/D10", 10)
14 D11 = Pin("SCLK/D11", 11)
15 MISO = Pin("MISO/D9", 9)
16 MOSI = Pin("MOSI/D10", 10)
17 SCLK = Pin("SCLK/D11", 11)
18 D14 = Pin("TXD/D14", 14)
19 D15 = Pin("RXD/D15", 15)
20 TXD = Pin("TXD/D14", 14)
21 RXD = Pin("RXD/D15", 15)
22 D17 = Pin("BCM 17", 17)
23 D18 = Pin("BCM 18", 18)
24 D19 = Pin("BCM 19", 19)
25 D20 = Pin("BCM 20", 20)
26 MISO_2 = Pin("MISO_2/19", 19)
27 MOSI_2 = Pin("MOSI_2/20", 20)
28 SCLK_2 = Pin("SCLK_2/21", 21)
29 D21 = Pin("BCM 21", 21)
30 D22 = Pin("BCM 22", 22)
31 D23 = Pin("BCM 23", 23)
32 D24 = Pin("BCM 24", 24)
33 D27 = Pin("BCM 27", 27)
34
35 # ordered as spiId, sckId, mosiId, misoId
36 spiPorts = ((1, SCLK, MOSI, MISO), (2, SCLK_2, MOSI_2, MISO_2))
37
38 # ordered as uartId, txId, rxId
39 uartPorts = (
40     (1, TXD, RXD),
41 )
42
43 i2cPorts = (
44     (1, SDA, SCL),
45 )
46