Expand description
Regulator abstractions, providing a standard kernel interface to control voltage and current regulators.
The intention is to allow systems to dynamically control regulator power output in order to save power and prolong battery life. This applies to both voltage regulators (where voltage output is controllable) and current sinks (where current limit is controllable).
C header: include/linux/regulator/consumer.h
Regulators are modeled in Rust with a collection of states. Each state may enforce a given invariant, and they may convert between each other where applicable.
See Voltage and current regulator API for more information.
Structs§
- Disabled
- A state where this
Regulator
handle has not specifically asked for the underlying regulator to be enabled. This means that this reference does not own anenable
reference count, but the regulator may still be on. - Dynamic
- A state that models the C API. The
Regulator
can be either enabled or disabled, and the user is in control of the reference count. This is also the default state. - Enabled
- A state where the
Regulator
is known to be enabled. - Error
- An error that can occur when trying to convert a
Regulator
between states. - Regulator
- A
struct regulator
abstraction. - Voltage
- A voltage.
Traits§
- IsEnabled
- A trait that abstracts the ability to check if a
Regulator
is enabled. - Regulator
State - A trait representing the different states a
Regulator
can be in.