TTP229 16key touch keypad

Dependents:   TTP229_sample

Embed: (wiki syntax)

« Back to documentation index

TTP229 Class Reference

TTP229 Class Reference

16key touch keypad
Only supported 16key and active low mode
jamper settng : TP1=1(jamper2=open):active low, TP2=0(jamper3=close):16key mode
More...

#include <TTP229.h>

Public Member Functions

 TTP229 (PinName sdopin, PinName sclpin)
void attach (const FunctionPointer &fp)
 set function that is called at change state of keypad
FunctionPointer is a pointer to function(no param and void return)
bitset< 16 > getkeys ()
 get keypad status
 operator bitset< 16 > ()
 same as getkeys()
int onkey ()
 get keypad status especially singlekey mode(TP3=1,TP4=1)
bool ison (size_t i)
 Is number i(0~15) keypad touched?
bool operator[] (size_t i)
 same as ison()

Detailed Description

16key touch keypad
Only supported 16key and active low mode
jamper settng : TP1=1(jamper2=open):active low, TP2=0(jamper3=close):16key mode

Definition at line 10 of file TTP229.h.


Constructor & Destructor Documentation

TTP229 ( PinName  sdopin,
PinName  sclpin 
)
Parameters:
sdopinPinName that support DigitalIn and InterruptIn, connected to TTP229 SDO.
sclpinPinName that support DigitalOut, connected to TTP229 SCL.

Definition at line 3 of file TTP229.cpp.


Member Function Documentation

void attach ( const FunctionPointer &  fp )

set function that is called at change state of keypad
FunctionPointer is a pointer to function(no param and void return)

 void func();
 ttp229.attach(&func);

or to menber function(no param and void return)

 class Foo {
 public:
     void func();
 };
 Foo foo;   
 ttp229.attach(FunctionPointer(&foo, &Foo::func));

Definition at line 30 of file TTP229.h.

bitset<16> getkeys (  )

get keypad status

Definition at line 32 of file TTP229.h.

bool ison ( size_t  i )

Is number i(0~15) keypad touched?

Definition at line 39 of file TTP229.h.

int onkey (  )

get keypad status especially singlekey mode(TP3=1,TP4=1)

Returns:
touched keypad number(1~16) or 0:no keypad touched

Definition at line 37 of file TTP229.h.

operator bitset< 16 > (  )

same as getkeys()

Definition at line 34 of file TTP229.h.

bool operator[] ( size_t  i )

same as ison()

Definition at line 41 of file TTP229.h.