pub struct Driver<VARIANT: LP50xx, T: I2c, STATE: Marker> { /* private fields */ }Expand description
High level generic driver for the LP50xx family of devices.
See LP50xx on how to instantiate the device.
The channels can be configured per OUT and per RGB LED. Bank-mode is not (yet) supported.
Implementations§
Source§impl<VARIANT: LP50xx, T: I2c> Driver<VARIANT, T, Normal>
impl<VARIANT: LP50xx, T: I2c> Driver<VARIANT, T, Normal>
Sourcepub async fn disable(
self,
) -> Result<Driver<VARIANT, T, Standby>, DeviceError<T::Error>>
pub async fn disable( self, ) -> Result<Driver<VARIANT, T, Standby>, DeviceError<T::Error>>
Disable the device, putting it into Standby mode.
All register values will be retained, but the constant current sinks will no longer be functional, turning off the LEDs.
Consumes up to 12uA of current, depending on the device type.
Source§impl<VARIANT: LP50xx, T: I2c, MARKER: Marker> Driver<VARIANT, T, MARKER>
impl<VARIANT: LP50xx, T: I2c, MARKER: Marker> Driver<VARIANT, T, MARKER>
Sourcepub async fn configure(
&mut self,
config: &Config,
) -> Result<(), DeviceError<T::Error>>
pub async fn configure( &mut self, config: &Config, ) -> Result<(), DeviceError<T::Error>>
Set the general configuration parameters of the device.
Sourcepub async fn set_channel(
&mut self,
channel_i: u8,
value: u8,
) -> Result<(), Error<T::Error>>
pub async fn set_channel( &mut self, channel_i: u8, value: u8, ) -> Result<(), Error<T::Error>>
Set the specific OUT channel to a specific color value.
Will return the Error::Index if the device does not have the indexed channel.
Sourcepub async fn set_rgb(
&mut self,
rgb_i: u8,
value: impl Into<Rgb>,
) -> Result<(), Error<T::Error>>
pub async fn set_rgb( &mut self, rgb_i: u8, value: impl Into<Rgb>, ) -> Result<(), Error<T::Error>>
Set the RGB LED color values.
Will return the Error::Index if the device does not have the indexed RGB LED.
Sourcepub async fn set_rgb_brightness(
&mut self,
rgb_i: u8,
value: u8,
) -> Result<(), Error<T::Error>>
pub async fn set_rgb_brightness( &mut self, rgb_i: u8, value: u8, ) -> Result<(), Error<T::Error>>
Set the brightness of a RGB LED (not the color).
Will return the Error::Index if the device does not have the indexed RGB LED