#[non_exhaustive]#[repr(u16)]pub enum BatterySystem {
Show 91 variants
SmartBatteryBatteryMode = 1,
SmartBatteryBatteryStatus = 2,
SmartBatteryAlarmWarning = 3,
SmartBatteryChargerMode = 4,
SmartBatteryChargerStatus = 5,
SmartBatteryChargerSpecInfo = 6,
SmartBatterySelectorState = 7,
SmartBatterySelectorPresets = 8,
SmartBatterySelectorInfo = 9,
OptionalMfgFunction1 = 16,
OptionalMfgFunction2 = 17,
OptionalMfgFunction3 = 18,
OptionalMfgFunction4 = 19,
OptionalMfgFunction5 = 20,
ConnectionToSMBus = 21,
OutputConnection = 22,
ChargerConnection = 23,
BatteryInsertion = 24,
UseNext = 25,
OKToUse = 26,
BatterySupported = 27,
SelectorRevision = 28,
ChargingIndicator = 29,
ManufacturerAccess = 40,
RemainingCapacityLimit = 41,
RemainingTimeLimit = 42,
AtRate = 43,
CapacityMode = 44,
BroadcastToCharger = 45,
PrimaryBattery = 46,
ChargeController = 47,
TerminateCharge = 64,
TerminateDischarge = 65,
BelowRemainingCapacityLimit = 66,
RemainingTimeLimitExpired = 67,
Charging = 68,
Discharging = 69,
FullyCharged = 70,
FullyDischarged = 71,
ConditioningFlag = 72,
AtRateOK = 73,
SmartBatteryErrorCode = 74,
NeedReplacement = 75,
AtRateTimeToFull = 96,
AtRateTimeToEmpty = 97,
AverageCurrent = 98,
MaxError = 99,
RelativeStateOfCharge = 100,
AbsoluteStateOfCharge = 101,
RemainingCapacity = 102,
FullChargeCapacity = 103,
RunTimeToEmpty = 104,
AverageTimeToEmpty = 105,
AverageTimeToFull = 106,
CycleCount = 107,
BatteryPackModelLevel = 128,
InternalChargeController = 129,
PrimaryBatterySupport = 130,
DesignCapacity = 131,
SpecificationInfo = 132,
ManufactureDate = 133,
SerialNumber = 134,
iManufacturerName = 135,
iDeviceName = 136,
iDeviceChemistry = 137,
ManufacturerData = 138,
Rechargable = 139,
WarningCapacityLimit = 140,
CapacityGranularity1 = 141,
CapacityGranularity2 = 142,
iOEMInformation = 143,
InhibitCharge = 192,
EnablePolling = 193,
ResetToZero = 194,
ACPresent = 208,
BatteryPresent = 209,
PowerFail = 210,
AlarmInhibited = 211,
ThermistorUnderRange = 212,
ThermistorHot = 213,
ThermistorCold = 214,
ThermistorOverRange = 215,
VoltageOutOfRange = 216,
CurrentOutOfRange = 217,
CurrentNotRegulated = 218,
VoltageNotRegulated = 219,
MasterMode = 220,
ChargerSelectorSupport = 240,
ChargerSpec = 241,
Level2 = 242,
Level3 = 243,
}Expand description
Usage Page 0x85: “Battery System”
This enum is autogenerated from the HID Usage Tables.
let u1 = Usage::BatterySystem(BatterySystem::SmartBatteryBatteryStatus);
let u2 = Usage::new_from_page_and_id(0x85, 0x2).unwrap();
let u3 = Usage::from(BatterySystem::SmartBatteryBatteryStatus);
let u4: Usage = BatterySystem::SmartBatteryBatteryStatus.into();
assert_eq!(u1, u2);
assert_eq!(u1, u3);
assert_eq!(u1, u4);
assert!(matches!(u1.usage_page(), UsagePage::BatterySystem));
assert_eq!(0x85, u1.usage_page_value());
assert_eq!(0x2, u1.usage_id_value());
assert_eq!((0x85 << 16) | 0x2, u1.usage_value());
assert_eq!("Smart Battery Battery Status", u1.name());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SmartBatteryBatteryMode = 1
Usage ID 0x1: “Smart Battery Battery Mode”
SmartBatteryBatteryStatus = 2
Usage ID 0x2: “Smart Battery Battery Status”
SmartBatteryAlarmWarning = 3
Usage ID 0x3: “Smart Battery Alarm Warning”
SmartBatteryChargerMode = 4
Usage ID 0x4: “Smart Battery Charger Mode”
SmartBatteryChargerStatus = 5
Usage ID 0x5: “Smart Battery Charger Status”
SmartBatteryChargerSpecInfo = 6
Usage ID 0x6: “Smart Battery Charger Spec Info”
SmartBatterySelectorState = 7
Usage ID 0x7: “Smart Battery Selector State”
SmartBatterySelectorPresets = 8
Usage ID 0x8: “Smart Battery Selector Presets”
SmartBatterySelectorInfo = 9
Usage ID 0x9: “Smart Battery Selector Info”
OptionalMfgFunction1 = 16
Usage ID 0x10: “Optional Mfg Function 1”
OptionalMfgFunction2 = 17
Usage ID 0x11: “Optional Mfg Function 2”
OptionalMfgFunction3 = 18
Usage ID 0x12: “Optional Mfg Function 3”
OptionalMfgFunction4 = 19
Usage ID 0x13: “Optional Mfg Function 4”
OptionalMfgFunction5 = 20
Usage ID 0x14: “Optional Mfg Function 5”
ConnectionToSMBus = 21
Usage ID 0x15: “Connection To SM Bus”
OutputConnection = 22
Usage ID 0x16: “Output Connection”
ChargerConnection = 23
Usage ID 0x17: “Charger Connection”
BatteryInsertion = 24
Usage ID 0x18: “Battery Insertion”
UseNext = 25
Usage ID 0x19: “Use Next”
OKToUse = 26
Usage ID 0x1A: “OK To Use”
BatterySupported = 27
Usage ID 0x1B: “Battery Supported”
SelectorRevision = 28
Usage ID 0x1C: “Selector Revision”
ChargingIndicator = 29
Usage ID 0x1D: “Charging Indicator”
ManufacturerAccess = 40
Usage ID 0x28: “Manufacturer Access”
RemainingCapacityLimit = 41
Usage ID 0x29: “Remaining Capacity Limit”
RemainingTimeLimit = 42
Usage ID 0x2A: “Remaining Time Limit”
AtRate = 43
Usage ID 0x2B: “At Rate”
CapacityMode = 44
Usage ID 0x2C: “Capacity Mode”
BroadcastToCharger = 45
Usage ID 0x2D: “Broadcast To Charger”
PrimaryBattery = 46
Usage ID 0x2E: “Primary Battery”
ChargeController = 47
Usage ID 0x2F: “Charge Controller”
TerminateCharge = 64
Usage ID 0x40: “Terminate Charge”
TerminateDischarge = 65
Usage ID 0x41: “Terminate Discharge”
BelowRemainingCapacityLimit = 66
Usage ID 0x42: “Below Remaining Capacity Limit”
RemainingTimeLimitExpired = 67
Usage ID 0x43: “Remaining Time Limit Expired”
Charging = 68
Usage ID 0x44: “Charging”
Discharging = 69
Usage ID 0x45: “Discharging”
FullyCharged = 70
Usage ID 0x46: “Fully Charged”
FullyDischarged = 71
Usage ID 0x47: “Fully Discharged”
ConditioningFlag = 72
Usage ID 0x48: “Conditioning Flag”
AtRateOK = 73
Usage ID 0x49: “At Rate OK”
SmartBatteryErrorCode = 74
Usage ID 0x4A: “Smart Battery Error Code”
NeedReplacement = 75
Usage ID 0x4B: “Need Replacement”
AtRateTimeToFull = 96
Usage ID 0x60: “At Rate Time To Full”
AtRateTimeToEmpty = 97
Usage ID 0x61: “At Rate Time To Empty”
AverageCurrent = 98
Usage ID 0x62: “Average Current”
MaxError = 99
Usage ID 0x63: “Max Error”
RelativeStateOfCharge = 100
Usage ID 0x64: “Relative State Of Charge”
AbsoluteStateOfCharge = 101
Usage ID 0x65: “Absolute State Of Charge”
RemainingCapacity = 102
Usage ID 0x66: “Remaining Capacity”
FullChargeCapacity = 103
Usage ID 0x67: “Full Charge Capacity”
RunTimeToEmpty = 104
Usage ID 0x68: “Run Time To Empty”
AverageTimeToEmpty = 105
Usage ID 0x69: “Average Time To Empty”
AverageTimeToFull = 106
Usage ID 0x6A: “Average Time To Full”
CycleCount = 107
Usage ID 0x6B: “Cycle Count”
BatteryPackModelLevel = 128
Usage ID 0x80: “Battery Pack Model Level”
InternalChargeController = 129
Usage ID 0x81: “Internal Charge Controller”
PrimaryBatterySupport = 130
Usage ID 0x82: “Primary Battery Support”
DesignCapacity = 131
Usage ID 0x83: “Design Capacity”
SpecificationInfo = 132
Usage ID 0x84: “Specification Info”
ManufactureDate = 133
Usage ID 0x85: “Manufacture Date”
SerialNumber = 134
Usage ID 0x86: “Serial Number”
iManufacturerName = 135
Usage ID 0x87: “iManufacturer Name”
iDeviceName = 136
Usage ID 0x88: “iDevice Name”
iDeviceChemistry = 137
Usage ID 0x89: “iDevice Chemistry”
ManufacturerData = 138
Usage ID 0x8A: “Manufacturer Data”
Rechargable = 139
Usage ID 0x8B: “Rechargable”
WarningCapacityLimit = 140
Usage ID 0x8C: “Warning Capacity Limit”
CapacityGranularity1 = 141
Usage ID 0x8D: “Capacity Granularity 1”
CapacityGranularity2 = 142
Usage ID 0x8E: “Capacity Granularity 2”
iOEMInformation = 143
Usage ID 0x8F: “iOEM Information”
InhibitCharge = 192
Usage ID 0xC0: “Inhibit Charge”
EnablePolling = 193
Usage ID 0xC1: “Enable Polling”
ResetToZero = 194
Usage ID 0xC2: “Reset To Zero”
ACPresent = 208
Usage ID 0xD0: “AC Present”
BatteryPresent = 209
Usage ID 0xD1: “Battery Present”
PowerFail = 210
Usage ID 0xD2: “Power Fail”
AlarmInhibited = 211
Usage ID 0xD3: “Alarm Inhibited”
ThermistorUnderRange = 212
Usage ID 0xD4: “Thermistor Under Range”
ThermistorHot = 213
Usage ID 0xD5: “Thermistor Hot”
ThermistorCold = 214
Usage ID 0xD6: “Thermistor Cold”
ThermistorOverRange = 215
Usage ID 0xD7: “Thermistor Over Range”
VoltageOutOfRange = 216
Usage ID 0xD8: “Voltage Out Of Range”
CurrentOutOfRange = 217
Usage ID 0xD9: “Current Out Of Range”
CurrentNotRegulated = 218
Usage ID 0xDA: “Current Not Regulated”
VoltageNotRegulated = 219
Usage ID 0xDB: “Voltage Not Regulated”
MasterMode = 220
Usage ID 0xDC: “Master Mode”
ChargerSelectorSupport = 240
Usage ID 0xF0: “Charger Selector Support”
ChargerSpec = 241
Usage ID 0xF1: “Charger Spec”
Level2 = 242
Usage ID 0xF2: “Level 2”
Level3 = 243
Usage ID 0xF3: “Level 3”
Implementations§
Trait Implementations§
Source§impl AsUsage for BatterySystem
impl AsUsage for BatterySystem
Source§fn usage_value(&self) -> u32
fn usage_value(&self) -> u32
Returns the 32 bit Usage value of this Usage
Source§fn usage_id_value(&self) -> u16
fn usage_id_value(&self) -> u16
Returns the 16 bit Usage ID value of this Usage
Source§fn usage(&self) -> Usage
fn usage(&self) -> Usage
Returns this usage as Usage::BatterySystem(self)
This is a convenience function to avoid having
to implement From for every used type in the caller.
let gd_x = GenericDesktop::X;
let usage = Usage::from(GenericDesktop::X);
assert!(matches!(gd_x.usage(), usage));Source§impl AsUsagePage for BatterySystem
impl AsUsagePage for BatterySystem
Source§fn usage_page_value(&self) -> u16
fn usage_page_value(&self) -> u16
Returns the 16 bit value of this UsagePage
This value is 0x85 for BatterySystem
Source§fn usage_page(&self) -> UsagePage
fn usage_page(&self) -> UsagePage
Returns UsagePage::BatterySystem]
Source§impl BitOr<u16> for BatterySystem
impl BitOr<u16> for BatterySystem
Source§impl Clone for BatterySystem
impl Clone for BatterySystem
Source§fn clone(&self) -> BatterySystem
fn clone(&self) -> BatterySystem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BatterySystem
impl Debug for BatterySystem
Source§impl Display for BatterySystem
Available on crate feature std only.
impl Display for BatterySystem
std only.Source§impl From<&BatterySystem> for Usage
impl From<&BatterySystem> for Usage
Source§fn from(batterysystem: &BatterySystem) -> Usage
fn from(batterysystem: &BatterySystem) -> Usage
Source§impl From<&BatterySystem> for UsagePage
impl From<&BatterySystem> for UsagePage
Source§fn from(_: &BatterySystem) -> UsagePage
fn from(_: &BatterySystem) -> UsagePage
Always returns UsagePage::BatterySystem and is identical to BatterySystem::usage_page().
Source§impl From<&BatterySystem> for u16
impl From<&BatterySystem> for u16
Source§fn from(batterysystem: &BatterySystem) -> u16
fn from(batterysystem: &BatterySystem) -> u16
Source§impl From<&BatterySystem> for u32
impl From<&BatterySystem> for u32
Source§fn from(batterysystem: &BatterySystem) -> u32
fn from(batterysystem: &BatterySystem) -> u32
Returns the 32 bit value of this usage. This is identical to BatterySystem::usage_value().
Source§impl From<BatterySystem> for Usage
impl From<BatterySystem> for Usage
Source§fn from(batterysystem: BatterySystem) -> Usage
fn from(batterysystem: BatterySystem) -> Usage
Source§impl From<BatterySystem> for UsagePage
impl From<BatterySystem> for UsagePage
Source§fn from(_: BatterySystem) -> UsagePage
fn from(_: BatterySystem) -> UsagePage
Always returns UsagePage::BatterySystem and is identical to BatterySystem::usage_page().
Source§impl From<BatterySystem> for u16
impl From<BatterySystem> for u16
Source§fn from(batterysystem: BatterySystem) -> u16
fn from(batterysystem: BatterySystem) -> u16
Returns the 16bit value of this usage. This is identical to BatterySystem::usage_page_value().