upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
rsc.hpp
1 /*
2  * Author: Abhishek Malik <abhishek.malik@intel.com>
3  * Copyright (c) 2017 Intel Corporation.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 
25 #pragma once
26 
27 #include "rsc.h"
28 #include <string>
29 
30 namespace upm {
77  class RSC {
78 
79  public:
94  RSC(uint8_t bus, uint8_t cs_ee_pin, uint8_t cs_adc_pin);
95 
99  ~RSC();
100 
107  std::string getSensorName();
108 
115  std::string getSensorSerialNumber();
116 
124  float getPressureRange();
125 
133  float getMinimumPressure();
134 
152  std::string getPressureUnit();
153 
164  std::string getPressureType();
165 
173  uint8_t *getInitialADCState();
174 
181  void updateCoefficients();
182 
190  void setupADC(uint8_t* adc_init_values);
191 
197  float getTemperature();
198 
204  float getPressure();
205 
215  void setMode(RSC_MODE mode);
216 
243  void setDataRate(RSC_DATA_RATE dr);
244 
245  private:
246  rsc_context m_rsc;
247  RSC(const RSC& src) { /* do not create copied */}
248  RSC& operator=(const RSC&) {return *this;}
249  uint8_t m_adc_coeff[4];
250  };
251 }
std::string getSensorSerialNumber()
Definition: rsc.cxx:59
~RSC()
Definition: rsc.cxx:42
RSC(uint8_t bus, uint8_t cs_ee_pin, uint8_t cs_adc_pin)
Default constructor for rsc.
Definition: rsc.cxx:34
float getTemperature()
Definition: rsc.cxx:164
void setupADC(uint8_t *adc_init_values)
Definition: rsc.cxx:156
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
C API for the rsc driver.
float getPressureRange()
Definition: rsc.cxx:71
std::string getPressureUnit()
Definition: rsc.cxx:81
uint8_t * getInitialADCState()
Definition: rsc.cxx:137
void setDataRate(RSC_DATA_RATE dr)
Definition: rsc.cxx:179
float getMinimumPressure()
Definition: rsc.cxx:76
void updateCoefficients()
Definition: rsc.cxx:148
std::string getPressureType()
Definition: rsc.cxx:115
std::string getSensorName()
Definition: rsc.cxx:47
void setMode(RSC_MODE mode)
Definition: rsc.cxx:174
float getPressure()
Definition: rsc.cxx:169
Definition: rsc.h:52
Description for the RSC TruStability line.
Definition: rsc.hpp:77