Skip to content

Commit

Permalink
Merge pull request #853 from mmontol/main
Browse files Browse the repository at this point in the history
Add support for lubancat-5
  • Loading branch information
makermelissa authored Jun 18, 2024
2 parents 261df33 + 3649f08 commit ba75eff
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
77 changes: 77 additions & 0 deletions src/adafruit_blinka/board/lubancat/lubancat5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# SPDX-FileCopyrightText: 2024 mmontol
#
# SPDX-License-Identifier: MIT
"""Pin definitions for the LubanCat-5."""

from adafruit_blinka.microcontroller.rockchip.rk3588 import pin
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin

# GPIO1 = +3.3V
# GPIO2 = +5V
GPIO3 = pin.GPIO1_C0
# GPIO4 = +5V
GPIO5 = pin.GPIO1_C1
# GPIO6 = GND
GPIO7 = Pin((6, 0))
GPIO8 = pin.GPIO1_B6
# GPIO9 = GND
GPIO10 = pin.GPIO1_B7
GPIO11 = Pin((6, 1))
GPIO12 = Pin((6, 4))
GPIO13 = Pin((6, 2))
# GPIO14 = GND
GPIO15 = Pin((6, 3))
GPIO16 = Pin((6, 5))
# GPIO17 = +3.3V
GPIO18 = Pin((6, 6))
GPIO19 = pin.GPIO4_A1
# GPIO20 = GND
GPIO21 = pin.GPIO4_A0
GPIO22 = Pin((6, 7))
GPIO23 = pin.GPIO4_A2
GPIO24 = pin.GPIO4_B2
# GPIO25 = GND
GPIO26 = Pin((7, 5))
GPIO27 = pin.GPIO1_A2
GPIO28 = pin.GPIO1_A3
GPIO29 = pin.GPIO2_C3
# GPIO30 = GND
GPIO31 = Pin((7, 0))
GPIO32 = pin.GPIO4_B6
GPIO33 = pin.GPIO1_D6
# GPIO34 = GND
GPIO35 = pin.GPIO1_D7
GPIO36 = Pin((7, 4))
GPIO37 = Pin((7, 1))
GPIO38 = Pin((7, 3))
# GPIO39 = GND
GPIO40 = Pin((7, 2))

# I2C
I2C3_SCL = pin.I2C3_SCL_M0
I2C3_SDA = pin.I2C3_SDA_M0
I2C4_SCL = pin.I2C4_SCL_M3
I2C4_SDA = pin.I2C4_SDA_M3
I2C8_SCL = pin.I2C8_SCL_M2
I2C8_SDA = pin.I2C8_SDA_M2

# UART
UART1_TX = pin.UART1_TX_M1
UART1_RX = pin.UART1_RX_M1
UART3_TX = pin.UART3_TX_M0
UART3_RX = pin.UART3_RX_M0

# Default SPI
MOSI = pin.SPI0_MOSI_M1
MISO = pin.SPI0_MISO_M1
SCLK = pin.SPI0_SCLK_M1
CS0 = pin.SPI0_CS0_M1

# PWM
PWM0 = pin.PWM0_M2
PWM1 = pin.PWM1_M2
PWM13_M1 = pin.PWM13_M1
PWM13_M2 = pin.PWM13_M2
PWM14_M1 = pin.PWM14_M1
PWM14_M2 = pin.PWM14_M2
PWM15 = pin.PWM15_IR_M3
27 changes: 27 additions & 0 deletions src/adafruit_blinka/microcontroller/rockchip/rk3588/pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,14 @@
# UART
UART0_TX_M2 = GPIO4_A3
UART0_RX_M2 = GPIO4_A4
UART1_TX_M1 = GPIO1_B6
UART1_RX_M1 = GPIO1_B7
UART2_TX_M0 = GPIO0_B5
UART2_RX_M0 = GPIO0_B6
UART2_TX_M2 = GPIO3_B1
UART2_RX_M2 = GPIO3_B2
UART3_TX_M0 = GPIO1_C1
UART3_RX_M0 = GPIO1_C0
UART3_TX_M1 = GPIO3_B5
UART3_RX_M1 = GPIO3_B6
UART4_TX_M2 = GPIO1_B3
Expand All @@ -193,8 +197,10 @@
# ordered as uartId, txId, rxId
uartPorts = (
(0, UART0_TX_M2, UART0_RX_M2),
(1, UART1_TX_M1, UART1_RX_M1),
(2, UART2_TX_M0, UART2_RX_M0),
(2, UART2_TX_M2, UART2_RX_M2),
(3, UART3_TX_M0, UART3_RX_M0),
(3, UART3_TX_M1, UART3_RX_M1),
(4, UART4_TX_M2, UART4_RX_M2),
(7, UART7_TX_M1, UART7_RX_M1),
Expand All @@ -209,12 +215,18 @@
I2C1_SDA_M0 = GPIO0_B6
I2C1_SCL_M4 = GPIO1_B1
I2C1_SDA_M4 = GPIO1_B2
I2C3_SCL_M0 = GPIO1_C1
I2C3_SDA_M0 = GPIO1_C0
I2C3_SCL_M1 = GPIO3_B7
I2C3_SDA_M1 = GPIO3_C0
I2C4_SCL_M3 = GPIO1_A3
I2C4_SDA_M3 = GPIO1_A2
I2C6_SCL_M3 = GPIO4_B1
I2C6_SDA_M3 = GPIO4_B0
I2C7_SCL_M3 = GPIO4_B2
I2C7_SDA_M3 = GPIO4_B3
I2C8_SCL_M2 = GPIO1_D6
I2C8_SDA_M2 = GPIO1_D7
I2C8_SCL_M4 = GPIO3_C2
I2C8_SDA_M4 = GPIO3_C3
I2C5_SDA_M3 = GPIO1_B7
Expand All @@ -225,9 +237,12 @@
(0, I2C0_SCL_M1, I2C0_SDA_M1),
(1, I2C1_SCL_M0, I2C1_SDA_M0),
(1, I2C1_SCL_M4, I2C1_SDA_M4),
(3, I2C3_SCL_M0, I2C3_SDA_M0),
(3, I2C3_SCL_M1, I2C3_SDA_M1),
(4, I2C4_SCL_M3, I2C4_SDA_M3),
(5, I2C5_SCL_M3, I2C5_SDA_M3),
(7, I2C7_SCL_M3, I2C7_SDA_M3),
(8, I2C8_SCL_M2, I2C8_SDA_M2),
(8, I2C8_SCL_M4, I2C8_SDA_M4),
)

Expand All @@ -239,6 +254,11 @@
SPI0_CS0_M2 = GPIO1_B4
SPI0_CS1_M2 = GPIO1_B5

SPI0_MOSI_M1 = GPIO4_A1
SPI0_MISO_M1 = GPIO4_A0
SPI0_SCLK_M1 = GPIO4_A2
SPI0_CS0_M1 = GPIO4_B2

SPI1_MOSI_M1 = GPIO3_B7
SPI1_MISO_M1 = GPIO3_C0
SPI1_CLK_M1 = GPIO3_C1
Expand All @@ -259,12 +279,15 @@
# ordered as spiId, sckId, mosiId, misoId
spiPorts = (
(0, SPI0_SCLK_M2, SPI0_MOSI_M2, SPI0_MISO_M2),
(0, SPI0_SCLK_M1, SPI0_MOSI_M1, SPI0_MISO_M1),
(1, SPI1_SCLK_M1, SPI1_MOSI_M1, SPI1_MISO_M1),
(3, SPI3_SCLK_M0, SPI3_MOSI_M0, SPI3_MISO_M0),
(4, SPI4_SCLK_M0, SPI4_MOSI_M0, SPI4_MISO_M0),
)

# PWM
PWM0_M2 = GPIO1_A2
PWM1_M2 = GPIO1_A3
PWM2_M1 = GPIO3_B1
PWM3_IR_M1 = GPIO3_B2
PWM5_M2 = GPIO4_C4
Expand All @@ -274,6 +297,7 @@
PWM10_M2 = GPIO3_D3
PWM11_IR_M3 = GPIO3_D5
PWM12_M0 = GPIO3_B5
PWM13_M1 = GPIO4_B6
PWM13_M0 = GPIO3_B6
PWM13_M2 = GPIO1_B7
PWM14_M0 = GPIO3_C2
Expand All @@ -286,6 +310,8 @@

# SysFS pwm outputs, pwm channel and pin in first tuple
pwmOuts = (
((0, 0), PWM0_M2),
((0, 1), PWM1_M2),
((0, 2), PWM2_M1),
((0, 3), PWM3_IR_M1),
((0, 5), PWM5_M2),
Expand All @@ -296,6 +322,7 @@
((0, 11), PWM11_IR_M3),
((0, 12), PWM12_M0),
((0, 13), PWM13_M0),
((0, 13), PWM13_M1),
((0, 13), PWM13_M2),
((0, 14), PWM14_M0),
((0, 14), PWM14_M1),
Expand Down
3 changes: 3 additions & 0 deletions src/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@
elif board_id == ap_board.LUBANCAT4:
from adafruit_blinka.board.lubancat.lubancat4 import *

elif board_id == ap_board.LUBANCAT5:
from adafruit_blinka.board.lubancat.lubancat5 import *

elif board_id == ap_board.NANOPI_NEO_AIR:
from adafruit_blinka.board.nanopi.neoair import *

Expand Down

0 comments on commit ba75eff

Please sign in to comment.