gpio

package
v0.0.0-...-76dc376 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InDirection is the direction for input GPIO
	InDirection = "in"
	// OutDirection is the direction for output GPIO
	OutDirection = "out"
)
View Source
const (
	// ActiveHigh is the state for active high input GPIO
	ActiveHigh = "0"
	// ActiveLow is the state for active low input GPIO
	ActiveLow = "1"
)

Variables

This section is empty.

Functions

func EnableFastI2C

func EnableFastI2C(bus byte) error

EnableFastI2C enables i2c fast mode

func EnableGPIO

func EnableGPIO(pin byte) error

EnableGPIO enables GPIO mode on a mux-ed pin

func EnableHighI2C

func EnableHighI2C(bus byte) error

EnableHighI2C enables i2c fast mode

func EnableI2C

func EnableI2C(pin byte) error

EnableI2C enables i2c mode on a mux-ed pin

func EnablePWM

func EnablePWM(pin byte) error

EnablePWM enables PWM on a mux-ed pin See http://www.emutexlabs.com/project/215-intel-edison-gpio-pin-multiplexing-guide

func EnableStdI2C

func EnableStdI2C(bus byte) error

EnableStdI2C enables i2c fast mode

Types

type Gpio

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

Gpio is a general purpose I/O of the Edison

func New

func New(pin uint8) Gpio

New returns a new PWM for a given pin - See Edison Breakout documentation to figure out which one you want.

func (Gpio) Disable

func (p Gpio) Disable() error

Disable this gpio

func (Gpio) Enable

func (p Gpio) Enable() error

Enable this gpio

func (Gpio) Export

func (p Gpio) Export() error

Export the gpio to be usable from sysfs.

func (Gpio) IsExported

func (p Gpio) IsExported() bool

IsExported returns true with the gpio is already exported and usable from sysfs.

func (Gpio) SetActiveLevel

func (p Gpio) SetActiveLevel(level string) error

SetActiveLevel set the ActiveLow or ActiveHigh level for IN direction.

func (Gpio) SetDirection

func (p Gpio) SetDirection(dir string) error

SetDirection defines whether this particular GPIO is used for input or output (use constants InDirection and OutDirection).

func (Gpio) Unexport

func (p Gpio) Unexport() error

Unexport the gpio from sysfs.

func (Gpio) Value

func (p Gpio) Value() (bool, error)

Value returns the value of the GPIO

Jump to

Keyboard shortcuts

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