atsam

package
v3.4.991+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Pins map[int]*Pin

Pins is all the pins exported by GPIO sysfs.

Some CPU architectures have the pin numbers start at 0 and use consecutive pin numbers but this is not the case for all CPU architectures, some have gaps in the pin numbering.

This global variable is initialized once at driver initialization and isn't mutated afterward. Do not modify it.

Functions

func Present

func Present() bool

Present returns true if a TM AM335x processor is detected.

Types

type Pin

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

Pin represents one GPIO pin as found by sysfs.

func (*Pin) DefaultPull

func (p *Pin) DefaultPull() gpio.Pull

DefaultPull implements gpio.PinIn.

It returns gpio.PullNoChange since gpio sysfs has no support for input pull resistor.

func (*Pin) Func

func (p *Pin) Func() pin.Func

Func implements pin.PinFunc.

func (*Pin) Function

func (p *Pin) Function() string

Function implements pin.Pin.

func (*Pin) Halt

func (p *Pin) Halt() error

Halt implements conn.Resource.

It stops edge detection if enabled.

func (*Pin) In

func (p *Pin) In(pull gpio.Pull, edge gpio.Edge) error

In implements gpio.PinIn.

func (*Pin) Name

func (p *Pin) Name() string

Name implements pin.Pin.

func (*Pin) Number

func (p *Pin) Number() int

Number implements pin.Pin.

func (*Pin) Out

func (p *Pin) Out(l gpio.Level) error

Out implements gpio.PinOut.

func (*Pin) PWM

func (p *Pin) PWM(gpio.Duty, physic.Frequency) error

PWM implements gpio.PinOut.

This is not supported on sysfs.

func (*Pin) Pull

func (p *Pin) Pull() gpio.Pull

Pull implements gpio.PinIn.

It returns gpio.PullNoChange since gpio sysfs has no support for input pull resistor.

func (*Pin) Read

func (p *Pin) Read() gpio.Level

Read implements gpio.PinIn.

func (*Pin) SetFunc

func (p *Pin) SetFunc(f pin.Func) error

SetFunc implements pin.PinFunc.

func (*Pin) String

func (p *Pin) String() string

String implements conn.Resource.

func (*Pin) SupportedFuncs

func (p *Pin) SupportedFuncs() []pin.Func

SupportedFuncs implements pin.PinFunc.

func (*Pin) WaitForEdge

func (p *Pin) WaitForEdge(timeout time.Duration) bool

WaitForEdge implements gpio.PinIn.

Jump to

Keyboard shortcuts

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