1
0
mirror of https://github.com/kidoman/embd synced 2025-02-12 05:33:26 +01:00
embd/gpio/gpio.go

30 lines
338 B
Go
Raw Normal View History

2014-02-17 03:41:53 +05:30
package gpio
type Direction int
const (
In Direction = iota
Out
2014-02-17 03:41:53 +05:30
)
const (
Low int = iota
2014-02-17 03:41:53 +05:30
High
)
type DigitalPin interface {
Write(val int) error
Read() (int, error)
2014-02-17 03:41:53 +05:30
SetDir(dir Direction) error
ActiveLow(b bool) error
2014-02-17 03:41:53 +05:30
Close() error
2014-02-17 03:41:53 +05:30
}
type GPIO interface {
DigitalPin(key interface{}) (DigitalPin, error)
2014-02-17 03:41:53 +05:30
Close() error
2014-02-17 03:41:53 +05:30
}