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

Go to the source code of this file.

Data Structures

struct  serial_info

Macros

#define SERIAL_MIN_PIN   0
 Min serial pin value.
#define SERIAL_MAX_PIN   31
 Max serial pin value.

Typedefs

typedef struct serial_info Serial_t
typedef text_t serial
 Makes declarations like serial lcd to stand in for text_t lcd. Spelling is choice of Parallax education, not the author.

Functions

serialserial_open (int rxpin, int txpin, int mode, int baudrate)
 Open a simple serial connection.
void serial_close (serial *device)
 Close serial connection.
int serial_rxChar (serial *device)
 Receive a byte. Waits until next byte is received.
int serial_txChar (serial *device, int txbyte)
 Send a byte.

Detailed Description

Defines serial module - provides low level half duplex serial functions. See simpletext.h for higher level functions.

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

Function Documentation

void serial_close ( serial device)

Close serial connection.

Parameters
deviceA previously opened serial connection.
serial* serial_open ( int  rxpin,
int  txpin,
int  mode,
int  baudrate 
)

Open a simple serial connection.

Parameters
rxpinSerial input pin, receives serial data.
txpinSerial output pin, transmits serial data.
modeUnused mode field (for FdSerial compatibility)
baudrateBit value transmit rate, 9600, 115200, etc...
Returns
device ID pointer for use with simpletext.h and serial.h functions with text_t or serial.
int serial_rxChar ( serial device)

Receive a byte. Waits until next byte is received.

Parameters
deviceID returned by serial_open.
Returns
receive byte 0 to 0xff or -1 if none available
int serial_txChar ( serial device,
int  txbyte 
)

Send a byte.

Parameters
deviceis a previously open/started terminal device.
deviceID returned by serial_open.
Returns
Byte that was transmitted.