line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
13389
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
2
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Device::LPS331AP; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# PODNAME: Device::LPS331AP |
7
|
|
|
|
|
|
|
# ABSTRACT: I2C interface to LPS331AP Thermometer and Barometer using Device::SMBus |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# This file is part of Device-LPS331AP |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# This software is copyright (c) 2015 by Shantanu Bhadoria. |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
14
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
our $VERSION = '0.005'; # VERSION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Dependencies |
19
|
1
|
|
|
1
|
|
13
|
use 5.010; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
20
|
1
|
|
|
1
|
|
437
|
use Moose; |
|
1
|
|
|
|
|
295964
|
|
|
1
|
|
|
|
|
6
|
|
21
|
1
|
|
|
1
|
|
4703
|
use POSIX; |
|
1
|
|
|
|
|
3652
|
|
|
1
|
|
|
|
|
4
|
|
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
1
|
|
1779
|
use Device::Altimeter::LPS331AP; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
89
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has 'I2CBusDevicePath' => ( is => 'ro', ); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has Altimeter => ( |
30
|
|
|
|
|
|
|
is => 'ro', |
31
|
|
|
|
|
|
|
isa => 'Device::Altimeter::LPS331AP', |
32
|
|
|
|
|
|
|
lazy_build => 1, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub _build_Altimeter { |
36
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
37
|
0
|
|
|
|
|
|
my $obj = |
38
|
|
|
|
|
|
|
Device::Altimeter::LPS331AP->new( |
39
|
|
|
|
|
|
|
I2CBusDevicePath => $self->I2CBusDevicePath ); |
40
|
0
|
|
|
|
|
|
return $obj; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=pod |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Device::LPS331AP - I2C interface to LPS331AP Thermometer and Barometer using Device::SMBus |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 VERSION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
version 0.005 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 I2CBusDevicePath |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
this is the device file path for your I2CBus that the LPS331AP is connected on e.g. /dev/i2c-1 |
62
|
|
|
|
|
|
|
This must be provided during object creation. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 Altimeter |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
$self->Altimeter->enable(); |
67
|
|
|
|
|
|
|
$self->Altimeter->getReading(); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is a object of L<Device::Altimeter::LPS331AP> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SUPPORT |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 Bugs / Feature Requests |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Please report any bugs or feature requests through github at |
78
|
|
|
|
|
|
|
L<https://github.com/shantanubhadoria/perl-device-lps331ap/issues>. |
79
|
|
|
|
|
|
|
You will be notified automatically of any progress on your issue. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 Source Code |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This is open source software. The code repository is available for |
84
|
|
|
|
|
|
|
public review and contribution under the terms of the license. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
L<https://github.com/shantanubhadoria/perl-device-lps331ap> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
git clone git://github.com/shantanubhadoria/perl-device-lps331ap.git |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 AUTHOR |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Shantanu Bhadoria <shantanu at cpan dott org> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 CONTRIBUTORS |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=for stopwords Shantanu Bhadoria |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=over 4 |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item * |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Shantanu <shantanu@cpan.org> |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Shantanu Bhadoria <shantanu@cpan.org> |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=back |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Shantanu Bhadoria. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
115
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |