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.

#INT_QEI<br />

Interrupt on rollover or underflow of the position counter.<br />

Relevant Include Files:<br />

None, all functions built-in<br />

Relevant getenv()<br />

parameters:<br />

None<br />

Example Code:<br />

int16 Value;<br />

setup_qei(QEI_MODE_X2 |<br />

QEI_TIMER_INTERNAL,<br />

QEI_FILTER_DIV_2,QEI_FORWARD);<br />

Setup the QEI module<br />

Value = qei_get_count( );<br />

Read the count.<br />

RS232 I/O<br />

These functions and directives can be used for setting up and using RS232 I/O functionality.<br />

Relevant Functions:<br />

getc() or getch()<br />

getchar() or fgetc()<br />

gets() or fgets()<br />

putc() or putchar() or<br />

fputc()<br />

puts() or fputs()<br />

Gets a character on the receive pin(from the specified stream<br />

in case of fgetc, stdin by default). Use KBHIT to check if the<br />

character is available.<br />

Gets a string on the receive pin(from the specified stream in<br />

case of fgets, STDIN by default). Use getc to receive each<br />

character until return is encountered.<br />

Puts a character over the transmit pin(on the specified stream<br />

in the case of fputc, stdout by default)<br />

Puts a string over the transmit pin(on the specified stream in<br />

the case of fputc, stdout by default). Uses putc to send each<br />

character.<br />

64

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

Saved successfully!

Ooh no, something went wrong!