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

NanoPi Duo pin mappings added #20

Merged
merged 9 commits into from
Jan 1, 2018
Merged
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
1 change: 1 addition & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ The source code is available to clone at: https://github.com/rm-hull/OPi.GPIO
Contributors
^^^^^^^^^^^^
* Simon Rowe (@srowe)
* Steven P. Goldsmith (@sgjava)
Empty file added nanopi/__init__.py
Empty file.
49 changes: 49 additions & 0 deletions nanopi/duo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Richard Hull & Contributors
# See LICENSE.md for details.

"""
Alternative pin mappings for NanoPi DUO board with/without Mini Shield (see
http://wiki.friendlyarm.com/wiki/index.php/NanoPi_Duo#Layout)

Usage:

.. code:: python
import nanopi.duo
from OPi import GPIO

GPIO.setmode(nanopi.duo.BOARD)
"""

BOARD = {
3: 12, # I2C0_SDA/GPIOA12
5: 11, # I2C0_SCL/GPIOA11
7: 203, # GPIOG11
8: 198, # UART1_TX/GPIOG6
10: 199, # UART1_RX/GPIOG7
11: 5, # DEBUG_RX(UART_RXD0)/GPIOA5/PWM0
12: 363, # GPIOL11/IR-RX
13: 4, # DEBUG_TX(UART_TXD0)/GPIOA4
19: 15, # UART3_RTS/SPI1_MOSI/GPIOA15
21: 16, # UART3_CTS/SPI1_MISO/GPIOA16
23: 14, # UART3_RX/SPI1_CLK/GPIOA14
24: 13, # UART3_TX/SPI1_CS/GPIOA13
41: 355 # Button
}

# NanoPi Duo BCM pin to actual GPIO pin
BCM = {
2: 12, # I2C0_SDA/GPIOA12
3: 11, # I2C0_SCL/GPIOA11
4: 203, # GPIOG11
8: 13, # UART3_TX/SPI1_CS/GPIOA13
9: 16, # UART3_CTS/SPI1_MISO/GPIOA16
10: 15, # UART3_RTS/SPI1_MOSI/GPIOA15
11: 14, # UART3_RX/SPI1_CLK/GPIOA14
14: 198, # UART1_TX/GPIOG6
15: 199, # UART1_RX/GPIOG7
17: 5, # DEBUG_RX(UART_RXD0)/GPIOA5/PWM0
18: 363, # GPIOL11/IR-RX
27: 4, # DEBUG_TX(UART_TXD0)/GPIOA4
41: 355 # Button
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def read_file(fname):
keywords="orange pi opi gpio",
url="https://github.com/rm-hull/OPi.GPIO",
download_url="https://github.com/rm-hull/OPi.GPIO/tarball/" + version,
packages=["OPi"],
packages=["OPi", "nanopi"],
setup_requires=pytest_runner,
tests_require=test_deps,
extras_require={
Expand Down