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.

Built-in Functions<br />

T5_DIV_BY_1, T5_DIV_BY_2, T5_DIV_BY_4, T5_DIV_BY_8<br />

T5_ONE_SHOT, T5_DISABLE_SE_RESET, or<br />

T5_ENABLE_DURING_SLEEP<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

undefined<br />

Initializes timer 5. The mode specifies the clock divisor (from the<br />

oscillator clock). The timer value may be read and written to using<br />

GET_TIMER5() and SET_TIMER5(). Timer 5 is a 16 bit counter/timer.<br />

This function is only available on devices with timer 5 hardware.<br />

Constants are defined in the devices .h file.<br />

setup_timer_5 (T5_INTERNAL | T5_DIV_BY_2);<br />

None<br />

get_timer5(), set_timer5(), Timer5 Overview<br />

setup_uart( )<br />

Syntax:<br />

setup_uart(baud, stream)<br />

setup_uart(baud)<br />

setup_uart(baud, stream, clock)<br />

Parameters: baud is a constant representing the number of bits per second. A one or zero<br />

may also be passed to control the on/off status.<br />

Stream is an optional stream identifier.<br />

Chips with the advanced UART may also use the following constants:<br />

UART_ADDRESS UART only accepts data with 9th bit=1<br />

UART_DATA UART accepts all data<br />

Chips with the EUART H/W may use the following constants:<br />

UART_AUTODETECT Waits for 0x55 character and sets the UART baud rate to<br />

match.<br />

UART_AUTODETECT_NOWAIT Same as above function, except returns<br />

before 0x55 is received. KBHIT() will be true when the match is made. A call to<br />

GETC() will clear the character.<br />

UART_WAKEUP_ON_RDA Wakes PIC up out of sleep when RCV goes from<br />

high to low<br />

clock - If specified this is the clock rate this function should assume. The default<br />

comes from the #USE DELAY.<br />

307

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

Saved successfully!

Ooh no, something went wrong!