mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 01:41:12 +03:00
Added initial interfaces and some sensors implementing them
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
6bf21a23e7
commit
f035470822
@ -67,6 +67,11 @@ MCP9808::getTemp(){
|
||||
return getTempValue(result);
|
||||
}
|
||||
|
||||
float
|
||||
MCP9808::getTemperature() {
|
||||
return getTemp();
|
||||
}
|
||||
|
||||
void
|
||||
MCP9808::shutDown(bool sleep){
|
||||
if(sleep) this->updateConfigRegister(MCP9808_CONFIG_SHUTDOWN);
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <interfaces/iTemperature.hpp>
|
||||
|
||||
#define MCP9808_REG_CONFIG 0x01
|
||||
#define MCP9808_REG_AMBIENT_TEMP 0x05
|
||||
@ -75,7 +76,7 @@ namespace upm {
|
||||
* @image html mcp9808.jpg
|
||||
* @snippet mcp9808.cxx Interesting
|
||||
*/
|
||||
class MCP9808 {
|
||||
class MCP9808 : virtual public iTemperature {
|
||||
|
||||
public:
|
||||
/**
|
||||
@ -177,6 +178,13 @@ namespace upm {
|
||||
*/
|
||||
float getTemp(void);
|
||||
|
||||
/**
|
||||
* Returns the temperature in degrees Celsius
|
||||
*
|
||||
* @return The Temperature in degrees Celsius
|
||||
*/
|
||||
virtual float getTemperature();
|
||||
|
||||
/**
|
||||
* Will cause the devices to either sleep or wakeup.
|
||||
*
|
||||
|
Reference in New Issue
Block a user