|
cryptnox-sdk-esp32 1.0.0
ESP32 SDK for Cryptnox Hardware Wallet
|
CW_Logger backed by ESP32 UART0. More...
#include <ESP32Logger.h>
Public Member Functions | |
| ~ESP32Logger () override | |
| Default destructor. | |
Initialisation | |
| bool | begin (unsigned long baudRate=115200UL) override |
| Initialise UART0 at the given baud rate. | |
Print (no newline) | |
| void | print (const __FlashStringHelper *str) override |
| Print a PROGMEM string. | |
| void | print (const char *str) override |
| Print a NUL-terminated C string. | |
| void | print (char c) override |
| Print a single character. | |
| void | print (uint8_t value, int base=DEC) override |
| Print an 8-bit unsigned integer. | |
| void | print (uint16_t value, int base=DEC) override |
| Print a 16-bit unsigned integer. | |
| void | print (uint32_t value, int base=DEC) override |
| Print a 32-bit unsigned integer. | |
| void | print (int value, int base=DEC) override |
| Print a signed integer. | |
Println (with trailing newline) | |
| void | println () override |
| Print a CR+LF newline sequence. | |
| void | println (const __FlashStringHelper *str) override |
| Print a PROGMEM string followed by a newline. | |
| void | println (const char *str) override |
| Print a NUL-terminated C string followed by a newline. | |
| void | println (char c) override |
| Print a single character followed by a newline. | |
| void | println (uint8_t value, int base=DEC) override |
| Print an 8-bit unsigned integer followed by a newline. | |
| void | println (uint16_t value, int base=DEC) override |
| Print a 16-bit unsigned integer followed by a newline. | |
| void | println (uint32_t value, int base=DEC) override |
| Print a 32-bit unsigned integer followed by a newline. | |
| void | println (int value, int base=DEC) override |
| Print a signed integer followed by a newline. | |
Private Attributes | |
| bool | m_initialized = false |
true after a successful begin call. | |
CW_Logger backed by ESP32 UART0.
Outputs all log traffic through UART0 (the default USB-serial console on most ESP32 dev kits). The __FlashStringHelper overloads are accepted for Arduino source-compatibility but the pointer is treated as a plain RAM pointer — there is no Harvard-architecture flash on ESP32.
print / println method before begin is a no-op.Definition at line 48 of file ESP32Logger.h.
|
inlineoverride |
Default destructor.
Definition at line 191 of file ESP32Logger.h.
|
override |
Initialise UART0 at the given baud rate.
| [in] | baudRate | UART baud rate (default 115200). |
true on success, false if UART driver installation fails. Definition at line 95 of file ESP32Logger.cpp.
References m_initialized, UART_LOG_PORT, and UART_RX_FLOW_THRESH_NONE.
Referenced by app_main().
|
override |
Print a single character.
| [in] | c | Character to print. |
Definition at line 126 of file ESP32Logger.cpp.
References m_initialized.
|
override |
Print a PROGMEM string.
On ESP32 the pointer is treated as a plain RAM pointer; no special flash-read logic is applied.
| [in] | str | NUL-terminated string to print (must not be NULL). |
Definition at line 112 of file ESP32Logger.cpp.
References m_initialized, and uart_write_str().
Referenced by println(), println(), println(), println(), println(), println(), and println().
|
override |
Print a NUL-terminated C string.
| [in] | str | String to print (must not be NULL). |
Definition at line 119 of file ESP32Logger.cpp.
References m_initialized, and uart_write_str().
|
override |
Print a signed integer.
Outputs a '-' prefix for negative values when base is DEC.
| [in] | value | Integer to print. |
| [in] | base | Numeric base (see print(uint8_t,int)). |
Definition at line 157 of file ESP32Logger.cpp.
References clamp_base(), m_initialized, and write_uint_to_uart().
|
override |
Print a 16-bit unsigned integer.
| [in] | value | Integer to print. |
| [in] | base | Numeric base (see print(uint8_t,int)). |
Definition at line 141 of file ESP32Logger.cpp.
References clamp_base(), m_initialized, and write_uint_to_uart().
|
override |
Print a 32-bit unsigned integer.
| [in] | value | Integer to print. |
| [in] | base | Numeric base (see print(uint8_t,int)). |
Definition at line 149 of file ESP32Logger.cpp.
References clamp_base(), m_initialized, and write_uint_to_uart().
|
override |
Print an 8-bit unsigned integer.
| [in] | value | Integer to print. |
| [in] | base | Numeric base: DEC (10), HEX (16), OCT (8), or BIN (2). Defaults to DEC. |
Definition at line 133 of file ESP32Logger.cpp.
References clamp_base(), m_initialized, and write_uint_to_uart().
|
override |
Print a CR+LF newline sequence.
Definition at line 173 of file ESP32Logger.cpp.
References LOGGER_NEWLINE, m_initialized, and uart_write_str().
Referenced by println(), println(), println(), println(), println(), println(), and println().
|
override |
Print a single character followed by a newline.
| [in] | c | Character to print. |
Definition at line 192 of file ESP32Logger.cpp.
|
override |
Print a PROGMEM string followed by a newline.
| [in] | str | NUL-terminated string to print (must not be NULL). |
Definition at line 180 of file ESP32Logger.cpp.
|
override |
Print a NUL-terminated C string followed by a newline.
| [in] | str | String to print (must not be NULL). |
Definition at line 186 of file ESP32Logger.cpp.
|
override |
Print a signed integer followed by a newline.
| [in] | value | Integer to print. |
| [in] | base | Numeric base (see print(uint8_t,int)). |
Definition at line 216 of file ESP32Logger.cpp.
|
override |
Print a 16-bit unsigned integer followed by a newline.
| [in] | value | Integer to print. |
| [in] | base | Numeric base (see print(uint8_t,int)). |
Definition at line 204 of file ESP32Logger.cpp.
|
override |
Print a 32-bit unsigned integer followed by a newline.
| [in] | value | Integer to print. |
| [in] | base | Numeric base (see print(uint8_t,int)). |
Definition at line 210 of file ESP32Logger.cpp.
|
override |
Print an 8-bit unsigned integer followed by a newline.
| [in] | value | Integer to print. |
| [in] | base | Numeric base (see print(uint8_t,int)). |
Definition at line 198 of file ESP32Logger.cpp.
|
private |