-
Notifications
You must be signed in to change notification settings - Fork 5
/
proxySerial.h
81 lines (64 loc) · 2.15 KB
/
proxySerial.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// μLCD-32PT(SGC) 3.2” Serial LCD Display Module
// Arduino & chipKIT Library
//
// May 10, 2011 release 1 - initial release
// Jun 15, 2011 release 2 - features added and bugs fixed
// Jun 29, 2011 release 3 - setBackGroundColour added and SD card
// Jul 31, 2011 release 4 - stdint.h types for chipKIT compatibility
// Aug 04, 2011 release 5 - chipKIT compatibility with external proxySerial.h
// Aug 07, 2011 release 6 - playing sounds - up to 250 mA!
// Sep 18, 2011 release 7 - dialog window with up to 3 buttons
// Sep 23, 2011 release 8 - ms monitoring to avoid RX TX collapse
// Oct 10, 2011 release 9 - Stream.h class based i2cSerial library
// Oct 14, 2011 release 10 - ellipse and detectTouchRegion from sebgiroux
// Oct 24, 2011 release 11 - serial port managed in main only - setSpeed added - proxySerial still needed
// Oct 27, 2011 release 12 - setSpeed fixed for 155200
// Nov 02, 2011 release 13 - HardwareSerial derived from Stream on chipKIT platform by msproul
// Nov 09, 2011 release 14 - proxySerial as autonomous project with ftoa utility
// Nov 25, 2011 release 15 - faster dialog show/hide and optional area for screen copy to/read from SD
// Nov 29, 2011 release 16 - read pixel colour
//
// proxySerial ensures the right print function is used
//
// CC = BY NC SA
// http://sites.google.com/site/vilorei/
// http://github.com/rei-vilo/Serial_LCD
//
// Based on
// 4D LABS PICASO-SGC Command Set
// Software Interface Specification
// Document Date: 1st March 2011
// Document Revision: 6.0
// http://www.4d-Labs.com
//
//
#include "WProgram.h"
#include "Stream.h"
//#include "Arduino.h"
#define securityDelay 0
#ifndef proxy_Serial_h
#define proxy_Serial_h
// Utilities
String ftoa(float number, byte precision, byte size);
// Objects
class ProxySerial
{
public:
ProxySerial(Stream * port0);
void begin(uint16_t b); // to be managed at serial port level
void print(int8_t i);
void print(uint8_t ui);
void print(int16_t i);
void print(uint16_t ui);
void print(char c);
void print(String s);
uint8_t read();
int8_t available();
void flush();
private:
uint16_t _millis;
void _checkSpeed();
Stream * _proxyPort;
};
#endif