periph: periph.io/x/periph/conn/gpio/gpiostream/gpiostreamtest Index | Files

package gpiostreamtest

import "periph.io/x/periph/conn/gpio/gpiostream/gpiostreamtest"

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

Index

Package Files

gpiostreamtest.go

type InOp Uses

type InOp struct {
    gpio.Pull
    gpiostream.BitStream
}

InOp represents an expected replay StreamIn operation in PinIn.

type PinIn Uses

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 Uses

func (p *PinIn) Close() error

Close verifies that all the expected Ops have been consumed.

func (*PinIn) Function Uses

func (p *PinIn) Function() string

Function implements pin.Pin.

func (*PinIn) Halt Uses

func (p *PinIn) Halt() error

Halt implements conn.Resource.

func (*PinIn) Name Uses

func (p *PinIn) Name() string

Name implements pin.Pin.

func (*PinIn) Number Uses

func (p *PinIn) Number() int

Number implements pin.Pin.

func (*PinIn) StreamIn Uses

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

StreamIn implements gpiostream.PinIn.

func (*PinIn) String Uses

func (p *PinIn) String() string

String implements conn.Resource.

type PinOutPlayback Uses

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 Uses

func (p *PinOutPlayback) Close() error

Close verifies that all the expected Ops have been consumed.

func (*PinOutPlayback) Function Uses

func (p *PinOutPlayback) Function() string

Function implements pin.Pin.

func (*PinOutPlayback) Halt Uses

func (p *PinOutPlayback) Halt() error

Halt implements conn.Resource.

func (*PinOutPlayback) Name Uses

func (p *PinOutPlayback) Name() string

Name implements pin.Pin.

func (*PinOutPlayback) Number Uses

func (p *PinOutPlayback) Number() int

Number implements pin.Pin.

func (*PinOutPlayback) StreamOut Uses

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

StreamOut implements gpiostream.PinOut.

func (*PinOutPlayback) String Uses

func (p *PinOutPlayback) String() string

String implements conn.Resource.

type PinOutRecord Uses

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 Uses

func (p *PinOutRecord) Function() string

Function implements pin.Pin.

func (*PinOutRecord) Halt Uses

func (p *PinOutRecord) Halt() error

Halt implements conn.Resource.

func (*PinOutRecord) Name Uses

func (p *PinOutRecord) Name() string

Name implements pin.Pin.

func (*PinOutRecord) Number Uses

func (p *PinOutRecord) Number() int

Number implements pin.Pin.

func (*PinOutRecord) StreamOut Uses

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

StreamOut implements gpiostream.PinOut.

func (*PinOutRecord) String Uses

func (p *PinOutRecord) String() string

String implements conn.Resource.

Package gpiostreamtest imports 8 packages (graph). Updated 2018-12-03. Refresh now. Tools for package owners.