lp50xx-async

Crates.iolp50xx-async
lib.rslp50xx-async
version0.1.0
created_at2025-12-19 13:31:40.695467+00
updated_at2025-12-19 13:31:40.695467+00
descriptionAsync Rust driver for the lp50xx family of Texas Instruments I2C RGB LED drivers
homepage
repositoryhttps://github.com/Wassasin/lp50xx-async
max_upload_size
id1994774
size55,978
Wouter Geraedts (Wassasin)

documentation

https://docs.rs/lp50xx-async

README

lp50xx_async

Async Rust driver for the LP50xx family of Texas Instruments I2C RGB LED drivers.

Supported devices

All devices in the LP50xx family are supported:

How to use

For any I2C peripheral implementing the I2c embedded-hal-async trait you can use this driver as follows:

let hl = LP5030::new(&mut i2c, Address::Address1);
let mut hl = hl.enable().await.unwrap();

hl.configure(&Config {
    log_scale: true,
    power_save: true,
    pwm_dithering: false,
    max_current: ll::MaxCurrentOption::Current35MA,
})
.await
.unwrap();

// Set all LEDs to the same brightness.
hl.set_all_brightness(0x55).await.unwrap();

// Set a specific LED to a specific brightness.
hl.set_rgb_brightness(9, 0x54).await.unwrap();

// Change the color for that LED.
hl.set_rgb(9, (0x01, 0x02, 0x03)).await.unwrap();

// Set the value for a specific channel (when not used with RGB LEDs).
hl.set_channel(22, 0xFF).await.unwrap();

// Put the device in Standby mode.
let hl = hl.disable().await.unwrap();
Commit count: 0

cargo fmt