| Crates.io | lp50xx-async |
| lib.rs | lp50xx-async |
| version | 0.1.0 |
| created_at | 2025-12-19 13:31:40.695467+00 |
| updated_at | 2025-12-19 13:31:40.695467+00 |
| description | Async Rust driver for the lp50xx family of Texas Instruments I2C RGB LED drivers |
| homepage | |
| repository | https://github.com/Wassasin/lp50xx-async |
| max_upload_size | |
| id | 1994774 |
| size | 55,978 |
Async Rust driver for the LP50xx family of Texas Instruments I2C RGB LED drivers.
All devices in the LP50xx family are supported:
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();