17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Built-in Functions<br />

Requires:<br />

Nothing<br />

Examples:<br />

switch( toupper(getc()) ) {<br />

case 'R' : read_cmd(); break;<br />

case 'W' : write_cmd(); break;<br />

case 'Q' : done=TRUE; break;<br />

}<br />

Example Files:<br />

Also See:<br />

ex_str.c<br />

None<br />

touchpad_getc( )<br />

Syntax: input = TOUCHPAD_GETC( );<br />

Parameters:<br />

Returns:<br />

Function:<br />

None<br />

char (returns corresponding ASCII number is “input” declared as int)<br />

Actively waits for firmware to signal that a pre-declared Capacitive<br />

Sensing Module (CSM) or charge time measurement unit (CTMU) pin is<br />

active, then stores the pre-declared character value of that pin in “input”.<br />

Note: Until a CSM or CTMU pin is read by firmware as active, this<br />

instruction will cause the microcontroller to stall.<br />

Availability:<br />

Requires:<br />

Examples:<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 />

c = TOUCHPAD_GETC();<br />

//will wait until one of declared pins is detected<br />

//if PIN_B0 is pressed, c will get value 'A'<br />

Example Files:<br />

None<br />

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

325

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

Saved successfully!

Ooh no, something went wrong!