Add and re-export rgb crate for color handling #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added
rgb
crate for all things related to colorModified
NeopixelModule
now has aColor
associated type that must implement theComponentSlice<u8>
trait from thergb
crateNeopixelModule
trait exports a type alias for itsColor
type, e.g.NeoKey1x4Color
impl_device_module!
macro has been updated accordingly when implementing theNeopixelModule
for a device:NeopixelModule { num_leds: 4, pin: 3 }
NeopixelModule<color_type = NeoKey1x4Color> { num_leds: 4, pin: 3 }
NeopixelModule
now take theirColor
associated type as parametersfn set_neopixel_color(&mut self, r: u8, g: u8, b: u8)
fn set_neopixel_color(&mut self, color: Self::Color)
fn set_nth_neopixel_color(&mut self, n: usize, r: u8, g: u8, b: u8)
fn set_nth_neopixel_color(&mut self, n: usize, color: Self::Color)
fn set_neopixel_colors(&mut self, colors: &[(u8, u8, u8); Self::N_LEDS as usize])
fn set_neopixel_colors(&mut self, colors: &[Self::Color; Self::N_LEDS])
NeopixelModule
APIregister_write
function on theDriver
trait has been modified such that it no longer uses/needs const generics for buffer sizing (thanks @dsheets)