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:
Tue Oct 06 22:35:38 2015 +0000
Revision:
0:92f17b057d6b
Child:
1:621c4e9238ef
The MGC3130 is the world?s first electrical-field (E-field) based three-dimensional (3D) tracking and gesture controller

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yangcq88517 0:92f17b057d6b 1 #ifndef UK_AC_HERTS_SMARTLAB_MGC3130
yangcq88517 0:92f17b057d6b 2 #define UK_AC_HERTS_SMARTLAB_MGC3130
yangcq88517 0:92f17b057d6b 3
yangcq88517 0:92f17b057d6b 4 #include "mbed.h"
yangcq88517 0:92f17b057d6b 5 #include "GestICMsg.h"
yangcq88517 0:92f17b057d6b 6 #include "SensorData.h"
yangcq88517 0:92f17b057d6b 7
yangcq88517 0:92f17b057d6b 8 class MGC3130
yangcq88517 0:92f17b057d6b 9 {
yangcq88517 0:92f17b057d6b 10 private:
yangcq88517 0:92f17b057d6b 11 static const int FREQUENCY_STANDARD = 100000;
yangcq88517 0:92f17b057d6b 12 static const int FREQUENCY_FULL = 400000;
yangcq88517 0:92f17b057d6b 13 static const int FREQUENCY_FAST = 1000000;
yangcq88517 0:92f17b057d6b 14 static const int FREQUENCY_HIGH = 3200000;
yangcq88517 0:92f17b057d6b 15
yangcq88517 0:92f17b057d6b 16 // EI0 Pin
yangcq88517 0:92f17b057d6b 17 // The TS line is used to check whether the I2C data is valid and can be sent from MGC3X30 to the host controller.
yangcq88517 0:92f17b057d6b 18 DigitalInOut TS_Line;
yangcq88517 0:92f17b057d6b 19
yangcq88517 0:92f17b057d6b 20 I2C _i2c_bus;
yangcq88517 0:92f17b057d6b 21 int _speed;
yangcq88517 0:92f17b057d6b 22 int _addr;
yangcq88517 0:92f17b057d6b 23 GestICMsg msg;
yangcq88517 0:92f17b057d6b 24 SensorData sensor;
yangcq88517 0:92f17b057d6b 25
yangcq88517 0:92f17b057d6b 26 public:
yangcq88517 0:92f17b057d6b 27 MGC3130(PinName sda, PinName scl, PinName EI0, bool IS2);
yangcq88517 0:92f17b057d6b 28
yangcq88517 0:92f17b057d6b 29 GestICMsg * readMsg();
yangcq88517 0:92f17b057d6b 30
yangcq88517 0:92f17b057d6b 31 SensorData * readSensorData();
yangcq88517 0:92f17b057d6b 32 };
yangcq88517 0:92f17b057d6b 33
yangcq88517 0:92f17b057d6b 34 #endif