shiftregister

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package shiftregister is for 8bit shift output register using 3 GPIO pins like SN74ALS164A, SN74AHC594, SN74AHC595, ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

Device holds pin number

func New

func New(Bits NumberBit, Latch, Clock, Out machine.Pin) *Device

New returns a new shift output register device

func (*Device) Configure

func (d *Device) Configure()

Configure set hardware configuration

func (*Device) GetShiftPin

func (d *Device) GetShiftPin(pin int) *ShiftPin

GetShiftPin return an individually addressable pin

func (*Device) WriteMask

func (d *Device) WriteMask(mask uint32)

WriteMask applies mask's bits to register's outputs pin mask's MSB set Q1, LSB set Q8 (for 8 bits mask)

type NumberBit

type NumberBit int8
const (
	EIGHT_BITS     NumberBit = 8
	SIXTEEN_BITS   NumberBit = 16
	THIRTYTWO_BITS NumberBit = 32
)

Bit number of the register

type ShiftPin

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

ShiftPin is the implementation of the ShiftPin interface. ShiftPin provide an interface like regular machine.Pin

func (ShiftPin) High

func (p ShiftPin) High()

High sets this shift register pin to high.

func (ShiftPin) Low

func (p ShiftPin) Low()

Low sets this shift register pin to low.

func (ShiftPin) Set

func (p ShiftPin) Set(value bool)

Set changes the value of this register pin.

Jump to

Keyboard shortcuts

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