STM32-Zombie-0.1.1: control a STM32F103 microcontroller

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

App.WS1228B

Description

The WS1228Bs are popular RGB LED controllers for colorful decorations and mood lights etc. For proper operation the WS1228B requires fast and acurate timing. The example works with combination of SPI and DMA. With the SPI port it is possible to shift out a raw bitstream. (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 black)

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

set the LEDs 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 bit get extended to three bits

testWave :: IO () Source #

Animate LEDs and show some wave like lighting pattern