NAME

Device::Chip::ADT7470 - chip driver for an ADT7470

SYNOPSIS

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;

DESCRIPTION

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.

MOUNT PARAMETERS

addr

The I²C address of the device. Can be specified in decimal, octal or hex with leading 0 or 0x prefixes.

METHODS

The following methods documented with a trailing call to ->get return Future instances.

read_config

$config = $chip->read_config->get

Returns a HASH reference of the contents of the user register.

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

change_config

$chip->change_config( %config )->get

Changes the configuration. Any field names not mentioned will be preserved.

read_duty

$duty = $chip->read_duty( $fan )->get

Returns the pwm duty cycle for the specified fan (1-4).

read_duty_percent

$duty = $chip->read_duty_percent( $fan )->get

Returns the pwm duty cycle as a percentage for the specified fan (1-4).

write_duty

$duty = $chip->write_duty( $fan, $duty )->get

Writes the pwm duty cycle for the specified fan.

write_duty_percent

$duty = $chip->write_duty_percent( $fan, $percent )->get

Writes the pwm duty cycle as a percentage for the specified fan.

read_fan_rpm

$rpm = $chip->read_fan_rpm( $fan )->get

Read the fan rpm for the specified fan.