embd/gpio/gpio.go

30 lines
338 B
Go
Raw Normal View History

2014-02-16 23:11:53 +01:00
package gpio
type Direction int
const (
In Direction = iota
Out
2014-02-16 23:11:53 +01:00
)
const (
Low int = iota
2014-02-16 23:11:53 +01:00
High
)
type DigitalPin interface {
Write(val int) error
Read() (int, error)
2014-02-16 23:11:53 +01:00
SetDir(dir Direction) error
ActiveLow(b bool) error
2014-02-16 23:11:53 +01:00
Close() error
2014-02-16 23:11:53 +01:00
}
type GPIO interface {
DigitalPin(key interface{}) (DigitalPin, error)
2014-02-16 23:11:53 +01:00
Close() error
2014-02-16 23:11:53 +01:00
}