upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 
29 namespace upm {
76  class RSC {
77 
78  public:
93  RSC(uint8_t bus, uint8_t cs_ee_pin, uint8_t cs_adc_pin);
94 
98  ~RSC();
99 
106  std::string getSensorName();
107 
114  std::string getSensorSerialNumber();
115 
123  float getPressureRange();
124 
132  float getMinimumPressure();
133 
151  std::string getPressureUnit();
152 
163  std::string getPressureType();
164 
172  uint8_t *getInitialADCState();
173 
180  void updateCoefficients();
181 
189  void setupADC(uint8_t* adc_init_values);
190 
196  float getTemperature();
197 
203  float getPressure();
204 
214  void setMode(RSC_MODE mode);
215 
242  void setDataRate(RSC_DATA_RATE dr);
243 
244  private:
245  rsc_context m_rsc;
246  RSC(const RSC& src) { /* do not create copied */}
247  RSC& operator=(const RSC&) {return *this;}
248  uint8_t m_adc_coeff[4];
249  };
250 }
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 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:76