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.

pwm_set_frequency<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

pwm_set_frequency([stream],frequency);<br />

stream – optional parameter specifying the stream defined in<br />

#USE PWM.<br />

frequency – an int32 constant or variable specifying the new<br />

PWM frequency.<br />

Nothing.<br />

To change the frequency of the PWM signal. Warning this<br />

may change the resolution of the PWM signal.<br />

All devices.<br />

#USE PWM<br />

#USE PWM(OUTPUT=PIN_C2, FREQUENCY=10kHz, DUTY=25)<br />

pwm_set_frequency(1000); //set PWM frequency to 1kHz<br />

None<br />

#use_pwm, pwm_on(), pwm_off(), pwm_set_duty_percent,<br />

pwm_set_duty()<br />

qei_get_count( )<br />

Syntax: value = qei_get_count( [type] );<br />

Parameters:<br />

type - Optional parameter to specify which counter to get, defaults to position<br />

counter. Defined in devices .h file as:<br />

QEI_GET_POSITION_COUNT<br />

QEI_GET_VELOCITY_COUNT<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example<br />

Files:<br />

Also See:<br />

The 16-bit value of the position counter or velocity counter.<br />

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

Devices that have the QEI module.<br />

Nothing.<br />

value = qei_get_counter(QEI_GET_POSITION_COUNT);<br />

value = qei_get_counter();<br />

value = qei_get_counter(QEI_GET_VELOCITY_COUNT);<br />

None<br />

setup_qei() , qei_set_count() , qei_status().<br />

240

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

Saved successfully!

Ooh no, something went wrong!