Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for I2C bus 0,1,2 that are missing for the OPI zero2W… #915

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/adafruit_blinka/microcontroller/allwinner/h616/pin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT

"""Allwinner H616 Pin Names"""
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin

Expand All @@ -9,8 +10,6 @@
label = f.read().strip()
if label == "300b000.pinctrl":
__chip_num = 0


PC0 = Pin((__chip_num, 64))
SPI0_SCLK = PC0
PC1 = Pin((__chip_num, 65))
Expand Down Expand Up @@ -90,25 +89,38 @@
PI3 = Pin((__chip_num, 259))
PI4 = Pin((__chip_num, 260))
PI5 = Pin((__chip_num, 261))
TWI0_SCL = PI5
PI6 = Pin((__chip_num, 262))
TWI0_SDA = PI6
PI7 = Pin((__chip_num, 263))
TWI1_SCL = PI7
PI8 = Pin((__chip_num, 264))
TWI1_SDA = PI8
PI9 = Pin((__chip_num, 265))
TWI2_SCL = PI9
PI10 = Pin((__chip_num, 266))
TWI2_SDA = PI10
PI11 = Pin((__chip_num, 267))
PI12 = Pin((__chip_num, 268))
PI13 = Pin((__chip_num, 269))
PI14 = Pin((__chip_num, 270))
PI15 = Pin((__chip_num, 271))
PI16 = Pin((__chip_num, 272))

i2cPorts = ((3, TWI3_SCL, TWI3_SDA),)
i2cPorts = (
(0, TWI0_SCL, TWI0_SDA),
(1, TWI1_SCL, TWI1_SDA),
(2, TWI2_SCL, TWI2_SDA),
(3, TWI3_SCL, TWI3_SDA),
)
# 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

uartPorts = (
(2, UART2_TX, UART2_RX),
(5, UART5_TX, UART5_RX),
Expand Down
Loading