Added initial interfaces and some sensors implementing them

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Mihai Stefanescu
2018-06-12 18:46:49 +03:00
committed by Mihai Tudor Panu
parent 6bf21a23e7
commit f035470822
102 changed files with 1183 additions and 182 deletions

View File

@@ -189,6 +189,12 @@ TSL2561::getLux()
return lux;
}
float
TSL2561::getLuminance()
{
return getLux();
}
mraa::Result
TSL2561::i2cWriteReg (uint8_t reg, uint8_t value)

View File

@@ -31,6 +31,7 @@
#include <string>
#include <mraa/i2c.hpp>
#include <math.h>
#include <interfaces/iLight.hpp>
namespace upm {
@@ -108,14 +109,14 @@ namespace upm {
* @kit eak
*
* @brief API for the TSL2561 Digital Light Sensor
*
*
* TSL2560 and TSL2561 are light-to-digital converters that transform
* light intensity to a digital signal output capable of a direct I2C (TSL2561) interface
*
* @image html tsl2561.jpg
* @snippet tsl2561.cxx Interesting
*/
class TSL2561{
class TSL2561 : virtual public iLight {
public:
/**
* Instantiates a TSL2561 object
@@ -139,6 +140,13 @@ class TSL2561{
*/
int getLux();
/**
* Gets the calculated lux reading from TSL2561
*
* @return Calculated lux value from the sensor
*/
virtual float getLuminance();
private:
/**
* Writes to a TSL2561 register