gpiostreamtest

package
v0.0.0-...-9a6eaac Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: Apache-2.0, MIT, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package gpiostreamtest enables testing device driver using gpiostream.PinIn or PinOut.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InOp

type InOp struct {
	gpio.Pull
	gpiostream.BitStream
}

InOp represents an expected replay StreamIn operation in PinIn.

type PinIn

type PinIn struct {
	// These should be immutable.
	N         string
	DontPanic bool

	// Grab the Mutex before accessing the following members.
	sync.Mutex
	Ops   []InOp
	Count int
}

PinIn implements gpiostream.PinIn that accepts BitStream only.

Embed in a struct with gpiotest.Pin for more functionality.

func (*PinIn) Close

func (p *PinIn) Close() error

Close verifies that all the expected Ops have been consumed.

func (*PinIn) Function

func (p *PinIn) Function() string

Function implements pin.Pin.

func (*PinIn) Halt

func (p *PinIn) Halt() error

Halt implements conn.Resource.

func (*PinIn) Name

func (p *PinIn) Name() string

Name implements pin.Pin.

func (*PinIn) Number

func (p *PinIn) Number() int

Number implements pin.Pin.

func (*PinIn) StreamIn

func (p *PinIn) StreamIn(pull gpio.Pull, b gpiostream.Stream) error

StreamIn implements gpiostream.PinIn.

func (*PinIn) String

func (p *PinIn) String() string

String implements conn.Resource.

type PinOutPlayback

type PinOutPlayback struct {
	// These should be immutable.
	N         string
	DontPanic bool

	// Grab the Mutex before accessing the following members.
	sync.Mutex
	Ops   []gpiostream.Stream
	Count int
}

PinOutPlayback implements gpiostream.PinOut.

Embed in a struct with gpiotest.Pin for more functionality.

func (*PinOutPlayback) Close

func (p *PinOutPlayback) Close() error

Close verifies that all the expected Ops have been consumed.

func (*PinOutPlayback) Function

func (p *PinOutPlayback) Function() string

Function implements pin.Pin.

func (*PinOutPlayback) Halt

func (p *PinOutPlayback) Halt() error

Halt implements conn.Resource.

func (*PinOutPlayback) Name

func (p *PinOutPlayback) Name() string

Name implements pin.Pin.

func (*PinOutPlayback) Number

func (p *PinOutPlayback) Number() int

Number implements pin.Pin.

func (*PinOutPlayback) StreamOut

func (p *PinOutPlayback) StreamOut(s gpiostream.Stream) error

StreamOut implements gpiostream.PinOut.

func (*PinOutPlayback) String

func (p *PinOutPlayback) String() string

String implements conn.Resource.

type PinOutRecord

type PinOutRecord struct {
	// These should be immutable.
	N         string
	DontPanic bool

	// Grab the Mutex before accessing the following members.
	sync.Mutex
	Ops []gpiostream.Stream
}

PinOutRecord implements gpiostream.PinOut that records operations.

Embed in a struct with gpiotest.Pin for more functionality.

func (*PinOutRecord) Function

func (p *PinOutRecord) Function() string

Function implements pin.Pin.

func (*PinOutRecord) Halt

func (p *PinOutRecord) Halt() error

Halt implements conn.Resource.

func (*PinOutRecord) Name

func (p *PinOutRecord) Name() string

Name implements pin.Pin.

func (*PinOutRecord) Number

func (p *PinOutRecord) Number() int

Number implements pin.Pin.

func (*PinOutRecord) StreamOut

func (p *PinOutRecord) StreamOut(s gpiostream.Stream) error

StreamOut implements gpiostream.PinOut.

func (*PinOutRecord) String

func (p *PinOutRecord) String() string

String implements conn.Resource.

Jump to

Keyboard shortcuts

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