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

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Function to determine the number of bytes in receive buffer that still need<br />

to be retrieved.<br />

All devices<br />

#USE RS232<br />

#USE_RS232(UART1,BAUD=9600,RECEIVE_BUFFER=100)<br />

void main(void) {<br />

char c;<br />

if(rcv_buffer_bytes() > 10)<br />

c = getc();<br />

}<br />

None<br />

Also See: _USE_RS232( ), RCV_BUFFER_FULL( ), TX_BUFFER_FULL( ),<br />

TX_BUFFER_BYTES( ), GETC( ), PUTC( ) ,PRINTF( ), SETUP_UART(<br />

), PUTC_SEND( )<br />

rcv_buffer_full( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

value = rcv_buffer_full([stream]);<br />

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

RS232.<br />

TRUE if receive buffer is full, FALSE otherwise.<br />

Function to test if the receive buffer is full.<br />

All devices<br />

#USE RS232<br />

#USE_RS232(UART1,BAUD=9600,RECEIVE_BUFFER=100)<br />

void main(void) {<br />

char c;<br />

if(rcv_buffer_full())<br />

c = getc();<br />

}<br />

None<br />

Also See: _USE_RS232( ),RCV_BUFFER_BYTES( ), TX_BUFFER_BYTES( )<br />

,TX_BUFFER_FULL( ), GETC( ), PUTC( ), PRINTF( ), SETUP_UART( ),<br />

PUTC_SEND( )<br />

243

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

Saved successfully!

Ooh no, something went wrong!