Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NucleoMGC3130 i2c_master
TouchInfo.cpp
00001 #include "TouchInfo.h" 00002 00003 void TouchInfo::set(int touchEvent, int counter) 00004 { 00005 value = touchEvent; 00006 count = counter; 00007 } 00008 00009 /* 00010 Touch Counter: 8-bit counter; this counter determines the 00011 period between the time when the hand starts moving to 00012 touch until it is detected. This period is equal to [Touch 00013 Counter Value] x 5 (ms). The counter starts counting when 00014 the minimum approach speed required to detect a touch 00015 event is exceeded, until the touch is detected. After each 00016 touch detection, the counter is reset. 00017 */ 00018 int TouchInfo::getCounter() 00019 { 00020 return count; 00021 } 00022 00023 bool TouchInfo::isTouchSouthElectrode() 00024 { 00025 return (value & TouchSouthElectrode) == TouchSouthElectrode? true : false; 00026 } 00027 00028 bool TouchInfo::isTouchWestElectrode() 00029 { 00030 return (value & TouchWestElectrode) == TouchWestElectrode? true : false; 00031 } 00032 00033 bool TouchInfo::isTouchNorthElectrode() 00034 { 00035 return (value & TouchNorthElectrode) == TouchNorthElectrode? true : false; 00036 } 00037 00038 bool TouchInfo::isTouchEastElectrode() 00039 { 00040 return (value & TouchEastElectrode) == TouchEastElectrode? true : false; 00041 } 00042 00043 bool TouchInfo::isTouchCenterElectrode() 00044 { 00045 return (value & TouchCenterElectrode) == TouchCenterElectrode? true : false; 00046 } 00047 00048 bool TouchInfo::isTapSouthElectrode() 00049 { 00050 return (value & TapSouthElectrode) == TapSouthElectrode? true : false; 00051 } 00052 00053 bool TouchInfo::isTapWestElectrode() 00054 { 00055 return (value & TapWestElectrode) == TapWestElectrode? true : false; 00056 } 00057 00058 bool TouchInfo::isTapNorthElectrode() 00059 { 00060 return (value & TapNorthElectrode) == TapNorthElectrode? true : false; 00061 } 00062 00063 bool TouchInfo::isTapEastElectrode() 00064 { 00065 return (value & TapEastElectrode) == TapEastElectrode? true : false; 00066 } 00067 00068 bool TouchInfo::isTapCenterElectrode() 00069 { 00070 return (value & TapCenterElectrode) == TapCenterElectrode? true : false; 00071 } 00072 00073 bool TouchInfo::isDoubleTapSouthElectrode() 00074 { 00075 return (value & DoubleTapSouthElectrode) == DoubleTapSouthElectrode? true : false; 00076 } 00077 00078 bool TouchInfo::isDoubleTapWestElectrode() 00079 { 00080 return (value & DoubleTapWestElectrode) == DoubleTapWestElectrode? true : false; 00081 } 00082 00083 bool TouchInfo::isDoubleTapNorthElectrode() 00084 { 00085 return (value & DoubleTapNorthElectrode) == DoubleTapNorthElectrode? true : false; 00086 } 00087 00088 bool TouchInfo::isDoubleTapEastElectrode() 00089 { 00090 return (value & DoubleTapEastElectrode) == DoubleTapEastElectrode? true : false; 00091 } 00092 00093 bool TouchInfo::isDoubleTapCenterElectrode() 00094 { 00095 return (value & DoubleTapCenterElectrode) == DoubleTapCenterElectrode? true : false; 00096 }
Generated on Fri Jul 15 2022 02:54:57 by
