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:
Thu Oct 08 17:37:33 2015 +0000
Revision:
3:b657bfcffc0a
bug fix, add some runtime message

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yangcq88517 3:b657bfcffc0a 1 #ifndef UK_AC_HERTS_SMARTLAB_MGC3130_Trigger
yangcq88517 3:b657bfcffc0a 2 #define UK_AC_HERTS_SMARTLAB_MGC3130_Trigger
yangcq88517 3:b657bfcffc0a 3
yangcq88517 3:b657bfcffc0a 4 #include "Parameter.h"
yangcq88517 3:b657bfcffc0a 5
yangcq88517 3:b657bfcffc0a 6 class Trigger: public Parameter
yangcq88517 3:b657bfcffc0a 7 {
yangcq88517 3:b657bfcffc0a 8 public:
yangcq88517 3:b657bfcffc0a 9 /// The default setting will be force re-calibration.
yangcq88517 3:b657bfcffc0a 10 Trigger() {
yangcq88517 3:b657bfcffc0a 11 setRuntimeParameterID(0x1000);
yangcq88517 3:b657bfcffc0a 12 }
yangcq88517 3:b657bfcffc0a 13
yangcq88517 3:b657bfcffc0a 14 /// Force re-calibration.
yangcq88517 3:b657bfcffc0a 15 void ForceRecalibration() {
yangcq88517 3:b657bfcffc0a 16 setArgument0(0x00);
yangcq88517 3:b657bfcffc0a 17 }
yangcq88517 3:b657bfcffc0a 18
yangcq88517 3:b657bfcffc0a 19 /**
yangcq88517 3:b657bfcffc0a 20 *Enter Deep Sleep 1: The wake-up sources from
yangcq88517 3:b657bfcffc0a 21 *Deep Sleep 1 are I2C0 Start bit detection or
yangcq88517 3:b657bfcffc0a 22 *MCLR Reset.
yangcq88517 3:b657bfcffc0a 23 *The system will resume from Deep Sleep on any
yangcq88517 3:b657bfcffc0a 24 *I2C messages sent on the bus, and the first I2C
yangcq88517 3:b657bfcffc0a 25 *message will be lost.
yangcq88517 3:b657bfcffc0a 26 */
yangcq88517 3:b657bfcffc0a 27 void EnterDeepSleep1() {
yangcq88517 3:b657bfcffc0a 28 setArgument0(0x00000002);
yangcq88517 3:b657bfcffc0a 29 }
yangcq88517 3:b657bfcffc0a 30
yangcq88517 3:b657bfcffc0a 31 /**
yangcq88517 3:b657bfcffc0a 32 *Enter Deep Sleep 2: The wake-up source from
yangcq88517 3:b657bfcffc0a 33 *Deep Sleep 2 is a falling edge on External Interrupt
yangcq88517 3:b657bfcffc0a 34 *(IRQ0) or MCLR Reset.
yangcq88517 3:b657bfcffc0a 35 *The IRQ0 (EIO2) should be tied to High when this
yangcq88517 3:b657bfcffc0a 36 *command is sent unless the MGC3X30 resumes
yangcq88517 3:b657bfcffc0a 37 *directly after receiving it.
yangcq88517 3:b657bfcffc0a 38 */
yangcq88517 3:b657bfcffc0a 39 void EnterDeepSleep2() {
yangcq88517 3:b657bfcffc0a 40 setArgument0(0x00000003);
yangcq88517 3:b657bfcffc0a 41 }
yangcq88517 3:b657bfcffc0a 42 };
yangcq88517 3:b657bfcffc0a 43
yangcq88517 3:b657bfcffc0a 44 #endif