mirror of
https://github.com/kidoman/embd
synced 2025-02-07 11:13:19 +01:00
30 lines
338 B
Go
30 lines
338 B
Go
package gpio
|
|
|
|
type Direction int
|
|
|
|
const (
|
|
In Direction = iota
|
|
Out
|
|
)
|
|
|
|
const (
|
|
Low int = iota
|
|
High
|
|
)
|
|
|
|
type DigitalPin interface {
|
|
Write(val int) error
|
|
Read() (int, error)
|
|
|
|
SetDir(dir Direction) error
|
|
ActiveLow(b bool) error
|
|
|
|
Close() error
|
|
}
|
|
|
|
type GPIO interface {
|
|
DigitalPin(key interface{}) (DigitalPin, error)
|
|
|
|
Close() error
|
|
}
|