mux

package
v0.0.0-...-5837768 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mux provides drivers for hardware multiplexers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GPIO  GPIOConfig `yaml:"gpio"`
	Debug bool       `yaml:"debug"`
}

Config holds configuration for multiplexer devices.

type Digital

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

Digital implements Mux for a digital multiplexer.

func NewDigital

func NewDigital(c Config) *Digital

NewDigital creates a new Digital multiplexer using the given pins in the given order for selection.

func (*Digital) Debug

func (d *Digital) Debug() bool

Debug returns true if debug mode is enabled.

func (*Digital) Init

func (d *Digital) Init() error

Init implements Mux interface.

func (*Digital) Select

func (d *Digital) Select(address uint8) (err error)

Select implements Mux interface.

type GPIOConfig

type GPIOConfig struct {
	CS []string `yaml:"cs"`
}

GPIOConfig defines the GPIO pines to use as multiplexer lines.

type Mockup

type Mockup struct {
	Debug    bool
	Selected uint8
}

Mockup implements Mux interface.

func (*Mockup) Init

func (d *Mockup) Init() error

Init implements Mux interface.

func (*Mockup) Select

func (d *Mockup) Select(n uint8) error

Select implements Mux interface.

type Mux

type Mux interface {
	driver.Driver
	// Select configures the multiplexer to address given address
	Select(uint8) error
}

Mux implements a hardware multiplexer driver.

Jump to

Keyboard shortcuts

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