17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

touchpad_hit( )<br />

Syntax: value = TOUCHPAD_HIT( )<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

None<br />

TRUE or FALSE<br />

Returns TRUE if a Capacitive Sensing Module (CSM) or Charge Time<br />

Measurement Unit (CTMU) key has been pressed. If TRUE, then a call to<br />

touchpad_getc() will not cause the program to wait for a key press.<br />

All PIC's with a CSM or CTMU Module<br />

#USE TOUCHPAD (options)<br />

// When the pad connected to PIN_B0 is activated, store the letter 'A'<br />

#USE TOUCHPAD (PIN_B0='A')<br />

void main(void){<br />

char c;<br />

enable_interrupts(GLOBAL);<br />

}<br />

while (TRUE) {<br />

if ( TOUCHPAD_HIT() )<br />

//wait until key on PIN_B0 is pressed<br />

c = TOUCHPAD_GETC(); //get key that was pressed<br />

} //c will get value 'A'<br />

Example Files:<br />

None<br />

Also See: #USE TOUCHPAD ( ), touchpad_state( ), touchpad_getc( )<br />

touchpad_state( )<br />

Syntax:<br />

TOUCHPAD_STATE (state);<br />

Parameters: state is a literal 0, 1, or 2.<br />

Returns:<br />

Function:<br />

None<br />

Sets the current state of the touchpad connected to the Capacitive<br />

Sensing Module (CSM). The state can be one of the following three<br />

values:<br />

0 : Normal state<br />

1 : Calibrates, then enters normal state<br />

2 : Test mode, data from each key is collected in the int16 array<br />

TOUCHDATA<br />

326

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!