2017-12-19 20:42:49 +08:00
|
|
|
package beaglebone
|
|
|
|
|
2023-01-06 02:04:32 +08:00
|
|
|
import (
|
2023-05-20 20:25:21 +08:00
|
|
|
"gobot.io/x/gobot/v2"
|
2023-01-06 02:04:32 +08:00
|
|
|
)
|
2017-12-19 20:42:49 +08:00
|
|
|
|
|
|
|
// PocketBeagleAdaptor is the Gobot Adaptor for the PocketBeagle
|
|
|
|
// For more information check out:
|
|
|
|
//
|
2023-05-20 20:25:21 +08:00
|
|
|
// http://beagleboard.org/pocket
|
2017-12-19 20:42:49 +08:00
|
|
|
type PocketBeagleAdaptor struct {
|
|
|
|
*Adaptor
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewPocketBeagleAdaptor creates a new Adaptor for the PocketBeagle
|
2023-12-06 03:26:28 +08:00
|
|
|
// Optional parameters:
|
|
|
|
//
|
|
|
|
// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs
|
2024-02-14 01:16:18 +08:00
|
|
|
// adaptors.WithSpiGpioAccess(sclk, ncs, sdo, sdi): use GPIO's instead of /dev/spidev#.#
|
2023-12-06 03:26:28 +08:00
|
|
|
//
|
|
|
|
// Optional parameters for PWM, see [adaptors.NewPWMPinsAdaptor]
|
|
|
|
func NewPocketBeagleAdaptor(opts ...interface{}) *PocketBeagleAdaptor {
|
2023-01-06 02:04:32 +08:00
|
|
|
a := NewAdaptor(opts...)
|
2017-12-19 20:42:49 +08:00
|
|
|
a.SetName(gobot.DefaultName("PocketBeagle"))
|
|
|
|
a.pinMap = pocketBeaglePinMap
|
|
|
|
a.pwmPinMap = pocketBeaglePwmPinMap
|
|
|
|
a.analogPinMap = pocketBeagleAnalogPinMap
|
|
|
|
|
|
|
|
return &PocketBeagleAdaptor{
|
|
|
|
Adaptor: a,
|
|
|
|
}
|
|
|
|
}
|