mirror of
https://github.com/kidoman/embd
synced 2024-12-22 04:40:04 +01:00
gpio: analogpin doesn't support write (that will come from pwm)
This commit is contained in:
parent
2d627aad67
commit
5c8ea918ab
4
bbb.go
4
bbb.go
@ -194,10 +194,6 @@ func (p *bbbAnalogPin) Read() (int, error) {
|
||||
return strconv.Atoi(str)
|
||||
}
|
||||
|
||||
func (p *bbbAnalogPin) Write(_ int) error {
|
||||
return ErrFeatureNotImplemented
|
||||
}
|
||||
|
||||
func (p *bbbAnalogPin) Close() error {
|
||||
if !p.initialized {
|
||||
return nil
|
||||
|
13
gpio.go
13
gpio.go
@ -54,9 +54,6 @@ type AnalogPin interface {
|
||||
// N returns the logical GPIO number.
|
||||
N() int
|
||||
|
||||
// Write writes the provided value to the pin.
|
||||
Write(val int) error
|
||||
|
||||
// Read reads the value from the pin.
|
||||
Read() (int, error)
|
||||
|
||||
@ -172,16 +169,6 @@ func NewAnalogPin(key interface{}) (AnalogPin, error) {
|
||||
return gpioDriverInstance.AnalogPin(key)
|
||||
}
|
||||
|
||||
// AnalogWrite writes the provided value to the pin.
|
||||
func AnalogWrite(key interface{}, val int) error {
|
||||
pin, err := NewAnalogPin(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return pin.Write(val)
|
||||
}
|
||||
|
||||
// AnalogWrite reads a value from the pin.
|
||||
func AnalogRead(key interface{}) (int, error) {
|
||||
pin, err := NewAnalogPin(key)
|
||||
|
Loading…
x
Reference in New Issue
Block a user