mirror of
https://github.com/eclipse/upm.git
synced 2025-07-26 21:51:16 +03:00
Added iGyroscope interface
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
34bb12933d
commit
aa966946d5
@ -5,5 +5,6 @@ upm_mixed_module_init (NAME bmg160
|
||||
CPP_HDR bmg160.hpp
|
||||
CPP_SRC bmg160.cxx
|
||||
FTI_SRC bmg160_fti.c
|
||||
IFACE_HDR iGyroscope.hpp
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -108,6 +108,7 @@ void BMG160::getGyroscope(float *x, float *y, float *z)
|
||||
|
||||
std::vector<float> BMG160::getGyroscope()
|
||||
{
|
||||
update();
|
||||
float v[3];
|
||||
|
||||
getGyroscope(&v[0], &v[1], &v[2]);
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include <mraa/gpio.hpp>
|
||||
#include "bmg160.h"
|
||||
|
||||
#include <interfaces/iGyroscope.hpp>
|
||||
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
@ -71,7 +73,7 @@ namespace upm {
|
||||
* @snippet bmg160.cxx Interesting
|
||||
*/
|
||||
|
||||
class BMG160 {
|
||||
class BMG160: virtual public iGyroscope {
|
||||
public:
|
||||
/**
|
||||
* BMG160 constructor.
|
||||
|
@ -1,26 +1,22 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") a110x
|
||||
#endif
|
||||
|
||||
%import "interfaces/interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%include "../upm_javastdvector.i"
|
||||
|
||||
%ignore installISR (BMG160_INTERRUPT_PINS_T , int mraa::Edge , void *, void *);
|
||||
%ignore getGyroscope(float *, float *, float *);
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%typemap(javaout) SWIGTYPE {
|
||||
return new $&javaclassname($jnicall, true);
|
||||
}
|
||||
%typemap(javaout) std::vector<float> {
|
||||
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
||||
}
|
||||
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
||||
|
||||
%template(floatVector) std::vector<float>;
|
||||
%ignore installISR (BMG160_INTERRUPT_PINS_T , int mraa::Edge , void *, void *);
|
||||
%ignore getGyroscope(float *, float *, float *);
|
||||
|
||||
%define INTERRUPT BMG160_INTERRUPT_PINS_T
|
||||
%enddef
|
||||
|
Reference in New Issue
Block a user