simpletext library  v0.8
Compact variations of put/get write/read and print/scan for smaller program sizes
Data Structures | Typedefs | Functions
serial.h File Reference
#include "simpletext.h"

Go to the source code of this file.

Data Structures

struct  serial_info

Typedefs

typedef struct serial_info Serial_t
typedef text_t serial

Functions

serialserial_open (int rxpin, int txpin, int mode, int baudrate)
void serial_close (serial *device)
int serial_rxChar (serial *device)
int serial_txChar (serial *device, int txbyte)

Detailed Description

Defines serial module

Copyright (c) 2013, Parallax Inc. Written by Steve Denson Symbol naming decided by Parallax

Function Documentation

void serial_close ( serial device)

Close device. Equivalent to a stop function without stopping a cog.

Parameters
deviceis a previously open/started terminal device.
serial* serial_open ( int  rxpin,
int  txpin,
int  mode,
int  baudrate 
)

Initializes the simple serial terminal. Equivalent to a start function which runs assembly in a cog.

Parameters
rxpinis pin number for receive input
txpinis pin number for transmit output
modeis unused mode field (for FdSerial compatibility)
baudrateis frequency of bits ... 115200, 57600, etc...
Returns
device term pointer for use with other functions.
int serial_rxChar ( serial device)

Gets a byte from the receive queue if available. Function does not block.

Parameters
deviceis a previously open/started terminal device.
Returns
receive byte 0 to 0xff or -1 if none available
int serial_txChar ( serial device,
int  txbyte 
)

Sends a byte on the transmit queue.

Parameters
deviceis a previously open/started terminal device.
txbyteis byte to send.
Returns
waits for and returns received byte if mode is 8