Set the POS interval to 240 seconds (255 would be the maximum.
[ruwai.git] / software / arduino / libraries / rw_pga281 / rw_pga281.h
blob229c6730c2941816bc08ab114d48a01f98e0ad27
1 // -*- coding: utf-8 -*-
2 // LICENSE
3 //
4 // This file is part of ruwai.
5 //
6 // If you use ruwai in any program or publication, please inform and
7 // acknowledge its author Stefan Mertl (stefan@mertl-research.at).
8 //
9 // pSysmon is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef rw_pga281_h
23 #define rw_pga281_h
25 #include <Arduino.h>
27 #define PCF_PORT_G0 0
28 #define PCF_PORT_G1 1
29 #define PCF_PORT_G2 2
30 #define PCF_PORT_G3 3
31 #define PCF_PORT_G4 4
32 #define PCF_PORT_EF 5
34 //! The supported gain types.
35 typedef enum pga_gain_e {
36 PGA_GAIN_0_125 = 0,
37 PGA_GAIN_0_25,
38 PGA_GAIN_0_5,
39 PGA_GAIN_1,
40 PGA_GAIN_2,
41 PGA_GAIN_4,
42 PGA_GAIN_8,
43 PGA_GAIN_16,
44 PGA_GAIN_32,
45 PGA_GAIN_64,
46 PGA_GAIN_128,
47 PGA_GAIN_0_172 = 16,
48 PGA_GAIN_0_344,
49 PGA_GAIN_0_688,
50 PGA_GAIN_1_375,
51 PGA_GAIN_2_75,
52 PGA_GAIN_5_5,
53 PGA_GAIN_11,
54 PGA_GAIN_22,
55 PGA_GAIN_44,
56 PGA_GAIN_88,
57 PGA_GAIN_176
58 } pga_gain_t;
60 //! The Ruwai PGA281 class.
61 /*!
62 * Detailed description.
64 class RwPga281
66 public:
67 /*! The constructor. */
68 RwPga281(uint8_t port_expander_address);
70 /*! Set the gain of the PGA. */
71 void set_gain(pga_gain_t pga_gain);
74 private:
75 uint8_t port_expander;
76 pga_gain_t gain;
79 #endif