Device::Chip::ADT7470 - chip driver for an ADT7470
Device::Chip::ADT7470
use Device::Chip::ADT7470; my $chip = Device::Chip::ADT7470->new; $chip->mount( Device::Chip::Adapter::...->new )->get; printf "Current fan 1 speed is %d rpm\n", $chip->read_fan_rpm( 1 )->get;
This Device::Chip subclass provides specific communication to a Analog Devices ADT7470 attached to a computer via an I²C adapter.
Only a subset of the chip's capabilities are currently accessible through this driver.
The reader is presumed to be familiar with the general operation of this chip; the documentation here will not attempt to explain or define chip-specific concepts or features, only the use of this module to access them.
The I²C address of the device. Can be specified in decimal, octal or hex with leading 0 or 0x prefixes.
0
0x
The following methods documented with a trailing call to ->get return Future instances.
->get
$config = $chip->read_config->get
Returns a HASH reference of the contents of the user register.
HASH
STRT => 0 | 1 TODIS => 0 | 1 LOCK => 0 | 1 (power cycle to unlock) FST_TCH => 0 | 1 HF_LF => 0 | 1 T05_STB => 0 | 1
$chip->change_config( %config )->get
Changes the configuration. Any field names not mentioned will be preserved.
$duty = $chip->read_duty( $fan )->get
Returns the pwm duty cycle for the specified fan (1-4).
$duty = $chip->read_duty_percent( $fan )->get
Returns the pwm duty cycle as a percentage for the specified fan (1-4).
$duty = $chip->write_duty( $fan, $duty )->get
Writes the pwm duty cycle for the specified fan.
$duty = $chip->write_duty_percent( $fan, $percent )->get
Writes the pwm duty cycle as a percentage for the specified fan.
$rpm = $chip->read_fan_rpm( $fan )->get
Read the fan rpm for the specified fan.
To install Device::Chip::ADT7470, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Chip::ADT7470
CPAN shell
perl -MCPAN -e shell install Device::Chip::ADT7470
For more information on module installation, please visit the detailed CPAN module installation guide.