On Sun, 17 Nov 2019 20:58:08 +0100, "R.Wieser"
declaimed the following:
>I do NOT want to do that with some "it works on my Pi, I don't care about
>the other boards or tomorrow" whipped up table. Hence my wish to have acces
>to those "internal tables" - or better yet, the conversion routine itself
>
There are NO internal tables... And no global conversion routine.
Tables and conversion are specific to the GPIO library one is using.
And... if you intend your code to be used by others (via import and
calling functions) you are going to have to document which library you are
using, and for those where it matters, which pin naming structure you
expect them to be using.
Again -- gpiozero SIMPLIFIES a lot of this... It accepts multiple
naming styles without locking the user into a single style. It accepts
multiple back-ends (RPi.GPIO, pigpio...). Set up your module on the basis
that the end-user should initialize gpiozero with their preferred back-end,
and everything else should be transparent. Any pins that are to be
controlled both within your module and by the end-user SHOULD be something
they provide to your module as an initialization. Any pins your module
dedicates should be documented so the end-user doesn't attempt to use them.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|