hArduino-1.2: Control your Arduino board from Haskell.
Copyright(c) Levent Erkok
LicenseBSD3
Maintainererkokl@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Hardware.Arduino.Parts.ShiftRegisters

Description

Abstractions for shift-register IC parts.

Synopsis

Shift register abstraction

class ShiftRegister a where Source #

A shift-register class as supported by the hArduino library.

Methods

size :: a -> Int Source #

Capacity

name :: a -> String Source #

Display name

dataSheet :: a -> String Source #

Data sheet (typically a URL)

initialize :: a -> Arduino () Source #

Initialize the shift-register

disable :: a -> Arduino () Source #

Disable the output, putting it into high-impedance state

enable :: a -> Arduino () Source #

Enable the output, getting it out of the high-impedance state

clear :: a -> Arduino () Source #

Clear the contents

push :: a -> Bool -> Arduino () Source #

Push a single bit down the shift-register

store :: a -> Arduino () Source #

Store the pushed-in values in the storage register

read :: a -> Arduino [Bool] Source #

Read the current value stored

Supported shift-registers

Texas Instruments 7HC595

data SR_74HC595 Source #

The Texas-Instruments 74HC595 8-bit shift register with 3-state outputs. Data sheet: http://www.ti.com/lit/ds/symlink/sn74hc595.pdf.

This is a versatile 8-bit shift-register with separate serial and register clocks, allowing shifting to be done while the output remains untouched. We model all control pins provided. Note that the enable and clear lines are negated.

Constructors

SR_74HC595 

Fields

  • serial :: Pin

    Chip Pin: 14: Serial input

  • nEnable :: Pin

    Chip Pin: 13: Negated output-enable

  • rClock :: Pin

    Chip Pin: 12: Register clock, positive triggered

  • sClock :: Pin

    Chip Pin: 11: Serial clock, positive triggered

  • nClear :: Pin

    Chip Pin: 10: Negated clear-data

  • mbBits :: Maybe [Pin]

    Chip Pins: 15, 1-7, and 8: Sequence of output bits, connect only if reading is necessary