From: Melissa LeBlanc-Williams Date: Fri, 10 Jan 2020 00:38:30 +0000 (-0800) Subject: Added Pine64 Board and fixed Pin Definitions X-Git-Tag: 3.4.0^2^2 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/a774d91cacdf0164f6b38100b6e4019363312bb5 Added Pine64 Board and fixed Pin Definitions --- diff --git a/src/adafruit_blinka/board/pine64.py b/src/adafruit_blinka/board/pine64.py new file mode 100644 index 0000000..51f628a --- /dev/null +++ b/src/adafruit_blinka/board/pine64.py @@ -0,0 +1,44 @@ +"""Pin definitions for the Pine64.""" + +from adafruit_blinka.microcontroller.allwinner.a64 import pin + +GPIO_2 = pin.PH3 +GPIO_3 = pin.PH2 +GPIO_4 = pin.PL10 +GPIO_5 = pin.PH5 +GPIO_6 = pin.PH6 +GPIO_7 = pin.PH7 +GPIO_8 = pin.PC3 +GPIO_9 = pin.PC1 +GPIO_10 = pin.PC0 +GPIO_11 = pin.PC2 +GPIO_12 = pin.PC4 +GPIO_13 = pin.PC5 +GPIO_14 = pin.PB0 +GPIO_15 = pin.PB1 +GPIO_16 = pin.PC6 +GPIO_17 = pin.PC7 +GPIO_18 = pin.PC8 +GPIO_19 = pin.PC9 +GPIO_20 = pin.PC10 +GPIO_21 = pin.PC11 +GPIO_22 = pin.PC12 +GPIO_23 = pin.PC13 +GPIO_24 = pin.PC14 +GPIO_25 = pin.PC15 +GPIO_26 = pin.PC16 +GPIO_27 = pin.PH9 + +SDA = GPIO_2 +SCL = GPIO_3 + +SCL2 = pin.PL8 +SDA2 = pin.PL9 + +SCLK = GPIO_11 +MOSI = GPIO_10 +MISO = GPIO_9 +CS = GPIO_8 + +UART_TX = GPIO_14 +UART_RX = GPIO_15 diff --git a/src/adafruit_blinka/microcontroller/allwinner/a64/pin.py b/src/adafruit_blinka/microcontroller/allwinner/a64/pin.py index 0ecf2f2..66f44d6 100644 --- a/src/adafruit_blinka/microcontroller/allwinner/a64/pin.py +++ b/src/adafruit_blinka/microcontroller/allwinner/a64/pin.py @@ -1,51 +1,75 @@ from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin -PB0 = Pin(32) +PB0 = Pin((1, 32)) UART2_TX = PB0 -PB1 = Pin(33) +PB1 = Pin((1, 33)) UART2_RX = PB1 -PB2 = Pin(34) -PB3 = Pin(35) -PB4 = Pin(36) -PB5 = Pin(37) -PB6 = Pin(38) -PB7 = Pin(39) +PB2 = Pin((1, 34)) +PB3 = Pin((1, 35)) +PB4 = Pin((1, 36)) +PB5 = Pin((1, 37)) +PB6 = Pin((1, 38)) +PB7 = Pin((1, 39)) -PC4 = Pin(68) +PC0 = Pin((1, 64)) +SPI0_MOSI = PC0 +PC1 = Pin((1, 65)) +SPI0_MISO = PC1 +PC2 = Pin((1, 66)) +SPI0_SCLK = PC2 +PC3 = Pin((1, 67)) +SPI0_CS = PC3 +PC4 = Pin((1, 68)) +PC5 = Pin((1, 69)) +PC6 = Pin((1, 70)) +PC7 = Pin((1, 71)) +PC8 = Pin((1, 72)) +PC9 = Pin((1, 73)) +PC10 = Pin((1, 74)) +PC11 = Pin((1, 75)) +PC12 = Pin((1, 76)) +PC13 = Pin((1, 77)) +PC14 = Pin((1, 78)) +PC15 = Pin((1, 79)) +PC16 = Pin((1, 80)) -PD0 = Pin(96) +PD0 = Pin((1, 96)) UART3_TX = PD0 SPI1_CS = PD0 -PD1 = Pin(97) +PD1 = Pin((1, 97)) SPI1_SCLK = PD1 UART3_RX = PD1 -PD2 = Pin(98) +PD2 = Pin((1, 98)) UART4_TX = PD2 SPI1_MOSI = PD2 -PD3 = Pin(99) +PD3 = Pin((1, 99)) UART4_RX = PD3 SPI1_MISO = PD3 -PD4 = Pin(100) -PD5 = Pin(101) -PD6 = Pin(102) +PD4 = Pin((1, 100)) +PD5 = Pin((1, 101)) +PD6 = Pin((1, 102)) -PE14 = Pin(142) +PE14 = Pin((1, 142)) TWI2_SCL = PE14 -PE15 = Pin(143) +PE15 = Pin((1, 143)) TWI2_SDA = PE15 -PH2 = Pin(226) +PH2 = Pin((1, 226)) TWI1_SCL = PH2 -PH3 = Pin(227) +PH3 = Pin((1, 227)) TWI1_SDA = PH3 -PH4 = Pin(228) -PH5 = Pin(229) -PH6 = Pin(230) +PH4 = Pin((1, 228)) +PH5 = Pin((1, 229)) +PH6 = Pin((1, 230)) +PH7 = Pin((1, 231)) +PH8 = Pin((1, 232)) +PH9 = Pin((1, 233)) -PL2 = Pin(354) -PL3 = Pin(355) -PL9 = Pin(361) -PL10 = Pin(362) +PL2 = Pin((0, 2)) +PL3 = Pin((0, 3)) +PL8 = Pin((0, 8)) +PL9 = Pin((0, 9)) +PL10 = Pin((0, 10)) # ordered as i2cId, sclId, sdaId i2cPorts = ( @@ -55,6 +79,7 @@ i2cPorts = ( # ordered as spiId, sckId, mosiId, misoId spiPorts = ( + (0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO), (1, SPI1_SCLK, SPI1_MOSI, SPI1_MISO), ) # ordered as uartId, txId, rxId diff --git a/src/board.py b/src/board.py index c9fac91..efa89ad 100755 --- a/src/board.py +++ b/src/board.py @@ -112,6 +112,9 @@ elif board_id == ap_board.BINHO_NOVA: elif board_id == ap_board.MICROCHIP_MCP2221: from adafruit_blinka.board.microchip_mcp2221 import * +elif board_id == ap_board.PINE64: + from adafruit_blinka.board.pine64 import * + elif "sphinx" in sys.modules: pass diff --git a/src/busio.py b/src/busio.py index 5439745..3e85335 100755 --- a/src/busio.py +++ b/src/busio.py @@ -156,6 +156,9 @@ class SPI(Lockable): elif board_id == ap_board.JETSON_XAVIER: from adafruit_blinka.microcontroller.generic_linux.spi import SPI as _SPI from adafruit_blinka.microcontroller.tegra.t194.pin import Pin + elif board_id == ap_board.PINE64: + from adafruit_blinka.microcontroller.generic_linux.spi import SPI as _SPI + from adafruit_blinka.microcontroller.allwinner.a64.pin import Pin elif detector.board.ftdi_ft232h: from adafruit_blinka.microcontroller.ft232h.spi import SPI as _SPI from adafruit_blinka.microcontroller.ft232h.pin import Pin diff --git a/src/digitalio.py b/src/digitalio.py index 6795b56..51c729e 100755 --- a/src/digitalio.py +++ b/src/digitalio.py @@ -33,6 +33,8 @@ elif detector.chip.APQ8016: from adafruit_blinka.microcontroller.snapdragon.apq8016.pin import Pin elif detector.chip.IMX8MX: from adafruit_blinka.microcontroller.nxp_imx8m.pin import Pin +elif detector.chip.A64: + from adafruit_blinka.microcontroller.allwinner.a64.pin import Pin elif detector.board.ftdi_ft232h: from adafruit_blinka.microcontroller.ft232h.pin import Pin elif detector.board.binho_nova: @@ -41,8 +43,6 @@ elif detector.chip.STM32: from machine import Pin elif detector.board.microchip_mcp2221: from adafruit_blinka.microcontroller.mcp2221.pin import Pin -elif detector.board.pine64 or detector.board.pinebook or detector.board.pinephone: - from adafruit_blinka.microcontroller.allwinner.a64.pin import Pin from adafruit_blinka import Enum, ContextManaged class DriveMode(Enum): diff --git a/src/microcontroller/__init__.py b/src/microcontroller/__init__.py index 5bef237..4f5973f 100755 --- a/src/microcontroller/__init__.py +++ b/src/microcontroller/__init__.py @@ -48,6 +48,8 @@ elif chip_id == ap_chip.S922X: from adafruit_blinka.microcontroller.amlogic.s922x.pin import * elif chip_id == ap_chip.APQ8016: from adafruit_blinka.microcontroller.snapdragon.apq8016.pin import * +elif chip_id == ap_chip.A64: + from adafruit_blinka.microcontroller.allwinner.a64.pin import * elif chip_id == ap_chip.IMX8MX: from adafruit_blinka.microcontroller.nxp_imx8m import * elif chip_id == ap_chip.BINHO: