-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #642 from mmontol/main
Add support for Lubancat2
- Loading branch information
Showing
8 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# SPDX-FileCopyrightText: 2023 mmontol | ||
# | ||
# SPDX-License-Identifier: MIT | ||
"""Pin definitions for the LubanCat2.""" | ||
|
||
from adafruit_blinka.microcontroller.rockchip.rk3568 import pin | ||
|
||
# lbancat2 board 40-pin J5: | ||
# -------------------------- | ||
# 3V3 | (1) (2) | 5V | ||
# GPIO3 | (3) (4) | 5V | ||
# GPIO5 | (5) (6) | GND | ||
# GPIO7 | (7) (8) | GPIO8 | ||
# GND | (9) (10) | GPIO10 | ||
# ....................... # | ||
# ....................... # | ||
# GPIO33| (33) (34) | GND | ||
# GPIO35| (35) (36) | GPIO36 | ||
# GPIO37| (37) (38) | GPIO38 | ||
# GND | (39) (40) | GPIO40 | ||
# -------------------------- | ||
|
||
GPIO3 = pin.GPIO1_A0 | ||
GPIO5 = pin.GPIO1_A1 | ||
GPIO7 = pin.GPIO0_B0 | ||
GPIO8 = pin.GPIO3_B7 | ||
GPIO10 = pin.GPIO3_C0 | ||
GPIO11 = pin.GPIO3_A5 | ||
GPIO12 = pin.GPIO3_B1 | ||
GPIO13 = pin.GPIO3_A6 | ||
GPIO15 = pin.GPIO3_A7 | ||
GPIO16 = pin.GPIO2_D7 | ||
GPIO18 = pin.GPIO3_A0 | ||
GPIO19 = pin.GPIO4_C3 | ||
GPIO21 = pin.GPIO4_C5 | ||
GPIO22 = pin.GPIO0_C2 | ||
GPIO23 = pin.GPIO4_C2 | ||
GPIO24 = pin.GPIO4_C6 | ||
GPIO26 = pin.GPIO4_C4 | ||
GPIO27 = pin.GPIO3_B4 | ||
GPIO28 = pin.GPIO3_B3 | ||
GPIO29 = pin.GPIO4_D2 | ||
GPIO31 = pin.GPIO3_B6 | ||
GPIO32 = pin.GPIO3_B2 | ||
GPIO33 = pin.GPIO3_B5 | ||
GPIO35 = pin.GPIO3_C4 | ||
GPIO36 = pin.GPIO1_B0 | ||
GPIO37 = pin.GPIO3_C5 | ||
GPIO38 = pin.GPIO1_B1 | ||
GPIO40 = pin.GPIO1_B2 | ||
|
||
# I2C | ||
I2C3_SDA = pin.I2C3_SDA_M0 | ||
I2C3_SCL = pin.I2C3_SCL_M0 | ||
I2C5_SCL = pin.I2C5_SCL_M0 | ||
I2C5_SDA = pin.I2C5_SDA_M0 | ||
|
||
# UART | ||
UART3_TX = pin.UART3_TX_M1 | ||
UART3_RX = pin.UART3_RX_M1 | ||
|
||
# SPI | ||
MOSI = pin.SPI3_MOSI_M1 | ||
MISO = pin.SPI3_MISO_M1 | ||
SCLK = pin.SPI3_CLK_M1 | ||
CS0 = pin.GPIO4_C6 | ||
CS1 = pin.GPIO4_C4 | ||
|
||
# PWM | ||
PWM8 = pin.PWM8_M0 | ||
PWM9 = pin.PWM9_M0 | ||
PWM10 = pin.PWM10_M0 | ||
PWM14 = pin.PWM14_M0 |
Empty file.
86 changes: 86 additions & 0 deletions
86
src/adafruit_blinka/microcontroller/rockchip/rk3568/pin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# SPDX-FileCopyrightText: 2023 mmontol | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
"""A Pin class for use with Rockchip RK3568.""" | ||
|
||
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin | ||
|
||
# GPIO0 | ||
GPIO0_B0 = Pin((0, 8)) | ||
GPIO0_C2 = Pin((0, 18)) | ||
|
||
# GPIO1 | ||
GPIO1_A0 = Pin((1, 0)) | ||
GPIO1_A1 = Pin((1, 1)) | ||
GPIO1_B0 = Pin((1, 8)) | ||
GPIO1_B1 = Pin((1, 9)) | ||
GPIO1_B2 = Pin((1, 10)) | ||
|
||
# GPIO2 | ||
GPIO2_D7 = Pin((2, 31)) | ||
|
||
# GPIO3 | ||
GPIO3_A0 = Pin((3, 0)) | ||
GPIO3_A5 = Pin((3, 5)) | ||
GPIO3_A6 = Pin((3, 6)) | ||
GPIO3_A7 = Pin((3, 7)) | ||
GPIO3_B1 = Pin((3, 9)) | ||
GPIO3_B2 = Pin((3, 10)) | ||
GPIO3_B3 = Pin((3, 11)) | ||
GPIO3_B4 = Pin((3, 12)) | ||
GPIO3_B5 = Pin((3, 13)) | ||
GPIO3_B6 = Pin((3, 14)) | ||
GPIO3_B7 = Pin((3, 15)) | ||
GPIO3_C0 = Pin((3, 16)) | ||
GPIO3_C4 = Pin((3, 20)) | ||
GPIO3_C5 = Pin((3, 21)) | ||
|
||
# GPIO4 | ||
GPIO4_C2 = Pin((4, 18)) | ||
GPIO4_C3 = Pin((4, 19)) | ||
GPIO4_C4 = Pin((4, 20)) | ||
GPIO4_C5 = Pin((4, 21)) | ||
GPIO4_C6 = Pin((4, 22)) | ||
GPIO4_D2 = Pin((4, 26)) | ||
|
||
# I2C | ||
I2C3_SCL_M0 = GPIO1_A1 | ||
I2C3_SDA_M0 = GPIO1_A0 | ||
I2C5_SCL_M0 = GPIO3_B3 | ||
I2C5_SDA_M0 = GPIO3_B4 | ||
|
||
# SPI | ||
SPI3_CS0_M1 = GPIO4_C6 | ||
SPI3_CLK_M1 = GPIO4_C2 | ||
SPI3_MISO_M1 = GPIO4_C5 | ||
SPI3_MOSI_M1 = GPIO4_C3 | ||
|
||
# UART | ||
UART3_TX_M1 = GPIO3_B7 | ||
UART3_RX_M1 = GPIO3_C0 | ||
|
||
# PWM | ||
PWM8_M0 = GPIO3_B1 | ||
PWM9_M0 = GPIO3_B2 | ||
PWM10_M0 = GPIO3_B5 | ||
PWM14_M0 = GPIO3_C4 | ||
|
||
# ordered as i2cId, SCL, SDA | ||
i2cPorts = ( | ||
(3, I2C3_SCL_M0, I2C3_SDA_M0), | ||
(5, I2C5_SCL_M0, I2C5_SDA_M0), | ||
) | ||
|
||
# ordered as spiId, sckId, mosiId, misoId | ||
spiPorts = ((3, SPI3_CLK_M1, SPI3_MOSI_M1, SPI3_MISO_M1),) | ||
|
||
# SysFS pwm outputs, pwm channel and pin in first tuple | ||
pwmOuts = ( | ||
((1, 0), PWM8_M0), | ||
((1, 0), PWM9_M0), | ||
((1, 0), PWM10_M0), | ||
((1, 0), PWM14_M0), | ||
) | ||
|
||
# SysFS analog inputs, Ordered as analog analogInId, device, and channel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters