Serial_init(), Serial_tx(), E 40) – Maxim Integrated 73S12xxF Software User Manual

Page 40

Advertising
background image

73S12xxF Software User Guide

UG_12xxF_016

40

Rev. 1.50

After calling

Serial_Init()

and prior to receiving data from the RS232 interface,

Serial_Rx()

and

Serial_Tx()

must be called to pass on the receive/transmit buffer pointer, which is used to store Rx and Tx characters,
respectively. For a sample of the Serial API usage, see the Pseudo-CCID application source code.

Serial_Init()

Purpose

Configure the communication speed, flow control, character parity and number of
stop bits. The serial interrupt service routine is NOT maskable, the interrupt vector is
set internally, so using Set_Event (eSerial, ...) will not have any effect. The baud
rates listed below are available for specific CPU clock speeds only. Review the
API_Struct_12.h for more information.


Synopsis

Bbool Serial_Init (

IN enum SERIAL_SPD speed,

IN Boolean parity_en,

IN Boolean parity,

IN Boolean two_stop_bits,

IN Boolean xon_xoff )


Parameters

Speed: Input parameter
This selects the communication speed. Possible values are:

_RATE_600,

0

_RATE_1200,

1

_RATE_2400,

2

_RATE_4800,

3

_RATE_9600,

4

_RATE_14400,

5

_RATE_19200,

6

_RATE_28800,

7

_RATE_38400,

8

_RATE_57600,

9

_RATE_115200,

10

_RATE_125000,

11

_RATE_250000,

12

_RATE_375000

13

Parity_enb: Input parameter
Specifies if the exchanged characters contain a parity bit (TRUE) or not (FALSE).

parity: Input parameter
Specifies if the characters parity bits must be odd (TRUE) or even (FALSE).

Two_stop_bits: Input parameter
Specifies if the exchanged characters contain two stop bits (TRUE) or one (FALSE).

xon_xoff: Input parameter
Specifies if Xon_Xoff control is on (TRUE) or off (FALSE).


Return Codes None.


The lower speeds help support Plug & Play.


Serial_Tx()

Purpose

Setup the Tx buffer before sending data to the PC UART. An application should call
this API immediately after calling

Serial_Init()

.


Synopsis

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


Parameters

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

Advertising