PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
serial.h
Go to the documentation of this file.
1 
32 #ifndef __SERIAL_H
33 #define __SERIAL_H
34 
35 #include "simpletext.h"
36 
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #endif
41 
45 #define SERIAL_MIN_PIN 0
46 
50 #define SERIAL_MAX_PIN 31
51 
55 typedef struct serial_info
56 { int rx_pin; int tx_pin; int mode; int baud; int ticks;
62 } Serial_t;
63 
68 typedef text_t serial;
69 
85 serial *serial_open(int rxpin, int txpin, int mode, int baudrate);
86 
87 
93 void serial_close(serial *device);
94 
95 
103 int serial_rxChar(serial *device);
104 
105 
115 int serial_txChar(serial *device, int txbyte);
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif
122 /* __SERIAL_H */
123 
124 
serial_info::tx_pin
int tx_pin
Definition: serial.h:58
serial_txChar
int serial_txChar(serial *device, int txbyte)
Send a byte.
Definition: serial_rxtx.c:81
serial_info::ticks
int ticks
Definition: serial.h:61
serial_info
Defines serial interface structure of 9 contiguous int variables.
Definition: serial.h:55
serial_close
void serial_close(serial *device)
Close serial connection.
Definition: serial_close.c:11
serial_info::rx_pin
int rx_pin
Definition: serial.h:57
Serial_t
struct serial_info Serial_t
Defines serial interface structure of 9 contiguous int variables.
simpletext.h
This library provides a collection of functions for communicating with text devices such as SimpleIDE...
serial_info::baud
int baud
Definition: serial.h:60
text_struct
Structure that contains data used by simple text device libraries.
Definition: simpletext.h:81
serial_rxChar
int serial_rxChar(serial *device)
Receive a byte. Waits until next byte is received.
Definition: serial_rxtx.c:40
serial_open
serial * serial_open(int rxpin, int txpin, int mode, int baudrate)
Open a simple (half duplex) serial connection.
Definition: serial_open.c:14
serial_info::mode
int mode
Definition: serial.h:59
serial
text_t serial
Makes declarations like serial lcd to stand in for text_t lcd. Spelling is choice of Parallax educati...
Definition: serial.h:68