STM32-Zombie-0.2.0: control a STM32F103 microcontroller

Copyright(c) Marc Fontaine 2017
LicenseBSD3
MaintainerMarc.Fontaine@gmx.de
Stabilityexperimental
PortabilityGHC-only
Safe HaskellNone
LanguageHaskell2010

App.WS1228B

Description

The popular WS1228B module consists of a RGB LED and an included LED controller. Many WS1228B modules can be chained up to build LED strips for colorful decorations, mood lights etc. For proper operation the WS1228B requires fast and accurate timing. The example works with combination of SPI and DMA. With the SPI port it is possible to shift out a raw bit-stream. (i.e. play a one-bit sampled wave-form). (This is not possible with the USART because the USART would add start and stop bits)

Synopsis

Documentation

data RGB Source #

Constructors

RGB Word8 Word8 Word8 

Instances

Eq RGB Source # 

Methods

(==) :: RGB -> RGB -> Bool #

(/=) :: RGB -> RGB -> Bool #

Ord RGB Source # 

Methods

compare :: RGB -> RGB -> Ordering #

(<) :: RGB -> RGB -> Bool #

(<=) :: RGB -> RGB -> Bool #

(>) :: RGB -> RGB -> Bool #

(>=) :: RGB -> RGB -> Bool #

max :: RGB -> RGB -> RGB #

min :: RGB -> RGB -> RGB #

Read RGB Source # 
Show RGB Source # 

Methods

showsPrec :: Int -> RGB -> ShowS #

show :: RGB -> String #

showList :: [RGB] -> ShowS #

testLEDs :: IO () Source #

show some color pattern

ledsOff30 :: IO () Source #

turn off the first 30 LEDs (== set the color to black)

sendLEDs :: [RGB] -> IO () Source #

set the LED strip to a list of colors.

encodeRGBLine :: [RGB] -> ByteString Source #

The WS1228B protocoll. translate a list of colors to the transmission bits.

lineCodeWord8 :: Word8 -> (Word8, Word8, Word8) Source #

Encode an Word8 according to the WS1228B line code. Each data bit is extended to a three bit line code.

testWave :: IO () Source #

Animate a LED strip and show some wave-like lighting pattern.