]> Repositories - Adafruit_Blinka-hackapet.git/blob - src/adafruit_blinka/microcontroller/allwinner/a20/pin.py
Update in line with latest Adafruit_Blinka repo
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / allwinner / a20 / pin.py
1 # SPDX-FileCopyrightText: 2023 Xenokrates
2 #
3 # SPDX-License-Identifier: MIT
4 """Allwinner A20 pin names"""
5 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
6
7 # Pin descriptions at https://linux-sunxi.org/A20/PIO
8
9 PA0 = Pin(0)
10 PA1 = Pin(1)
11 PA2 = Pin(2)
12 UART2_TX = PA2
13 PA3 = Pin(3)
14 UART2_RX = PA3
15 PA6 = Pin(6)
16 PA7 = Pin(7)
17 PA8 = Pin(8)
18 PA9 = Pin(9)
19 PA10 = Pin(10)
20 UART1_TX = PA10
21 PA11 = Pin(11)
22 UART1_RX = PA11
23 PA12 = Pin(12)
24 PA13 = Pin(13)
25 PA14 = Pin(14)
26 PA15 = Pin(15)
27 PA16 = Pin(16)
28 PA17 = Pin(17)
29
30 PB0 = Pin(32)
31 TWI0_SCK = PB0
32 PB1 = Pin(33)
33 TWI0_SDA = PB1
34 PB2 = Pin(34)
35 PB3 = Pin(35)
36 IR0_TX = PB3
37 PB4 = Pin(36)
38 IR0_RX = PB4
39 PB5 = Pin(37)
40 PB6 = Pin(38)
41 PB7 = Pin(39)
42 PB8 = Pin(40)
43 PB12 = Pin(44)
44 PB13 = Pin(45)
45 PB18 = Pin(50)
46 TWI1_SCK = PB18
47 PB19 = Pin(51)
48 TWI1_SDA = PB19
49 PB20 = Pin(52)
50 TWI2_SCK = PB20
51 PB21 = Pin(53)
52 TWI2_SDA = PB21
53 PB22 = Pin(54)
54 UART0_TX = PB22
55 PB23 = Pin(55)
56 UART0_RX = PB23
57
58 PG2 = Pin(194)
59
60 PH2 = Pin(226)
61 PH4 = Pin(228)
62 UART4_TX = PH4
63 PH5 = Pin(229)
64 UART4_RX = PH5
65 PH20 = Pin(244)
66 CAN_TX = PH20
67 PH21 = Pin(245)
68 CAN_RX = PH21
69 PH24 = Pin(248)
70
71 PI0 = Pin(256)
72 TWI3_SCK = PI0
73 PI1 = Pin(257)
74 TWI3_SDA = PI1
75 PI3 = Pin(259)
76 PWM1 = PI3
77 PI10 = Pin(266)
78 SPI0_CS0 = PI10
79 PI11 = Pin(267)
80 SPI0_SCLK = PI11
81 PI12 = Pin(268)
82 SPI0_MOSI = PI12
83 PI13 = Pin(269)
84 SPI0_MISO = PI13
85 PI14 = Pin(270)
86 SPI0_CS1 = PI14
87 PI16 = Pin(272)
88 UART2_RTS = PI16
89 PI17 = Pin(273)
90 UART2_CTS = PI17
91 PI18 = Pin(274)
92 UART2_TX = PI18
93 PI19 = Pin(275)
94 UART2_RX = PI19
95 PI20 = Pin(276)
96 UART7_TX = PI20
97 PI21 = Pin(277)
98 UART7_RX = PI21
99
100 # SysFS pwm outputs, pwm channel and pin in first tuple
101 pwmOuts = (((0, 1), PWM1),)
102 # ordered as i2cId, sclId, sdaId
103 i2cPorts = (
104     (0, TWI0_SCK, TWI0_SDA),
105     (1, TWI1_SCK, TWI1_SDA),
106     (2, TWI2_SCK, TWI2_SDA),
107 )
108 # ordered as spiId, sckId, mosiId, misoId
109 spiPorts = ((0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),)
110 # ordered as uartId, txId, rxId
111 uartPorts = (
112     (0, UART0_TX, UART0_RX),
113     (2, UART2_TX, UART2_RX),
114     (4, UART4_TX, UART4_RX),
115     (7, UART7_TX, UART7_RX),
116 )