simpletext library  v0.98
Compact variations of put/get write/read and print/scan for smaller program sizes
serial.h
Go to the documentation of this file.
1 
11 #ifndef __SERIAL_H
12 #define __SERIAL_H
13 
14 #include "simpletext.h"
15 
16 #ifdef __cplusplus
17 extern "C"
18 {
19 #endif
20 
24 #define SERIAL_MIN_PIN 0
25 
29 #define SERIAL_MAX_PIN 31
30 
31 typedef struct serial_info
32 {
33  int rx_pin;
34  int tx_pin;
35  int mode;
36  int baud;
37  int ticks;
38 } Serial_t;
39 
44 typedef text_t serial;
45 
60 serial *serial_open(int rxpin, int txpin, int mode, int baudrate);
61 
62 
68 void serial_close(serial *device);
69 
70 
78 int serial_rxChar(serial *device);
79 
80 
90 int serial_txChar(serial *device, int txbyte);
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif
97 /* __SERIAL_H */
98 
99 /*
100 +--------------------------------------------------------------------
101 | TERMS OF USE: MIT License
102 +--------------------------------------------------------------------
103 Permission is hereby granted, free of charge, to any person obtaining
104 a copy of this software and associated documentation files
105 (the "Software"), to deal in the Software without restriction,
106 including without limitation the rights to use, copy, modify, merge,
107 publish, distribute, sublicense, and/or sell copies of the Software,
108 and to permit persons to whom the Software is furnished to do so,
109 subject to the following conditions:
110 
111 The above copyright notice and this permission notice shall be
112 included in all copies or substantial portions of the Software.
113 
114 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
115 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
116 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
117 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
118 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
119 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
120 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
121 +--------------------------------------------------------------------
122 */