Added iElectromagnet interface

Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Stefan Andritoiu
2018-06-20 18:35:30 +03:00
committed by Mihai Tudor Panu
parent b058d341c0
commit b917f0ca54
3 changed files with 57 additions and 8 deletions

View File

@ -24,6 +24,7 @@
#pragma once
#include <mraa/gpio.h>
#include <interfaces/iElectromagnet.hpp>
#define HIGH 1
#define LOW 0
@ -44,13 +45,13 @@ namespace upm {
* @con gpio
*
* @brief API for the Electromagnet
*
*
* The Electromagnet can hold up to 1 kg (approximately 2.2 lbs)
*
* @image html electromagnet.jpg
* @snippet electromagnet.cxx Interesting
*/
class Electromagnet {
class Electromagnet : virtual public iElectromagnet {
public:
/**
* Electromagnet constructor
@ -65,11 +66,11 @@ namespace upm {
/**
* Turns the magnet on
*/
void on();
virtual void on();
/**
* Turns the magnet off
*/
void off();
virtual void off();
private:
mraa_gpio_context m_gpio;

View File

@ -24,6 +24,7 @@
#pragma once
#include <mraa/gpio.h>
#include <interfaces/iElectromagnet.hpp>
#define HIGH 1
#define LOW 0
@ -46,13 +47,13 @@ namespace upm {
* @con gpio
*
* @brief API for the Grove Electromagnet
*
*
* The Grove Electromagnet can hold up to 1 kg (approximately 2.2 lbs)
*
* @image html groveelectromagnet.jpg
* @snippet groveelectromagnet.cxx Interesting
*/
class GroveElectromagnet {
class GroveElectromagnet : virtual public iElectromagnet {
public:
/**
* Grove Electromagnet constructor
@ -67,11 +68,11 @@ namespace upm {
/**
* Turns the magnet on
*/
void on();
virtual void on();
/**
* Turns the magnet off
*/
void off();
virtual void off();
private:
mraa_gpio_context m_gpio;