pwm

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MaxPeriod is the maximum period a PWM can have
	MaxPeriod = maxPeriodNanoSec * time.Nanosecond

	// MinPeriod is the minimum period a PWM can have
	MinPeriod = minPeriodNanoSec * time.Nanosecond
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pwm

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

Pwm is a pulse width modulation output driver

func New

func New(pwmID uint8, pwmPin byte) (*Pwm, error)

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

func (Pwm) Disable

func (p Pwm) Disable() error

Disable this pwm

func (Pwm) Enable

func (p Pwm) Enable() error

Enable this pwm

func (Pwm) Export

func (p Pwm) Export() error

Export the pwm to be usable from sysfs.

func (Pwm) IsExported

func (p Pwm) IsExported() bool

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

func (*Pwm) SetPeriodAndDutyCycle

func (p *Pwm) SetPeriodAndDutyCycle(period time.Duration, dutyCycle float32) error

SetPeriodAndDutyCycle configures the pwm for a given period and duty cycle ratio. Note this might go through a transient state if the pwm is Enabled

func (Pwm) Unexport

func (p Pwm) Unexport() error

Unexport the pwm from sysfs.

Jump to

Keyboard shortcuts

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