]> Repositories - Adafruit_Blinka-hackapet.git/blob - src/adafruit_blinka/microcontroller/pentium/n3710/pin.py
added support for I2C bus 0,1,2 that where missing for the OPI zero2W implementation
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / pentium / n3710 / pin.py
1 # SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
2 #
3 # SPDX-License-Identifier: MIT
4 """Pentium N3710 (Braswell core SOC) pin names
5    i2c and GPIO can be accessed through Blinka.
6    For i2c use IC20_SCL, IC20-SDA and IC21-SCL, IC21-SDA in the i2c(<sdl, sda>) calls.
7    For UART use pyserial"""
8 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
9
10 # gpiochip3
11 GPIO_243 = Pin((3, 15))
12 GPIO_246 = Pin((3, 18))
13 GPIO_247 = Pin((3, 19))
14 GPIO_249 = Pin((3, 21))
15 GPIO_250 = Pin((3, 22))
16 GPIO_253 = Pin((3, 25))
17 GPIO_273 = Pin((3, 45))
18 GPIO_275 = Pin((3, 47))
19 GPIO_276 = Pin((3, 48))
20 GPIO_278 = Pin((3, 50))
21 GPIO_279 = Pin((3, 51))
22 GPIO_280 = Pin((3, 52))
23 GPIO_307 = Pin((3, 79))
24
25 SDIO_D3 = SDMMC2_D3 = GPIO_243
26 SDIO_DI = SDMMC2_D1 = GPIO_246
27 SDIO_CLK = SDMMC2_CLK = GPIO_247
28 SDIO_D2 = SDMMC2_D2 = GPIO_249
29 SDIO_CMD = SDMMC2_CMD = GPIO_250
30 SDIO_D0 = SDMMC2_D0 = GPIO_253
31
32 MF_LPC_AD2 = GPIO_273
33 MF_LPC_AD0 = GPIO_275
34 LPC_FRAMEB = GPIO_276
35 MF_LPC_AD3 = GPIO_278
36 MF_LPC_CLKOUT0 = GPIO_279
37 MF_LPC_AD1 = GPIO_280
38 ILB_SERIRQ = GPIO_307
39
40 # ggpiochip1
41 GPIO_358 = Pin((1, 17))
42 GPIO_SUS3 = SDIO_WAKE = GPIO_358
43
44
45 # gpiochip0
46 GPIO_490 = Pin((0, 76))
47 GPIO_492 = Pin((0, 78))
48
49 SATA_GP1 = TS_INT = GPIO_490
50 SATA_GP2 = TS_RST = GPIO_492
51
52
53 # not general gpio on chip 0
54 # use pyserial not blinka.  These are only included for completeness
55
56 UART1_RXD = Pin((0, 16))
57 UART1_TXD = Pin((0, 20))
58 UART1_RTS = Pin((0, 15))
59 UART1_CTS = Pin((0, 18))
60
61 UART2_RXD = Pin((0, 17))
62 UART2_TXD = Pin((0, 21))
63 UART2_RTS = Pin((0, 19))
64 UART2_CTS = Pin((0, 22))
65
66 GPIO_429 = UART1_RTS
67 GPIO_430 = UART1_RXD
68 GPIO_431 = UART2_RXD
69 GPIO_432 = UART1_CTS
70 GPIO_434 = UART1_TXD
71 GPIO_435 = UART2_TXD
72 GPIO_436 = UART2_CTS
73
74 # i2c use these addresses when accessing i2c from Blinka.  You can also access
75 # the i2c useing smbus
76 I2C0_SDA = Pin((0, 61))  # IC21 on diagram, port 0 in hardware manual
77 I2C0_SCL = Pin((0, 65))
78
79 I2C1_SDA = TS_I2C_SDA = Pin((0, 45))  # I2C2 on diagram, port 5 in hardware manual
80 I2C1_SCL = TS_I2C_SCL = Pin((0, 48))
81
82
83 GPIO_469 = I2C1_SDA  # I2C2 on diagram
84 GPIO_472 = I2C1_SCL
85 GPIO_475 = I2C0_SDA  # I2C1 on diagram
86 GPIO_479 = I2C0_SCL
87
88 # ordered as i2cId, sclId, sdaId
89 i2cPorts = ((0, I2C0_SCL, I2C0_SDA), (1, I2C1_SCL, I2C1_SDA))