Sensus library
#4
(10-02-2017, 08:08 AM)Artyom Wrote:
(10-02-2017, 12:17 AM)MarkHaysHarris777 Wrote:
(10-01-2017, 10:44 AM)Artyom Wrote: Who can provide information (somethig like GPIO24 - Physical pin 3)?
Who is ready to test (Need work Linux, 1 LED, 1 resistor)?


Artyom:  please see this thread posts #1 thru #5 particularly.

Several scripts have been provided in that thread;  please review all of them.   In particular you may find the script called  name2gpio.sh  to be helpful for you.  Use the pinout chart to associate the physical pin to the pad name|number, and then use  name2gpio.sh  to convert the pad nam|num to the gpio#.

I can answer questions for you here, or you may contact me on the IRC (see addy below) and we can talk live;

Shy

Hi. As you can see here https://github.com/blademoon/sensus-libr...s_gpio.cpp (int gpio_calculate_pin_number (int pin_number)) I do not use different kinds of calculations to get the port number. I use a direct mapping - the port number to the physical pin number.
I think that this is whiter than a simple and quick method. Although I'm ready to listen to constructive criticism.


hi Artyom,  there is no such thing as direct mapping ( unless of course your plan is to introduce human mapping errors ).  There are not "different kinds of calculations" ;  there is only ONE calculation that works and is accurate;  I detailed that calculation in my first post, which comes directly from the User's Guide and the Datasheet.  

The constructive criticism I have for you at this time is that there are at least three schemes that the user has to identify pin numbers (1) the physical pin, (2) the pad nam|num,  and (3) the gpio##.  Your code should accommodate any one of the three;  ie,  RPi.GPIO-Pine64 allows ( as does its Raspberry PI counter-part ) BCM, or BOARD numbering.  In our case, the physical pin might be PHYS, the pad nam|num might be PADS, and the gpio## might be GPIONUM.  The #define is not important;  rather, the ability for the user to determine which scheme is best for their purposes... sometimes I might want to specify PADS, and other times I might want to use the acutal PHYS.

note:   If you hard-code the pin mapping and you get it right,  then there's only the inconvenience for the user that the mapping is hard-coded;  on the other hand, if you get the mapping wrong ( and that is human likely ) then the tool is more than less than unusable  ( just a hint ).
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply


Messages In This Thread
Sensus library - by Artyom - 10-01-2017, 10:44 AM
RE: Sensus library - by MarkHaysHarris777 - 10-02-2017, 12:17 AM
RE: Sensus library - by Artyom - 10-02-2017, 08:08 AM
RE: Sensus library - by MarkHaysHarris777 - 10-02-2017, 08:40 AM
RE: Sensus library - by Artyom - 10-02-2017, 10:10 AM
RE: Sensus library - by MarkHaysHarris777 - 10-02-2017, 11:32 AM
RE: Sensus library - by Artyom - 11-14-2017, 09:19 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)