Skip to content

Commit 51302a3

Browse files
Add some (much needed) documentation
1 parent 2a08291 commit 51302a3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/lib.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1+
//! # Smart Leds Trait
2+
//!
3+
//! Smart leds is a collection of crates to use smart leds on embedded devices with rust.
4+
//!
5+
//! Examples of smart leds include the popular WS2812 (also called Neopixel),
6+
//! APA102 (DotStar) and other leds, which can be individually adressed.
7+
//!
8+
//! This crate is used as a common base, so that breaking changes which would
9+
//! force all other crates to be updated, can be avoided.
10+
//!
11+
//! End users should use the [smart-leds](https://crates.io/crates/smart-leds)
12+
//! crate, which contains various convenience functions.
113
#![no_std]
214

315
pub use {rgb::RGB, rgb::RGB16, rgb::RGB8, rgb::RGBA};
416

517
pub struct White<C>(pub C);
618

19+
/// The RGBW Pixel
20+
///
21+
/// This is used for leds, that in addition to RGB leds also contain a white led
722
pub type RGBW<ComponentType, WhiteComponentType = ComponentType> =
823
RGBA<ComponentType, White<WhiteComponentType>>;
924

25+
/// A trait that smart led drivers implement
26+
///
27+
/// The amount of time each iteration of `iterator` might take is undefined.
28+
/// Drivers, where this might lead to issues, aren't expected to work in all cases.
1029
pub trait SmartLedsWrite {
1130
type Error;
1231
type Color;

0 commit comments

Comments
 (0)