Added initial interfaces and some sensors implementing them

This commit is contained in:
Mihai Stefanescu
2018-06-12 18:46:49 +03:00
committed by Serban Waltter
parent 85608a9f61
commit e7820f2831
102 changed files with 1183 additions and 182 deletions

View File

@ -49,7 +49,7 @@ MAX31723::MAX31723 (int bus, int csn) : m_spi(bus), m_csnPinCtx(csn) {
writeRegister (R_STS_WRITE_CMD, B_CONT_READING);
}
short
float
MAX31723::getTemperature () {
uint8_t msb = 0;
short temperature = 0;

View File

@ -29,6 +29,7 @@
#include <mraa/gpio.hpp>
#include <mraa/spi.hpp>
#include <interfaces/iTemperature.hpp>
#define HIGH 1
#define LOW 0
@ -60,7 +61,7 @@ namespace upm {
*
* @snippet max31723.cxx Interesting
*/
class MAX31723 {
class MAX31723 : virtual public iTemperature {
public:
static const uint8_t R_STS_READ_CMD = 0x00;
static const uint8_t R_STS_WRITE_CMD = 0x80;
@ -85,9 +86,11 @@ class MAX31723 {
**/
/**
* Gets the on-board temperature.
* Returns the temperature in degrees Celsius
*
* @return The Temperature in degrees Celsius
*/
short getTemperature ();
virtual float getTemperature ();
/**
* Returns the name of the component