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

putc_send( );<br />

fputc_send( );<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

putc_send();<br />

fputc_send(stream);<br />

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

Nothing<br />

Function used to transmit bytes loaded in transmit buffer over RS232.<br />

Depending on the options used in #USE RS232 controls if function is<br />

available and how it works.<br />

If using hardware UARTx with NOTXISR option it will check if currently<br />

transmitting. If not transmitting it will then check for data in transmit<br />

buffer. If there is data in transmit buffer it will load next byte from transmit<br />

buffer into the hardware TX buffer, unless using CTS flow control option.<br />

In that case it will first check to see if CTS line is at its active state before<br />

loading next byte from transmit buffer into the hardware TX buffer.<br />

If using hardware UARTx with TXISR option, function only available if<br />

using CTS flow control option, it will test to see if the TBEx interrupt is<br />

enabled. If not enabled it will then test for data in transmit buffer to send.<br />

If there is data to send it will then test the CTS flow control line and if at<br />

its active state it will enable the TBEx interrupt. When using the TXISR<br />

mode the TBEx interrupt takes care off moving data from the transmit<br />

buffer into the hardware TX buffer.<br />

If using software RS232, only useful if using CTS flow control, it will check<br />

if there is data in transmit buffer to send. If there is data it will then check<br />

the CTS flow control line, and if at its active state it will clock out the next<br />

data byte.<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

All devices<br />

#USE RS232<br />

#USE_RS232(UART1,BAUD=9600,TRANSMIT_BUFFER=50,NOTXISR)<br />

printf(“Testing Transmit Buffer”);<br />

while(TRUE){<br />

putc_send();<br />

}<br />

None<br />

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

TX_BUFFER_BYTES( ), GET( ), PUTC( ) RINTF( ), SETUP_UART( ),<br />

PUTC( )_SEND<br />

237

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

Saved successfully!

Ooh no, something went wrong!