gpio: added pinmap accessor for introspection usage

pull/22/merge
Ben Delarre 8 years ago committed by Kunal Powar
parent 05c03968d7
commit e6d0ea4225

@ -125,6 +125,9 @@ type PWMPin interface {
// GPIODriver implements a generic GPIO driver.
type GPIODriver interface {
// Returns the pinmap for this GPIODriver
PinMap() PinMap
// Unregister unregisters the pin from the driver. Should be called when the pin is closed.
Unregister(string) error

@ -107,6 +107,10 @@ func (io *gpioDriver) PWMPin(key interface{}) (PWMPin, error) {
return p, nil
}
func (io *gpioDriver) PinMap() PinMap {
return io.pinMap
}
func (io *gpioDriver) Close() error {
for _, p := range io.initializedPins {
if err := p.Close(); err != nil {

Loading…
Cancel
Save