beautypg.com

Serial_ctx(), Serial_txlen(), Serial_txbyte () – Maxim Integrated 73S12xxF Software User Manual

Page 41: Serial_rx(), E 41), E 41

background image


UG_12xxF_016

73S12xxF Software User Guide

Rev. 1.50

41

Len: Input parameter.
Specifies the current number of bytes to be sent.

Return Codes S_EMPTY Successful transmission.

S_PENDING, Successful transmission thus far but not yet finished.

Where return code SERIAL_RC is defined as: Enum SERIAL_RC.

Serial_CTx()

Purpose

Put bytes into the transmit buffer and start sending. Prior to calling this function,

Serial_Tx()

must be call to setup the Tx buffer.


Synopsis

Unsigned Integer Serial_CTx ( U08x xdata *buffer, U16 len )


Parameters

buffer: Input parameter
Specifies a pointer to the data buffer containing the data to send to the PC UART.

len: Input parameter.
Specifies the current number of bytes to be sent.

Return Value

Unsigned integer specifying the number of bytes sent thus far.

After calling this API, an application can make sure all bytes were transmitted by checking that

Serial_TxLen()

returns a 0.

Serial_TxLen()

Purpose

Number of bytes transmitted thus far.


Synopsis

Unsigned integer Serial_ TxLen ( void )


Parameters

none.

Return Value Unsigned integer specifying the number of bytes left in the Tx buffer, i.e. the

remaining bytes to be sent.

Serial_TxByte ()

Purpose

Send a quick byte out.


Synopsis

void Serial_TxByte ( U08 cbyte )


Parameters

cbyte: Input parameter
Byte to put at the end of the Tx buffer to be sent out quickly.

Return Codes none.

This function performs similarly to Serial_CTx() ( U08 &cbyte, 1) but it has much less overhead. Use this
API when performance optimization is required yet only one byte can be sent at a time.

Serial_Rx()

Purpose

Setup receive buffer and start receiving. Always call this function after

Serial_Init()

to

make sure the receive buffer is available.

Synopsis

enum SERIAL_RC data *Serial_Rx ( U08x xdata *buffer, U16 len )


Parameters

buffer: Input parameter
Specifies a pointer to the data buffer to store the data received from the PC UART.