line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#########################################################################################
|
2
|
|
|
|
|
|
|
# Package HiPi::Interface::MCP3008
|
3
|
|
|
|
|
|
|
# Description: compatibility
|
4
|
|
|
|
|
|
|
# Copyright : Copyright (c) 2013-2017 Mark Dootson
|
5
|
|
|
|
|
|
|
# License : This is free software; you can redistribute it and/or modify it under
|
6
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself.
|
7
|
|
|
|
|
|
|
#########################################################################################
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package HiPi::Interface::MCP3008;
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#########################################################################################
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
1092
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
14
|
1
|
|
|
1
|
|
5
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
5
|
use parent qw( HiPi::Interface::MCP3ADC );
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
17
|
1
|
|
|
1
|
|
61
|
use HiPi qw( :mcp3adc );
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
457
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.59';
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our @EXPORT = ();
|
22
|
|
|
|
|
|
|
our @EXPORT_OK = ();
|
23
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( all => \@EXPORT_OK );
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# compatibility
|
26
|
|
|
|
|
|
|
{
|
27
|
|
|
|
|
|
|
my @const = qw(
|
28
|
|
|
|
|
|
|
MCP3008_S0 MCP3008_S1 MCP3008_S2 MCP3008_S3
|
29
|
|
|
|
|
|
|
MCP3008_S4 MCP3008_S5 MCP3008_S6 MCP3008_S7
|
30
|
|
|
|
|
|
|
MCP3008_DIFF_0_1 MCP3008_DIFF_1_0 MCP3008_DIFF_2_3
|
31
|
|
|
|
|
|
|
MCP3008_DIFF_3_2 MCP3008_DIFF_4_5 MCP3008_DIFF_5_4
|
32
|
|
|
|
|
|
|
MCP3008_DIFF_6_7 MCP3008_DIFF_7_6
|
33
|
|
|
|
|
|
|
);
|
34
|
|
|
|
|
|
|
push( @EXPORT_OK, @const );
|
35
|
|
|
|
|
|
|
$EXPORT_TAGS{mcp} = \@const;
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub new {
|
39
|
0
|
|
|
0
|
0
|
|
my ($class, %params) = @_;
|
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
$params{ic} = MCP3008;
|
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new( %params );
|
44
|
0
|
|
|
|
|
|
return $self;
|
45
|
|
|
|
|
|
|
}
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1;
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__
|