sysfs: define DigitalPinnerProvider and PWMPinnerProvider interfaces

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-05-01 09:23:15 +02:00
parent 06ba193e75
commit ea371766fb
2 changed files with 12 additions and 0 deletions

View File

@ -38,6 +38,12 @@ type DigitalPinner interface {
Write(int) error Write(int) error
} }
// DigitalPinnerProvider is the interface that an Adaptor should implement to allow
// clients to obtain access to any DigitalPin's available on that board.
type DigitalPinnerProvider interface {
DigitalPin(string, string) (DigitalPinner, error)
}
type DigitalPin struct { type DigitalPin struct {
pin string pin string
label string label string

View File

@ -28,6 +28,12 @@ type PWMPinner interface {
SetDutyCycle(duty uint32) (err error) SetDutyCycle(duty uint32) (err error)
} }
// PWMPinnerProvider is the interface that an Adaptor should implement to allow
// clients to obtain access to any PWMPin's available on that board.
type PWMPinnerProvider interface {
PWMPin(string) (PWMPinner, error)
}
type PWMPin struct { type PWMPin struct {
pin string pin string
Chip string Chip string