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
This commit is contained in:

committed by
Serban Waltter

parent
85608a9f61
commit
e7820f2831
@ -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;
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user