mirror of
https://github.com/eclipse/upm.git
synced 2025-07-03 18:31:13 +03:00
Added interfaces iEC,iEmg,iClock,iHeartRate,iLineFinder
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
This commit is contained in:

committed by
Serban Waltter

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