The MGC3130 is the world’s first electrical-field (E-field) based three-dimensional (3D) tracking and gesture controller

Dependencies:   BufferedArray

Dependents:   NucleoMGC3130 i2c_master

Committer:
yangcq88517
Date:
Wed Oct 07 20:43:39 2015 +0000
Revision:
1:621c4e9238ef
add new functions

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yangcq88517 1:621c4e9238ef 1 #ifndef UK_AC_HERTS_SMARTLAB_MGC3130_Parameter
yangcq88517 1:621c4e9238ef 2 #define UK_AC_HERTS_SMARTLAB_MGC3130_Parameter
yangcq88517 1:621c4e9238ef 3
yangcq88517 1:621c4e9238ef 4 #include "mbed.h"
yangcq88517 1:621c4e9238ef 5
yangcq88517 1:621c4e9238ef 6 class Parameter
yangcq88517 1:621c4e9238ef 7 {
yangcq88517 1:621c4e9238ef 8 protected:
yangcq88517 1:621c4e9238ef 9 char value[12];
yangcq88517 1:621c4e9238ef 10
yangcq88517 1:621c4e9238ef 11 public:
yangcq88517 1:621c4e9238ef 12 static const int Length = 12;
yangcq88517 1:621c4e9238ef 13
yangcq88517 1:621c4e9238ef 14 char * gets() {
yangcq88517 1:621c4e9238ef 15 return value;
yangcq88517 1:621c4e9238ef 16 }
yangcq88517 1:621c4e9238ef 17
yangcq88517 1:621c4e9238ef 18 void setRuntimeParameterID(int id) {
yangcq88517 1:621c4e9238ef 19 value[0] = id;
yangcq88517 1:621c4e9238ef 20 value[1] = id >> 8;
yangcq88517 1:621c4e9238ef 21 }
yangcq88517 1:621c4e9238ef 22
yangcq88517 1:621c4e9238ef 23 void setArgument0(long arg0) {
yangcq88517 1:621c4e9238ef 24 value[4] = arg0;
yangcq88517 1:621c4e9238ef 25 value[5] = arg0 >> 8;
yangcq88517 1:621c4e9238ef 26 value[6] = arg0 >> 16;
yangcq88517 1:621c4e9238ef 27 value[7] = arg0 >> 24;
yangcq88517 1:621c4e9238ef 28 }
yangcq88517 1:621c4e9238ef 29
yangcq88517 1:621c4e9238ef 30 void setArgument1(long arg1) {
yangcq88517 1:621c4e9238ef 31 value[8] = arg1;
yangcq88517 1:621c4e9238ef 32 value[9] = arg1 >> 8;
yangcq88517 1:621c4e9238ef 33 value[10] = arg1 >> 16;
yangcq88517 1:621c4e9238ef 34 value[11] = arg1 >> 24;
yangcq88517 1:621c4e9238ef 35 }
yangcq88517 1:621c4e9238ef 36 };
yangcq88517 1:621c4e9238ef 37
yangcq88517 1:621c4e9238ef 38 #endif