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.

Functional Overview<br />

printf() or fprintf()<br />

kbhit()<br />

Prints the formatted string(on the specified stream in the case<br />

of fprintf, stdout by default). Refer to the printf help for details<br />

on format string.<br />

Return true when a character is received in the buffer in case<br />

of hardware RS232 or when the first bit is sent on the RCV pin<br />

in case of software RS232. Useful for polling without waiting in<br />

getc.<br />

setup_uart(baud,[stream])<br />

or<br />

setup_uart_speed(baud,[stream]) Used to change the baud rate of the hardware UART at runtime.<br />

Specifying stream is optional. Refer to the help for more<br />

advanced options.<br />

assert(condition)<br />

perror(message)<br />

Checks the condition and if false prints the file name and line<br />

to STDERR. Will not generate code if #DEFINE NODEBUG is<br />

used.<br />

Prints the message and the last system error to STDERR.<br />

putc_send() or fputc_send()<br />

rcv_buffer_bytes()<br />

tx_buffer_bytes()<br />

When using transmit buffer, used to transmit data from buffer.<br />

See function description for more detail on when needed.<br />

When using receive buffer, returns the number of bytes in<br />

buffer that still need to be retrieved.<br />

When using transmit buffer, returns the number of bytes in<br />

buffer that still need to be sent.<br />

tx_buffer_full()<br />

receive_buffer_full()<br />

Relevant Interrupts:<br />

INT_RDA<br />

INT_TBE<br />

When using transmit buffer, returns TRUE if transmit buffer is<br />

full.<br />

When using receive buffer, returns TRUE if receive buffer is<br />

full.<br />

Interrupt fires when the receive data available<br />

Interrupt fires when the transmit data empty<br />

Some chips have more than one hardware uart, and hence more interrupts.<br />

Relevant Include Files:<br />

None, all functions built-in<br />

65

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

Saved successfully!

Ooh no, something went wrong!