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.

Functional Overview<br />

None<br />

Relevant Interrupts :<br />

INT_PSP<br />

Interrupt fires when PSP data is in<br />

Relevant Include Files:<br />

None, all functions built-in<br />

Relevant getenv()<br />

parameters:<br />

PSP<br />

Returns 1 if the device has PSP<br />

Example Code:<br />

while(psp_output_full());<br />

psp_data=command;<br />

while(!input_buffer_full());<br />

if (psp_overflow())<br />

error=true<br />

else<br />

data=psp_data;<br />

//waits till the output buffer is cleared<br />

//writes to the port<br />

//waits till input buffer is cleared<br />

//if there is an overflow set the error flag<br />

//if there is no overflow then read the port<br />

QEI<br />

The Quadrature Encoder Interface (QEI) module provides the interface to incremental encoders<br />

for obtaining mechanical positional data.<br />

Relevant Functions:<br />

setup_qei(options,<br />

filter,maxcount)<br />

qei_status( )<br />

qei_set_count(value)<br />

qei_get_count( )<br />

Configures the QEI module.<br />

Returns the status of the QUI module.<br />

Write a 16-bit value to the position counter.<br />

Reads the current 16-bit value of the position counter.<br />

Relevant Preprocessor:<br />

None<br />

Relevant Interrupts :<br />

63

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

Saved successfully!

Ooh no, something went wrong!