ArduinoDumbDisplay v0.9.9-r34
DumbDisplay Arduino Library -- https://github.com/trevorwslee/Arduino-DumbDisplay
 
Loading...
Searching...
No Matches
ssdumbdisplay.h
1#ifndef ssdumbdisplay_h
2#define ssdumbdisplay_h
3
4#include "dumbdisplay.h"
5#include <SoftwareSerial.h>
6
7//#define DD_BLUETOOTH_BAUD DUMBDISPLAY_BAUD
8
11 public:
12 /* Software Serial IO mechanism */
13 /* - baud -- default to DUMBDISPLAY_BAUD */
14 /* - enableSerial: enable Serial as well or not (if enabled, connecting via USB will also work) */
15 /* - serialBaud: Serial baud rate (if enableSerial) */
16 DDSoftwareSerialIO(SoftwareSerial* pSS, unsigned long baud = DD_SERIAL_BAUD,
17 bool enableSerial = false, unsigned long serialBaud = DD_SERIAL_BAUD):
18 DDInputOutput(serialBaud, enableSerial, enableSerial) {
19 this->baud = baud;
20 this->pSS = pSS;
21 }
22 const char* getWhat() {
23 return "SS";
24 }
25 bool available() {
26 return pSS->available();
27 }
28 char read() {
29 return pSS->read();
30 }
31 void print(const String &s) {
32 pSS->print(s);
33 }
34 void print(const char *p) {
35 pSS->print(p);
36 }
37 void write(uint8_t b) {
38 pSS->write(b);
39 }
40 void write(const uint8_t *buf, size_t size) {
41 pSS->write(buf, size);
42 }
43 bool preConnect(bool firstCall) {
44 DDInputOutput::preConnect(firstCall);
45 // if (!setupForSerial) {
46 // Serial.begin(serialBaud);
47 // }
48 if (firstCall) {
49 pSS->begin(baud);
50 }
51 //pSS->begin(baud/*DUMBDISPLAY_BAUD*/);
52 return true;
53 }
54 void flush() {
55 pSS->flush();
56 }
57 bool canConnectPassive() {
58 return true;
59 }
60 bool canUseBuffer() {
61 return false;
62 }
63 private:
64 unsigned long baud;
65 SoftwareSerial* pSS;
66};
67
68
69
70#endif
Class for DD input/output; you explicitly constructed it, pass in when instantiate DumbDisplay,...
Definition: _dd_io.h:9
Subclass of DDInputOutput.
Definition: ssdumbdisplay.h:10