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

Add Orange Pi 5 and Orange Pi 5B Pin Mappings #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ChangeLog
+------------+---------------------------------------------------------------------+------------+
| Version | Description | Date |
+============+=====================================================================+============+
| **0.5.3** | * Add pin mappings for Orange Pi 5 and Orange Pi 5B | 2024/03/06 |
+------------+---------------------------------------------------------------------+------------+
| **0.5.3** | * Add pin mappings for Radxa Zero | 2022/06/20 |
| | * Added OrangePi Zero2 pin mappings | |
+------------+---------------------------------------------------------------------+------------+
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Contributors
* Michael Still (@mikalstill)
* Pascal Roeleven (@pascallj)
* Igor Pitsyn (@ipitsyn)
* Nick Rupert, Tyrannosaurus Tech (@nickrupert7)
39 changes: 39 additions & 0 deletions orangepi/pi5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Richard Hull & Contributors
# See LICENSE.md for details.

"""
Alternative pin mappings for Orange PI 5

Usage:

.. code:: python
from orangepi import pi5
from OPi import GPIO

GPIO.setmode(pi5.BOARD) or GPIO.setmode(pi5.BCM)
"""

# Orange Pi 5B physical board pin to GPIO pin
BOARD = {
3: 47, # GPIO1_B7 PWM13_M2 UART1_RX_M1 I2C5_SDA_M3
5: 46, # GPIO1_B6 UART1_TX_M1 I2C5_SCL_M3
7: 54, # GPIO1_C6 PWM15_IR_M2
8: 131, # GPIO4_A3 UART0_TX_M2
10: 132, # GPIO4_A4 UART0_RX_M2
11: 138, # GPIO4_B2 PWM14_M1 CAN1_RX_M1
12: 29, # GPIO0_D5 CAN2_TX_M1
13: 139, # GPIO4_B3 CAN1_TX_M1
15: 28, # GPIO0_D4 PWM3_IR_M0 CAN2_RX_M1
16: 59, # GPIO1_D3 UART4_RX_M0 I2C1_SDA_M4
18: 58, # GPIO1_D2 UART4_TX_M0 I2C1_SCL_M4 PWM0_M1
19: 49, # GPIO1_C1 I2C3_SCL_M0 UART3_TX_M0 SPI4_MOSI_M0
21: 48, # GPIO1_C0 I2C3_SDA_M0 UART3_RX_M0 SPI4_MISO_M0
22: 92, # GPIO2_D4
23: 50, # GPIO1_C2 SPI4_CLK_M0
24: 52, # GPIO1_C4 SPI4_CS1_M0
26: 35, # GPIO1_A3 PWM1_M2
}

# No reason for BCM mapping, keeping it for compatibility
BCM = BOARD
23 changes: 23 additions & 0 deletions orangepi/pi5B.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Richard Hull & Contributors
# See LICENSE.md for details.

"""
Alternative pin mappings for Orange PI 5B

Usage:

.. code:: python
from orangepi import pi5B
from OPi import GPIO

GPIO.setmode(pi5B.BOARD) or GPIO.setmode(pi5B.BCM)
"""

from orangepi import pi5

# Orange Pi 5B physical board pin to GPIO pin
BOARD = pi5.BOARD

# No reason for BCM mapping, keeping it for compatibility
BCM = pi5.BCM