Sci_abort( ) built-in function, Syntax, Example – Echelon Neuron C User Manual

Page 151: Sci_get_error( ) built-in function

Advertising
background image

Neuron C Reference Guide

131


void f(void)
{
io_out(software_one_shot,

1);

//turn it on

scaled_delay(4);

//approx. 108 µsec at 10MHz

io_out(software_one_shot,

0);

//turn it off

}

sci_abort( )

Built-in Function

The sci_abort( ) built-in function terminates any outstanding SCI I/O operation in

progress.

Syntax

void sci_abort (

io_object_name

);

Example

IO_8 sci twostopbits baud(SCI_2400) iosci;

when (...)
{
sci_abort(iosci);
}

sci_get_error( )

Built-in Function

The sci_get_error( ) built-in function returns a cumulative OR of the bits shown

below to specify data errors. Calling this function clears the SCI error state.

0x04

Framing error

0x08

Noise detected

0x10

Receive overrun detected

Syntax

unsigned short sci_get_error (

io_object_name

);

Example

IO_8 sci twostopbits baud(SCI_2400) iosci;

when (io_out_ready(iosci)) {
unsigned short sci_error;
sci_error = sci_get_error(iosci));
if (sci_error) {
// Process SCI error
}
else {
// Process end of SCI transmission ...

Advertising