Expand description
LED animation effects for embedded projects.
This crate provides reusable animation effects that work with RGB LEDs.
It is no_std compatible for embedded use.
§StatusLed Trait
The StatusLed trait provides a common interface for LED drivers that can
display status colors. This enables crates like rustyfarian-network to
show connection status without depending on a specific LED implementation.
§NoLed
NoLed is a zero-size stub that implements StatusLed with an Infallible error type.
Use it when a type parameter requires a StatusLed but no physical LED is present.
§SimpleLed (opt-in via hal feature)
For simple on/off GPIO LEDs (not RGB), enable the hal feature to get the
[SimpleLed] adapter, which implements StatusLed by mapping RGB colors to
on/off based on brightness.
It is generic over [embedded_hal::digital::OutputPin], so it works with
any HAL or test mock.
§PulseEffect
The PulseEffect creates smooth pulsing brightness animations.
Structs§
- NoLed
- A no-op LED stub that satisfies the
StatusLedtrait without any hardware dependency. - Pulse
Effect - A pulsing brightness effect that smoothly oscillates between dim and bright.
Enums§
- Pulse
Effect Error - Error type for PulseEffect configuration.
Constants§
- DEFAULT_
BRIGHTNESS_ THRESHOLD - Default brightness threshold for simple on/off LED decisions.
Traits§
- Async
Status Led - Async counterpart of
StatusLedfor drivers with async I/O. - Status
Led - Trait for LED status indicators.
Functions§
- exceeds_
threshold - Determines if an RGB color exceeds a brightness threshold.
- max_
channel_ brightness - Calculates the maximum channel value from an RGB color.