waveshare-ups-hat-e
A Rust library for monitoring the Waveshare UPS HAT (E) on Raspberry Pi via I2C.
Example Output
Output from the ups_monitor example demonstrating the type of information available:

Usage
use UpsHatE;
API
| Method | Description |
|---|---|
get_battery_state |
Voltage, current, capacity, remaining runtime |
get_power_state |
Charging state, USB-C input, power delivery mode |
get_cell_voltage |
Individual cell voltages (4 cells) |
get_usbc_vbus |
USB-C voltage, current, power |
get_communication_state |
Communication status with BQ4050 and IP2368 chips |
get_software_revision |
Firmware revision of the UPS microcontroller |
is_battery_low |
Check if battery voltage is below threshold |
is_power_off_pending |
Check if a power-off has been initiated |
force_power_off |
Initiate power-off in 30 seconds (cannot be canceled) |
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Copyright
Copyright (c) 2025 Stuart Stock, all rights reserved.