Prusa MINI Firmware overview
Print Class Referenceabstract

#include <Print.h>

Inheritance diagram for Print:

Public Member Functions

 Print ()
 
int getWriteError ()
 
void clearWriteError ()
 
virtual size_t write (uint8_t)=0
 
size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
size_t write (const char *buffer, size_t size)
 
size_t print (const __FlashStringHelper *)
 
size_t print (const String &)
 
size_t print (const char[])
 
size_t print (char)
 
size_t print (unsigned char, int=DEC)
 
size_t print (int, int=DEC)
 
size_t print (unsigned int, int=DEC)
 
size_t print (long, int=DEC)
 
size_t print (unsigned long, int=DEC)
 
size_t print (double, int=2)
 
size_t print (const Printable &)
 
size_t println (const __FlashStringHelper *)
 
size_t println (const String &s)
 
size_t println (const char[])
 
size_t println (char)
 
size_t println (unsigned char, int=DEC)
 
size_t println (int, int=DEC)
 
size_t println (unsigned int, int=DEC)
 
size_t println (long, int=DEC)
 
size_t println (unsigned long, int=DEC)
 
size_t println (double, int=2)
 
size_t println (const Printable &)
 
size_t println (void)
 
void println (int64_t, uint8_t=DEC)
 
void print (int64_t, uint8_t=DEC)
 
void println (uint64_t, uint8_t=DEC)
 
void print (uint64_t, uint8_t=DEC)
 

Protected Member Functions

void setWriteError (int err=1)
 

Constructor & Destructor Documentation

◆ Print()

Print::Print ( )
53  : write_error(0) {}

Member Function Documentation

◆ setWriteError()

void Print::setWriteError ( int  err = 1)
protected
47  {
48  write_error = err;
49  }
Here is the caller graph for this function:

◆ getWriteError()

int Print::getWriteError ( )
55  {
56  return write_error;
57  }

◆ clearWriteError()

void Print::clearWriteError ( )
58  {
59  setWriteError(0);
60  }
Here is the call graph for this function:

◆ write() [1/4]

virtual size_t Print::write ( uint8_t  )
pure virtual

Implemented in USBSerial, HardwareSerial, TwoWire, and WebSocketSerial.

Here is the caller graph for this function:

◆ write() [2/4]

size_t Print::write ( const char *  str)
63  {
64  if (str == NULL) {
65  return 0;
66  }
67  return write((const uint8_t *)str, strlen(str));
68  }
Here is the call graph for this function:

◆ write() [3/4]

size_t Print::write ( const uint8_t buffer,
size_t  size 
)
virtual

Reimplemented in WebSocketSerial, USBSerial, and TwoWire.

34  {
35  size_t n = 0;
36  while (size--) {
37  if (write(*buffer++)) {
38  n++;
39  } else {
40  break;
41  }
42  }
43  return n;
44 }
Here is the call graph for this function:

◆ write() [4/4]

size_t Print::write ( const char *  buffer,
size_t  size 
)
70  {
71  return write((const uint8_t *)buffer, size);
72  }
Here is the call graph for this function:

◆ print() [1/13]

size_t Print::print ( const __FlashStringHelper *  ifsh)
46  {
47  return print(reinterpret_cast<const char *>(ifsh));
48 }
Here is the caller graph for this function:

◆ print() [2/13]

size_t Print::print ( const String &  s)
50  {
51  return write(s.c_str(), s.length());
52 }
Here is the call graph for this function:

◆ print() [3/13]

size_t Print::print ( const char  str[])
54  {
55  return write(str);
56 }
Here is the call graph for this function:

◆ print() [4/13]

size_t Print::print ( char  c)
58  {
59  return write(c);
60 }
Here is the call graph for this function:

◆ print() [5/13]

size_t Print::print ( unsigned char  b,
int  base = DEC 
)
62  {
63  return print((unsigned long)b, base);
64 }
Here is the call graph for this function:

◆ print() [6/13]

size_t Print::print ( int  n,
int  base = DEC 
)
66  {
67  return print((long)n, base);
68 }
Here is the call graph for this function:

◆ print() [7/13]

size_t Print::print ( unsigned int  n,
int  base = DEC 
)
70  {
71  return print((unsigned long)n, base);
72 }
Here is the call graph for this function:

◆ print() [8/13]

size_t Print::print ( long  n,
int  base = DEC 
)
74  {
75  if (base == 0) {
76  return write(n);
77  } else if (base == 10) {
78  if (n < 0) {
79  int t = print('-');
80  n = -n;
81  return printNumber(n, 10) + t;
82  }
83  return printNumber(n, 10);
84  } else {
85  return printNumber(n, base);
86  }
87 }
Here is the call graph for this function:

◆ print() [9/13]

size_t Print::print ( unsigned long  n,
int  base = DEC 
)
89  {
90  if (base == 0) {
91  return write(n);
92  } else {
93  return printNumber(n, base);
94  }
95 }
Here is the call graph for this function:

◆ print() [10/13]

size_t Print::print ( double  n,
int  digits = 2 
)
97  {
98  return printFloat(n, digits);
99 }

◆ print() [11/13]

size_t Print::print ( const Printable x)
107  {
108  return x.printTo(*this);
109 }
Here is the call graph for this function:

◆ println() [1/14]

size_t Print::println ( const __FlashStringHelper *  ifsh)
101  {
102  size_t n = print(ifsh);
103  n += println();
104  return n;
105 }
Here is the call graph for this function:

◆ println() [2/14]

size_t Print::println ( const String &  s)
115  {
116  size_t n = print(s);
117  n += println();
118  return n;
119 }
Here is the call graph for this function:

◆ println() [3/14]

size_t Print::println ( const char  c[])
121  {
122  size_t n = print(c);
123  n += println();
124  return n;
125 }
Here is the call graph for this function:

◆ println() [4/14]

size_t Print::println ( char  c)
127  {
128  size_t n = print(c);
129  n += println();
130  return n;
131 }
Here is the call graph for this function:

◆ println() [5/14]

size_t Print::println ( unsigned char  b,
int  base = DEC 
)
133  {
134  size_t n = print(b, base);
135  n += println();
136  return n;
137 }
Here is the call graph for this function:

◆ println() [6/14]

size_t Print::println ( int  num,
int  base = DEC 
)
139  {
140  size_t n = print(num, base);
141  n += println();
142  return n;
143 }
Here is the call graph for this function:

◆ println() [7/14]

size_t Print::println ( unsigned int  num,
int  base = DEC 
)
145  {
146  size_t n = print(num, base);
147  n += println();
148  return n;
149 }
Here is the call graph for this function:

◆ println() [8/14]

size_t Print::println ( long  num,
int  base = DEC 
)
151  {
152  size_t n = print(num, base);
153  n += println();
154  return n;
155 }
Here is the call graph for this function:

◆ println() [9/14]

size_t Print::println ( unsigned long  num,
int  base = DEC 
)
157  {
158  size_t n = print(num, base);
159  n += println();
160  return n;
161 }
Here is the call graph for this function:

◆ println() [10/14]

size_t Print::println ( double  num,
int  digits = 2 
)
163  {
164  size_t n = print(num, digits);
165  n += println();
166  return n;
167 }
Here is the call graph for this function:

◆ println() [11/14]

size_t Print::println ( const Printable x)
169  {
170  size_t n = print(x);
171  n += println();
172  return n;
173 }
Here is the call graph for this function:

◆ println() [12/14]

size_t Print::println ( void  )
111  {
112  return write("\r\n");
113 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ println() [13/14]

void Print::println ( int64_t  n,
uint8_t  base = DEC 
)
251  {
252  print(n, base);
253  println();
254 }
Here is the call graph for this function:

◆ print() [12/13]

void Print::print ( int64_t  n,
uint8_t  base = DEC 
)
256  {
257  if (n < 0) {
258  print((char)'-');
259  n = -n;
260  }
261  if (base < 2) {
262  base = 2;
263  }
264  print((uint64_t)n, base);
265 }
Here is the call graph for this function:

◆ println() [14/14]

void Print::println ( uint64_t  n,
uint8_t  base = DEC 
)
267  {
268  print(n, base);
269  println();
270 }
Here is the call graph for this function:

◆ print() [13/13]

void Print::print ( uint64_t  n,
uint8_t  base = DEC 
)
272  {
273  if (base < 2) {
274  base = 2;
275  }
276  printLLNumber(n, base);
277 }
Print::print
size_t print(const __FlashStringHelper *)
Definition: Print.cpp:46
NULL
#define NULL
Definition: usbd_def.h:53
Printable::printTo
virtual size_t printTo(Print &p) const =0
uint8_t
const uint8_t[]
Definition: 404_html.c:3
Print::write
virtual size_t write(uint8_t)=0
Print::println
size_t println(void)
Definition: Print.cpp:111
Print::setWriteError
void setWriteError(int err=1)
Definition: Print.h:47
createSpeedLookupTable.b
list b
Definition: createSpeedLookupTable.py:30
size
static png_bytep size_t size
Definition: pngwrite.c:2170