line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#########################################################################################
|
2
|
|
|
|
|
|
|
# Package HiPi::Interface::MCP3004
|
3
|
|
|
|
|
|
|
# Description: compatibility
|
4
|
|
|
|
|
|
|
# Created Sun Dec 02 01:42:27 2012
|
5
|
|
|
|
|
|
|
# Copyright : Copyright (c) 2013-2017 Mark Dootson
|
6
|
|
|
|
|
|
|
# License : This is free software; you can redistribute it and/or modify it under
|
7
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself.
|
8
|
|
|
|
|
|
|
#########################################################################################
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
package HiPi::Interface::MCP3004;
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#########################################################################################
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
1008
|
use strict;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
15
|
1
|
|
|
1
|
|
36
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
5
|
use parent qw( HiPi::Interface::MCP3ADC );
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
18
|
1
|
|
|
1
|
|
97
|
use HiPi qw( :mcp3adc );
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
478
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.59';
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our @EXPORT = ();
|
23
|
|
|
|
|
|
|
our @EXPORT_OK = ();
|
24
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( all => \@EXPORT_OK );
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# compatibility
|
27
|
|
|
|
|
|
|
{
|
28
|
|
|
|
|
|
|
my @const = qw(
|
29
|
|
|
|
|
|
|
MCP3004_S0 MCP3004_S1 MCP3004_S2 MCP3004_S3
|
30
|
|
|
|
|
|
|
MCP3004_DIFF_0_1 MCP3004_DIFF_1_0
|
31
|
|
|
|
|
|
|
MCP3004_DIFF_2_3 MCP3004_DIFF_3_2
|
32
|
|
|
|
|
|
|
);
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
push( @EXPORT_OK, @const );
|
35
|
|
|
|
|
|
|
$EXPORT_TAGS{mcp} = \@const;
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new {
|
40
|
0
|
|
|
0
|
0
|
|
my ($class, %params) = @_;
|
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$params{ic} = MCP3004;
|
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new( %params );
|
45
|
0
|
|
|
|
|
|
return $self;
|
46
|
|
|
|
|
|
|
}
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1;
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |