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

Note: If the state is set to 1 while a key is being pressed, the touchpad<br />

will not calibrate properly.<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

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

#USE TOUCHPAD (options)<br />

#USE TOUCHPAD (THRESHOLD=5, PIN_D5='5', PIN_B0='C')<br />

void main(void){<br />

char c;<br />

TOUCHPAD_STATE(1); //calibrates, then enters normal state<br />

enable_interrupts(GLOBAL);<br />

while(1){<br />

c = TOUCHPAD_GETC();<br />

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

}<br />

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

} //if PIN_D5 is pressed, c will get value '5'<br />

None<br />

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

tolower( ) toupper( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

result = tolower (cvalue)<br />

result = toupper (cvalue)<br />

cvalue is a character<br />

An 8 bit character<br />

These functions change the case of letters in the alphabet.<br />

TOLOWER(X) will return 'a'..'z' for X in 'A'..'Z' and all other characters are<br />

unchanged. TOUPPER(X) will return 'A'..'Z' for X in 'a'..'z' and all other<br />

characters are unchanged.<br />

Availability:<br />

Requires:<br />

All devices.<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 />

ex_str.c<br />

327

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

Saved successfully!

Ooh no, something went wrong!