Skip to content

Commit

Permalink
Add Orange Pi One and Orange Pi Lite (#30)
Browse files Browse the repository at this point in the history
* Add missing 13th PIN for Orange Pi PC
* Add Orange Pi One and Orange Pi Lite
* Replace tab with space
  • Loading branch information
StephenSorriaux authored and rm-hull committed Nov 10, 2018
1 parent 8af74e4 commit f8af08e
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
27 changes: 27 additions & 0 deletions orangepi/lite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Richard Hull & Contributors
# See LICENSE.md for details.

"""
Alternative pin mappings for Orange PI Lite
(see http://linux-sunxi.org/images/8/88/Orange_pi-lite-v1_1.pdf)
Usage:
.. code:: python
import orangepi.lite
from OPi import GPIO
GPIO.setmode(orangepi.lite.BOARD) or GPIO.setmode(orangepi.lite.BCM)
"""

# pin number = (position of letter in alphabet - 1) * 32 + pin number
# So, PD14 will be (4 - 1) * 32 + 14 = 110

import orangepi.pc

# Orange Pi One physical board pin to GPIO pin
BOARD = orangepi.pc.BOARD

# Orange Pi One BCM pin to actual GPIO pin
BCM = orangepi.pc.BCM
27 changes: 27 additions & 0 deletions orangepi/one.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Richard Hull & Contributors
# See LICENSE.md for details.

"""
Alternative pin mappings for Orange PI One
(see http://linux-sunxi.org/images/7/7e/ORANGE_PI-ONE-V1_1.pdf)
Usage:
.. code:: python
import orangepi.one
from OPi import GPIO
GPIO.setmode(orangepi.one.BOARD) or GPIO.setmode(orangepi.one.BCM)
"""

# pin number = (position of letter in alphabet - 1) * 32 + pin number
# So, PD14 will be (4 - 1) * 32 + 14 = 110

import orangepi.pc

# Orange Pi One physical board pin to GPIO pin
BOARD = orangepi.pc.BOARD

# Orange Pi One BCM pin to actual GPIO pin
BCM = orangepi.pc.BCM
2 changes: 2 additions & 0 deletions orangepi/pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
10: 14, # PA14 (SPI1_CLK/UART3_RX/PA_EINT14)
11: 1, # PA1 (UART2_RX/JTAG_CK/PA_EINT1)
12: 110, # PD14
13: 0, # PA0 (UART2_TX/JTAG_MS/PA_EINT0)
15: 3, # PA3 (UART2_CTS/JTAG_DI/PA_EINT3)
16: 68, # PC4
18: 71, # PC7
Expand Down Expand Up @@ -53,6 +54,7 @@
10: 14, # PA14 (SPI1_CLK/UART3_RX/PA_EINT14)
11: 1, # PA1 (UART2_RX/JTAG_CK/PA_EINT1)
12: 110, # PD14
13: 0, # PA0 (UART2_TX/JTAG_MS/PA_EINT0)
15: 3, # PA3 (UART2_CTS/JTAG_DI/PA_EINT3)
16: 68, # PC4
18: 71, # PC7
Expand Down

0 comments on commit f8af08e

Please sign in to comment.