F439_CPP_SPI_RA8875_TFT_LCD_03 1.0
STM32F439 SPI RA8875 7-inch TFT display demo built on the STM32_GFX and STM32_RA8875 libraries
Loading...
Searching...
No Matches
Print.h File Reference

Arduino-compatible Print base class (independent implementation). More...

#include "STM32_Arduino_Compat.h"
#include "WString.h"

Go to the source code of this file.

Classes

class  Print
 Arduino-compatible text output base class. A subclass provides write(uint8_t); everything else is built on it. More...
 

Macros

#define DEC   10
 Number base for print(): decimal.
 
#define HEX   16
 Number base for print(): hexadecimal.
 
#define OCT   8
 Number base for print(): octal.
 
#define BIN   2
 Number base for print(): binary.
 

Detailed Description

Arduino-compatible Print base class (independent implementation).

Adafruit_GFX derives from Print so a display can be used like a serial port: tft.print("x="); tft.println(42);. Only write(uint8_t) is pure virtual; every print()/println() overload funnels into it.

Floating point is formatted by this class itself (printFloat), not with printf: newlib-nano, the default in CubeIDE, cannot print floats via printf unless "-u _printf_float" is added to the linker flags.

Warning
Not thread-safe or ISR-safe. print()/println() are sequences of separate write() calls; a task switch between two of them lets a second caller's characters interleave into the same display. Serialise access to one display object (a mutex, or one owner task). Do not call from an ISR: drawing over SPI blocks.

Definition in file Print.h.

Macro Definition Documentation

◆ BIN

#define BIN   2

Number base for print(): binary.

Definition at line 32 of file Print.h.

◆ DEC

#define DEC   10

Number base for print(): decimal.

Definition at line 26 of file Print.h.

◆ HEX

#define HEX   16

Number base for print(): hexadecimal.

Definition at line 28 of file Print.h.

◆ OCT

#define OCT   8

Number base for print(): octal.

Definition at line 30 of file Print.h.