ArduinoDumbDisplay v0.9.9-r34
DumbDisplay Arduino Library -- https://github.com/trevorwslee/Arduino-DumbDisplay
 
Loading...
Searching...
No Matches
picodumbdisplay.h
1#ifndef picodumbdisplay_h
2#define picodumbdisplay_h
3
4// #if !(defined DD_4_PICO_TX && defined DD_4_PICO_RX)
5// #error DD_4_PICO_TX and DD_4_PICO_RX need be defined in order to use DumbDisplay for PICO
6// #error e.g. #define DD_4_PICO_TX 8
7// #error e.g. #define DD_4_PICO_RX 9
8// #endif
9
10#include "dumbdisplay.h"
11
12//UART Serial2(8, 9, 0, 0);
13//UART Serial2(DD_4_PICO_TX, DD_4_PICO_RX, 0, 0);
14
15
16
19 public:
20 DDPicoSerialIO(int tx = 8, int rx = 9,
21 unsigned long baud = DD_SERIAL_BAUD,
22 bool enableSerial = false, unsigned long serialBaud = DD_SERIAL_BAUD):
23 DDInputOutput(serialBaud, enableSerial, enableSerial), serial(tx, rx, 0, 0) {
24 this->baud = baud;
25 // if (!enableSerial) {
26 // Serial.begin(serialBaud); // not a good idea to do it here
27 // }
28 }
29 const char* getWhat() {
30 return "PICO";
31 }
32 bool available() {
33 return serial.available();
34 }
35 char read() {
36 return serial.read();
37 }
38 void print(const String &s) {
39 serial.print(s);
40 }
41 void print(const char *p) {
42 serial.print(p);
43 }
44 void write(uint8_t b) {
45 serial.write(b);
46 }
47 void write(const uint8_t *buf, size_t size) {
48 serial.write(buf, size);
49 }
50 bool preConnect(bool firstCall) {
51 if (firstCall) {
52 serial.begin(baud);
53 }
54 return true;
55 }
56 void flush() {
57 }
58 bool canConnectPassive() {
59 return true;
60 }
61 bool canUseBuffer() {
62 return true;
63 }
64 private:
65 UART serial;
66 unsigned long baud;
67};
68
69
70
71//#endif
72#endif
Class for DD input/output; you explicitly constructed it, pass in when instantiate DumbDisplay,...
Definition: _dd_io.h:9
Deprecated. Use DDGenericIO (in genericdumbdisplay.h) instead.
Definition: picodumbdisplay.h:18