i2c: add missing methods so the GrovePi fully implements the Adaptor interface
Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
parent
e041a93021
commit
1e9ebd1cc6
|
@ -80,6 +80,16 @@ func (d *GrovePiDriver) Start() (err error) {
|
|||
// Halt returns true if devices is halted successfully
|
||||
func (d *GrovePiDriver) Halt() (err error) { return }
|
||||
|
||||
// Connect is here to implement the Adaptor interface.
|
||||
func (d *GrovePiDriver) Connect() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// Finalize is here to implement the Adaptor interface.
|
||||
func (d *GrovePiDriver) Finalize() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// AnalogRead returns value from analog pin implementing the AnalogReader interface.
|
||||
func (d *GrovePiDriver) AnalogRead(pin string) (value int, err error) {
|
||||
pin = getPin(pin)
|
||||
|
|
|
@ -21,6 +21,9 @@ var _ gpio.DigitalWriter = (*GrovePiDriver)(nil)
|
|||
// must implement the AnalogReader interface
|
||||
var _ aio.AnalogReader = (*GrovePiDriver)(nil)
|
||||
|
||||
// must implement the Adaptor interface
|
||||
var _ gobot.Adaptor = (*GrovePiDriver)(nil)
|
||||
|
||||
func initTestGrovePiDriver() (driver *GrovePiDriver) {
|
||||
driver, _ = initGrovePiDriverWithStubbedAdaptor()
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue