Finding good documentation for gpiod

Chris Green cl at isbd.net
Fri Sep 1 16:48:59 EDT 2023


I am using the gpiod package for manipulating GPIO inputs/outputs on a
Beaglebone Black SBC (like a Raspberry Pi but with more flexible I/O).

Mostly I am managing to get things to work as I want but better
documentation of gpiod would be a great help.

For example, when one has found an I/O pin (a 'line' in GPIO parlance)
that one wants to use one has to 'request' it using the Line.request()
method.

The help for this is as follows:-

    Help on method_descriptor:

    request(...)
        request(consumer[, type[, flags[, default_val]]]) -> None
        
        Request this GPIO line.
        
          consumer
            Name of the consumer.
          type
            Type of the request.
          flags
            Other configuration flags.
          default_val
            Default value of this line.
        Note: default_vals argument (sequence of default values passed down to
        LineBulk.request()) is still supported for backward compatibility but is
        now deprecated when requesting single lines.


Which is pretty good **except** that I can't find a proper description
of the parameters anywhere, i.e. there's nowhere that even tells me
what types of values/objects the parameters are.  At the end of the
gpiod.Line section of the help there is this:-

     |  ACTIVE_HIGH = 1
     |  
     |  ACTIVE_LOW = 2
     |  
     |  BIAS_AS_IS = 1
     |  
     |  BIAS_DISABLE = 2
     |  
     |  BIAS_PULL_DOWN = 4
     |  
     |  BIAS_PULL_UP = 3
     |  
     |  DIRECTION_INPUT = 1
     |  
     |  DIRECTION_OUTPUT = 2

Which **might** be appropriate values for 'type' or 'flags' but there
doesn't seem to be any way of knowing.

Am I missing something very obvious somewhere?  Is there a 'standard'
way of finding out parameter information?

It may well be that I'm simply banging up against the limit of what
documentation is available, I have managed to get code working OK.
It's just that I'd be happier if I really know what I was doing! :-)



-- 
Chris Green
·


More information about the Python-list mailing list