Skip to content

Commit 30b8ac1

Browse files
Merge pull request #15 from smart-leds-rs/new_release0.4.0
New release v0.4.0
2 parents b385438 + 84c7d87 commit 30b8ac1

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ws2812-spi"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
authors = ["David Sawatzke <[email protected]>"]
55
edition = "2018"
66
categories = [
@@ -15,9 +15,9 @@ readme = "README.md"
1515
repository = "https://github.com/smart-leds-rs/ws2812-spi-rs"
1616

1717
[dependencies]
18-
nb = "0.1.1"
19-
smart-leds-trait = "0.2"
20-
embedded-hal = "0.2.1"
18+
nb = "0.1.3"
19+
smart-leds-trait = "0.2.0"
20+
embedded-hal = "0.2.4"
2121

2222
[features]
2323
mosi_idle_high = []

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,29 @@ crate.
55

66
An embedded-hal driver for ws2812 leds using spi as the timing provider.
77

8+
![rainbow on stm32f0](./stm32f0_ws2812_spi_rainbow.gif)
9+
810
It provides two variants:
911
- The normal usage
1012

1113
Your spi peripheral has to run betwee 2MHz and 3.8MHz & the SPI data is created on-the-fly.
12-
This means that your core has to be reasonably fast (~48 MHz).
14+
This means that your core has to be reasonably fast (48 MHz should suffice).
1315
- Prerendered
1416

15-
If your core is too slow or your SPI peripheral has a different frequency, you
17+
If your core is too slow (for example, the AVR family), you
1618
may want to use this. It creates all the data beforehand & then sends it. This
1719
means that you have to provide a data array that's large enough for all the
1820
spi data.
1921

2022
## It doesn't work!!!
2123
- Do you use the normal variant? Does your spi run at the right frequency?
2224

23-
Lots of embeded devices don't support this, so you may need to look at your
24-
hal implementation and at your data sheet. If you use the prerendered version,
25-
you should also verify that the spi frequency matches the requirements.
25+
Your CPU might be too slow, but this can also depend on the HAL implementation
26+
& your Iterator chain. Using the `prerendered` variant might help. For many
27+
SPI peripherals, the clock generations is way less sophisticated than e.g.
28+
the UART peripheral. You should verify it runs at an acceptable frequency, by
29+
either studying the datasheet & the hal code or using a logic analyzer. An
30+
fx2 based one, commonly available under $10 works great for this.
2631
- If the first led is always on, no matter what data you put in, your spi is
2732
probably not setting the mosi line to low on idle (You can check with a multimeter).
2833
It may also be a timing issue with the first bit being sent, this is the case

stm32f0_ws2812_spi_rainbow.gif

4.59 MB
Loading

0 commit comments

Comments
 (0)