USART_send

Description

Send byte via USART (interrupt driven version)

NOTE: this function uses a FIFO to queue data to be transmitted. It is possible to try to send too much data such that the FIFO cannot hold it all. To avoid data being lost, either the FIFO sould be made big enough to hold all the data, or the same data should be continually written to the FIFO until it is accepted.

Failing to write data is not a flaw, being able to write data without waiting is an enhancement. If a write fails, simply retry the write until it succeads (with task yields where appropriote).

Definition

byte USART_send(char ch)

Library

LIB/usart_int_lib.bas

Usage

On entry:
ch is the data byte to be written to the USART.
On exit:
Return fifo_ok if the character has been successfully queued and is waiting to be transmitted, return fifo_error otherwise.