1
0
mirror of https://github.com/kidoman/embd synced 2024-12-21 12:20:05 +01:00

gpio: added pinmap accessor for introspection usage

This commit is contained in:
Ben Delarre 2015-01-13 13:55:11 -08:00 committed by Kunal Powar
parent 05c03968d7
commit e6d0ea4225
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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 {