dragonboard

package
Version: v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2017 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

README

DragonBoard™ 410c

The DragonBoard 410c, a product of Arrow Electronics, is the development board based on the mid-tier Qualcomm® Snapdragon™ 410E processor. It features advanced processing power, Wi-Fi, Bluetooth connectivity, and GPS, all packed into a board the size of a credit card.

Make sure you are using the latest Linaro Debian image. Both AArch32 and AArch64 work™ though you should stick to 64bit as OS internals may be different and aren't tested.

How to Install

go get -d -u gobot.io/x/gobot/... && go install gobot.io/x/gobot/platforms/dragonboard

How to Use

The pin numbering used by your Gobot program should match the way your board is labeled right on the board itself. See here.

package main

import (
    "fmt"

    "gobot.io/x/gobot"
    "gobot.io/x/gobot/drivers/gpio"
    "gobot.io/x/gobot/platforms/dragonboard"
)

func main() {
    dragonAdaptor := dragonboard.NewAdaptor()
    button := gpio.NewButtonDriver(dragonAdaptor, "GPIO_A")

    work := func() {
        gobot.On(button.Event("push"), func(data interface{}) {
            fmt.Println("button pressed")
        })

        gobot.On(button.Event("release"), func(data interface{}) {
            fmt.Println("button released")
        })
    }

    robot := gobot.NewRobot("buttonBot",
        []gobot.Connection{chipAdaptor},
        []gobot.Device{button},
        work,
    )

    robot.Start()
}

How to Connect

Compiling

Compile your Gobot program like this:

$ GOARCH=arm64 GOOS=linux go build examples/dragon_button.go

Then you can simply upload your program to the board and execute it with

$ scp dragon_button root@192.168.1.xx:
$ ssh -t root@192.168.1.xx "./dragon_button"

Documentation

Overview

Package dragonboard contains the Gobot adaptor for the DragonBoard 410c

For further information refer to the chip README: https://github.com/hybridgroup/gobot/blob/master/platforms/dragonboard/README.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adaptor

type Adaptor struct {
	// contains filtered or unexported fields
}

Adaptor represents a Gobot Adaptor for a DragonBoard 410c

func NewAdaptor

func NewAdaptor() *Adaptor

NewAdaptor creates a DragonBoard 410c Adaptor

func (*Adaptor) Connect

func (c *Adaptor) Connect() (err error)

Connect initializes the board

func (*Adaptor) DigitalRead

func (c *Adaptor) DigitalRead(pin string) (val int, err error)

DigitalRead reads digital value to the specified pin. Valids pins are the GPIO_A through GPIO_L pins from the extender (pins 23-34 on header J8), as well as the SoC pins aka all the other pins, APQ GPIO_0-GPIO_122 and PM_MPP_0-4.

func (*Adaptor) DigitalWrite

func (c *Adaptor) DigitalWrite(pin string, val byte) (err error)

DigitalWrite writes digital value to the specified pin. Valids pins are the GPIO_A through GPIO_L pins from the extender (pins 23-34 on header J8), as well as the SoC pins aka all the other pins, APQ GPIO_0-GPIO_122 and PM_MPP_0-4.

func (*Adaptor) Finalize

func (c *Adaptor) Finalize() (err error)

Finalize closes connection to board and pins

func (*Adaptor) GetConnection

func (c *Adaptor) GetConnection(address int, bus int) (connection i2c.Connection, err error)

GetConnection returns a connection to a device on a specified bus. Valid bus number is [0..1] which corresponds to /dev/i2c-0 through /dev/i2c-1.

func (*Adaptor) GetDefaultBus

func (c *Adaptor) GetDefaultBus() int

GetDefaultBus returns the default i2c bus for this platform

func (*Adaptor) Name

func (c *Adaptor) Name() string

Name returns the name of the Adaptor

func (*Adaptor) SetName

func (c *Adaptor) SetName(n string)

SetName sets the name of the Adaptor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL