rm-hull / OPi.GPIO

RPi.GPIO drop-in replacement library for Orange Pi Zero and other SBCs
https://opi-gpio.readthedocs.io/
MIT License
184 stars 99 forks source link

Question not a bug... Need help on making this work on a Libre "Le Potato " #67

Open Snakn1 opened 2 years ago

Snakn1 commented 2 years ago

I am sorry I am reading though everything and this is just what I need to migrate my weather station from a Pi to a non-pi board. (price of a pi is out of control) I am using the Libre Le Potato. Below is the info I have on the BD. I need help to create the pin_mapping for this non-pi bd. Is there anyone that can help or point me in the correct direction?

gpoi info.txt

AML-S905X-CC-V1.0A Headers.xlsx

Snakn1 commented 2 years ago

hello all. I created a lep.py and put it in the /usr/local/lib/python3.10/dist-packages/libre/

here is the code if this helps anyone:

-- coding: utf-8 --

Copyright (c) 2018 Richard Hull & Contributors

See LICENSE.md for details.

modified by B-Wigton 09-16-2022 to add libre Lepotato

""" Alternative pin mappings for Libre Le Potato (see https://docs.google.com/spreadsheets/d/1U3z0Gb8HUEfCIMkvqzmhMpJfzRqjPXq7mFLC-hvbKlE/edit?usp=sharing)

Usage:

.. code:: python import libre.lep from OPi import GPIO

GPIO.setmode(libre.lep.BOARD) or GPIO.setmode(libre.lep.BCM) """

Libre LePotato physical board pin to GPIO pin

BOARD = { 3: 5, 5: 4, 7: 98, 8: 91, 10: 92, 11: 8, 12: 6, 13: 9, 15: 10, 16: 93, 18: 94, 19: 87, 21: 88, 22: 79, 23: 90, 24: 89, 26: 80, 27: 75, 28: 76, 29: 96, 31: 97, 32: 95, 33: 85, 35: 86, 36: 81, 37: 84, 38: 82, 40: 83, }

No reason for BCM mapping, keeping it for compatibility

BCM = BOARD