Added interfaces iEC,iEmg,iClock,iHeartRate,iLineFinder

Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
This commit is contained in:
Stefan Andritoiu
2018-06-20 18:24:26 +03:00
committed by Serban Waltter
parent e7820f2831
commit 69464ae93b
22 changed files with 368 additions and 59 deletions

View File

@ -27,6 +27,7 @@
#include <stdint.h>
#include <sys/time.h>
#include <mraa/gpio.h>
#include <interfaces/iHeartRate.hpp>
namespace upm {
/**
@ -48,12 +49,12 @@ namespace upm {
* @brief API for the Grove Ear-clip Heart Rate Sensor
*
* UPM module for the Grove ear-clip heart rate sensor. It is used to measure your
* heart rate.
* heart rate.
*
* @image html groveehr.jpg
* @image html groveehr.jpg
* @snippet groveehr.cxx Interesting
*/
class GroveEHR {
class GroveEHR : virtual public iHeartRate {
public:
/**
* GroveEHR constructor
@ -112,17 +113,22 @@ namespace upm {
*/
int heartRate();
/**
* Retrieve the computed heart rate
*
* @return Computed heart rate
*/
virtual int getHeartRate();
private:
/**
* Beat interrupt service routine (ISR)
*
*/
static void beatISR(void *ctx);
volatile uint32_t m_beatCounter;
struct timeval m_startTime;
mraa_gpio_context m_gpio;
};
}